LXer Book Review: Practical CakePHP Projects
Unfortunately “Practical CakePHP Projects” only partially succeeds in that. It is refreshing to see how applications are built that are different from the proverbial “blog” or “store” example (though both are used in the first chapters), but I find myself disagreeing often with how these applications are built. The chosen solutions often seem to work against the framework instead of going with it.
After the blogging example--which seems to be the “Hello World!” of MVC frameworks--follow chapters that show off e-commerce sites, Google and Yahoo maps clients and Twitter mashups. Interesting examples but not optimally implemented. The e-commerce site implements it's own nested categories instead of using a TreeBehavior and exposes private controller methods as publicly accessible actions. The forum example tries to shoehorn the Command Pattern on the framework.
A more onerous example is the dynamic data fields in chapter 12, which allow SQL injection. Joshua Bloch said it very nicely in his TechTalk on API design.
A true statement for a very simple reason: Example code gets copied and put into production, no matter how big the disclaimers are that you put next to them.
Reading the book leaves me with the feeling that the authors are trying to coax the framework into doing things it is not really suitable for. It is interesting to see how they achieve their goals but I do not have the feeling that I am a better CakePHP developer after studying their projects.
Accompanying the book is a downloadable archive that contains the source code for almost all the examples in the book. A good idea considering there are plenty of examples which are longer than usual for such books. The examples do not work out of the box unfortunately. They all require a running (MySQL) database and the SQL schemas are not supplied with the examples. They need to be copied manually from the book. A missed opportunity, especially when you consider that CakePHP can use SQLite databases so that the applications could have run out of the box.
In addition to that, some of the examples contain bugs and errors that need to be fixed before the examples will run at all. I am not talking about some edge case bugs here but clear and simple errors that pop up as soon as you try to run the projects. These errors should have easily been caught just by trying to run the examples.
Overall I expected more from this book. It has shown me a few interesting ways to (ab)use CakePHP to make it do what you
want, but I don't feel that this book has helped me build better CakePHP applications. Combined with the quality of the
examples themselves I can't give this book a higher rating than 6 out of 10.
You cannot post until you login.