Review: Zend Framework 1.8 Web Application Development

At the beginning of February PACKT Publishing sent me a copy of Zend Framework 1.8 Web Application Development by Keith Pope and asked me to post a review.  Unfortunately a bunch of stuff came up, so it wasn’t until this last week that I got a chance to really look it over.  Here are some of my thoughts.

The book is structured in two parts.  The first two chapters cover the basic setup of the Zend Framework (ZF) and, more specifically, a look at its Model-View-Controller (MVC) implementation.  Almost all of the book from there on out focuses on building a real-world ecommerce application using ZF.  I tend to be a learning-by-doing type of person, which I think tends to be true of many programmers, so I think this is a pretty good way to lay out a book.

Much of the book focuses on Models, and how to use various ZF components to implement your domain logic.  Most people agree nowadays that you should have fat models and skinny controllers (in that your controllers should really just have enough code to facilitate your models doing the work), and Keith Pope’s focus on models really hits this home in the book.  The topics of user accounts, the shopping cart and the catalog are all addressed in this light, while still bringing up topics like forms, controllers, views, action helpers, etc.

In general, the book focuses on best practices, which I think is really important for new ZF developers.  Because one of the guiding principals of the Zend Framework is that it gives you freedom to implement things however you like and use only the components you want, it can be hard for people just getting started to get a sense of how they should use certain components, and particularly how everything falls together in a “typical” MVC application.   Following along with the development of the storefront application in this book is a great way to see how those components often are used together.

That said, there are ways in which the code in this book is outdated or less-than-ideal.  As with anything that moves as fast as the Zend Framework has been moving, it’s hard to keep up with the latest tricks and best practices (and in some places it feels like they skipped on editing to try to publish the book before it got too outdated—there are plenty of minor code inconsistencies and typos throughout).  This book is a good place to get started, but keep in mind that the Zend Framework is already at 1.10, with 2.0 on the horizon, so anything that’s not the Zend Framework Official Documentation is in danger of being out of date at any moment.

Also, keep in mind that there’s already a lot of good information out there, so if you don’t mind finding it yourself, you might not need a book.  In fact, I found that most of the code in the authorization chapter was almost a direct copy of Matthew Weier O’Phinney’s blog post on Applying ACL’s to Models.  If you read blogs like Matthew’s (who is the project lead for ZF, and a fantastic resource) and spend time on #zftalk you can figure most things out on your own (Ben Scholzen’s demo application is another good starting point).  The information may be a little scattered, but it’s out there.

In the end, I think that this book would be a really helpful resource to someone who’s just getting started with MVC architecture and other design patterns in PHP.  It also is a good way to see most of the Zend Framework best practices put to use in one place.  On the other hand, if you want the latest information available and are willing to work for it, everything you need is probably online and free.

Some resources that might be helpful to new ZF developers:

Related posts:

  1. Better Zend Framework Documentation If you’ve every tried to navigate the Zend Framework documentation’s...
  2. Installing Zend Server & Zend Framework on OS X This post is mostly a reminder to myself, but I...
  3. PHP Modeling (in Zend Framework) I’ve been thinking a lot about Modeling in a MVC...
  4. Zend Framework Bash Completion Script If you use the Zend Framework CLI interface much you...
  5. Zend Framework URI validator & filter For the last couple of months I’ve been incorporating portions...
This entry was posted in Zend Framework and tagged . Bookmark the permalink.