I was lucky enough to pick up a couple of free books from the recent PHP Unconference Europe, one of which was Beginning Zend Framework by Armando Padilla. Having not looked into Zend Framework for a while I thought I would read the book to refresh my knowledge catch up and post a review.
The premise of the book was to create a sample application to keep track of music artist information, with each chapter building on the code from the previous. The first few chapters are about installing Apache, PHP and MySQL and some UML diagrams of the application that will be built. After reading this I was actually enthusiastic about the application and couldn't wait to get started.
The book is generally well written in a nice and friendly tone, but the actual book is quite lacking on useful content and feels almost rushed. After the initial excitement of the project that would get built at the end of the book I started to realise that some fundamental things were missing. The one and only reference to any session management in the book is about page 200, and even then this is not a maintainable or managable solution and didn't use the Zend_Auth class at all. I appreciate that the majority of the work should be given to the reader of the book to do, but even so, not explaining session management properly felt a bit disappointing.
Many of code examples (especially within the database and forms sections) are given 3-4 times, which seemed kind of redundant. Taking the form section as example they are first created as flat html, then using a Zend_Form object within a public method in the controller, and then finally as an included class. What surprised me was that his example class didn't extend Zend_Form. Some of the examples also had simple mistakes that would cause major errors like missing closing braces or typos. I almost feel that the book could have been 200 pages shorter but have the same content. I kept reading code examples and saying "that looks like a useful bit of code, but I wouldn't have done it like that".
What frustrated me more than anything about this book was that there was little or no emphasis on the use of object oriented principles or best practice use of Zend Framework components. Classes where simply included using include(), rather than regestering them with the autoloader, and although Zend_Tool was introduced and used to create the project it was soon circumvented by creating new classes and actions by hand.
There are lots of reference tables and lists so I will probably be looking at the book in the future to refresh my memory on the specific components of objects like Zend_Db_Select. Unfortunately, I can't recommend this book as a beginners tutorial for Zend Framework. There just isn't enough good quality advice in the book for beginners to set out in the world of Zend Framework with confidence.