Book Review: php|a’s Guide to Programming with Zend Framework
April 18th, 2008 by Ivo
I've recently read Cal Evans's Zend Framework book.
Before I voice my opinion, a disclaimer: I have met Cal personally; in fact I'm having diner with him next Monday, I'm writing a book for php|architect, and my company is a Zend partner. I could not be any more biased.
If you still trust my judgement (and I will try to remain objective), read on.
First of all, the book is fun to read. I like Cal's writing style. He's able to teach stuff while keeping it light and funny. And that works; the book is never dull so it's easy to read in a short time frame. (I never read things in a short time frame though, still took me a month to read it, but that's me; not the book.)
The book first covers the important bits of ZF, such as setting up a ZF application, and working with views and the controller.
What I really liked was that Cal covers the Model properly. Recently there was some fuzz: the now infamous 'heckler at the phplondon conference' called framework authors 'criminals' because they called their frameworks MVC while they only provided Views and Controllers. Cal discusses how to use both a thin model (just a wrapper for the database) and a thick model (business logic) in a Zend Framework application. The book demonstrates, with example code, that you don't need a 'Model' class in the framework itself to work with a Model. A Model is application specific anyway, it contains the business logic of the application. This was refreshing. It was almost as if it was written because of the phplondon incident but the book was written well before that.
After covering all the important bits, some less important but nevertheless useful topics are covered: caching, web services and two-step views (layouts).
The book is full of code samples, and from the book's website you can download the sample code so you don't have to copy the code from the book manually.
Of course, I also have a little criticism. In some parts of the book, things are explained rather quickly. In particular in the web services part, I had to reread some parts a few times before I grasped them. I had the feeling that the rest of the book had a calmer pace, which made it easier to understand what was explained.
Also, there were a few bugs in the book, in particular spelling. However I must be careful to say that, my book might have the same issue.
Regarding bugs in the example code; Cal keeps track of them at the book's companion site, so if you run into an issue when running the sample code, first check the site to get the latest code.
All things considered, it is a useful, well-written introduction to the Zend Framework. I can recommend anyone who just started working with the framework, and anyone considering to use it, to read the book. It will not only show you how to get things done, it will also give some insight into how the framework works and why things are the way they are, and this greatly helps to understand the framework.