Review: CakePHP Application Development

Published on and tagged with book  cakephp

In this article I’m going to have a look at the book CakePHP Application Development (on Amazon) written by Ahsanul Bari and Anupom Syam.

The book is directed at CakePHP newbies, and consists of three parts: introduction and first steps, explanation of the basic concepts, and building a real application.

The first part starts with a high-level introduction to CakePHP and MVC. Next follows a chapter about the installation. My impression of that chapter is mixed: on the one hand it explains in detail how to download CakePHP (including four screenshots *g*), on the other hand the chapter ends with CakePHP’s start screen showing a notice (“Please change the value of Security.salt…”) and that database.php is not available. Even though both issues are covered later in the book, it would make sense to address them in the installation chapter. Or maybe it should be merged with the next chapter, which is about building the first application (a simple to-do-list application). It’s a good decision of the authors to bake this first application manually (i.e. without scaffolding and the bake script).

The second part covers the basic concepts of CakePHP: controllers including components (see sample chapter), models, and views (including layouts, elements, and helpers). Plus the bake script. For some reason model behaviors and plugins are not covered…

Especially with the model chapters you have to be careful, because some information is already outdated (the authors used CakePHP 1.2 beta and release candidate 1 (RC1)). For example, the methods generateList() and execute() no longer exist in the current RC2, and in conditions you now have to use:

'conditions' => array('ModelName.field_name comparison_operator' => 'value')

instead of

'conditions' => array('ModelName.field_name' => 'comparison_operator value')

What I didn’t like is the chapter about bake. I think bake is quite self-explanatory and hence it is not necessary to explain each step. The respective pages would have been better used to describe how to write your own shell scripts…

In the third part a Q&A (Questions & Answers) application is built from scratch. It starts with applying of what has been learned in the first two parts. Then follow two chapters dedicated to user authentication and AJAX, respectively. And finally there is a chapter covering pagination and RSS feeds, among other things.

What I liked about the book is the example-driven approach and how the book is structured. Throughout the book the same pattern is used: First comes a short introduction describing what will be done in the respective section. Then follows a “Time for Action”, a step-by-step guide of what has to be done. And last, but not least, comes a “What Just Happened?” part with explanations of what was done during the “Time for Action”.

What I didn’t like is the formatting of the code snippets: the indentation of the code looks rather randomly. Another distracting thing is that the proofreader was not very good in catching typos ;-)

All in all the book is a decent introduction to CakePHP with some weaknesses.

Reviews by others (in chronological order):

11 comments baked

  • Abhimanyu

    I appreciate your review… I have to get some CakePHP print material for my team soon.

    BTW, There are many things in Cake which are changed since last a few months, I was quite sure that some info in the book is likely to be outdated.

  • cakebaker

    @Abhimanyu: Thanks for your comment!

    A review of the other book, “Beginning CakePHP”, is coming soon.

    And yes, it is a common problem of books covering projects under heavy development: the author(s) start with version x, and at the time the book is published version x + y is already relevant…

  • Khaled

    yeah I dislike the miss-formatted code blocks ! and also sometimes they wrote some short explanations and othertimes they wrote long long explanation

  • Brendon Kozlowski

    I second the last sentiment about the proofreading. Regardless of the seemingly push-to-publish editing, language was created primarily for one person to understand another, and I had little issue understanding what was being said, or meant in the code.

    I think I’m to chapter 6 now, and the reading is fairly quick and easy. When you are able to get through “Beginning CakePHP”, Dan, could you give an overview of which book you think would be geared more towards advanced developers at this point in time? I feel like having read through the manual 5 times and now having worked on my first CakePHP project that these books aren’t as relevant as I had hoped…but still very useful – don’t get me wrong there. :)

    Thanks for the review!

  • Tarique Sani

    Thanks you saved me the trouble of buying the book to satisfy my curiosity ;-)

  • cakebaker

    @Khaled, Brendon, Tarique: Thanks for your comments!

    @Khaled: Yes, sometimes they could have written shorter explanations, especially if something has already been explained. On the other hand there are probably also parts where more explanations would have been useful, but that’s difficult to gauge for me as I’m not a CakePHP newbie.

    @Brendon: Well, this book is not really for advanced Cake developers, it is for people doing their first steps with CakePHP. If you already worked on some Cake projects, you probably won’t find much new stuff in this book.

    Anyway, good luck with your first CakePHP project :)

    @Tarique: *g*

  • CakePHP Book Reviews - Ahsanity - Ahsan - Ahsanul Bari

    […] Daniel Hofstetter (Cakebaker) […]

  • Jason Leveille

    Thanks for adding a link to my review Daniel. BTW, I’ve been reading your blog for a while now. Thanks for all you have provided to the Cake project.

  • cakebaker

    @Jason: You are welcome!

  • Book Review: CakePHP Application Development | PseudoCoder.com

    […] I know how guy #497 of the Houston 500 felt. There isn’t much new to cover, as it has all been said before. I will say the grammar didn’t bother me, like it did most of the […]

  • Eelco Wiersma

    Hey thanks for adding me to the list also :)

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License