Adam Petersen - Software Development Pages, Book Reviews Section
Start News Articles Book Reviews

Book Review

PHP 5 Objects, Patterns, and Practice
by Matt Zandstra

ISBN: 1590593804
Publisher: Apress
Pages: 438


This book takes off behind basic PHP syntax and puts its focus on object-oriented design and software development practices. As the title hints, the book consists of three major parts.

I found the initial part, covering the object-oriented enhancements in PHP 5, valuable. The features are presented in a concise and easily accessible style, which serves as a very good introduction to the object-oriented features of PHP 5. Unfortunately, the author fills the last 10 pages of this chapter with a UML introduction. In my opinion, the book would benefit from removing this introduction; there are many books covering the same ground and most programmers can read a class-diagram anyway.

The main part of the book is devoted to design- and enterprise-patterns and particularly their implementation in PHP. After some brief pattern history and introduction to classic design principles, Zandstra walks the reader through the implementation of some common patterns such as Factory Method, Façade, and Registry. The pattern catalogue is of course not complete, but serves its purpose by highlighting language specific implementation techniques. I particularly liked Zandstra demonstration on how reflection can make the implementation of patterns like Command more flexible.

The last part of the book departs from pure coding and focuses on important development techniques and tools. Although I like Zandstra’s treatment of issues such as version control, documentation, and unit testing, I have mixed feelings about the chapter as a whole. I believe that it is important to highlight the importance and value of PEAR (PEAR is a framework and distribution system for reusable PHP components) and I also believe in teaching good practices such as unit testing. The detailed instructions to the various tools, however, are already available in easily accessible online manuals and could be left out of the book.

To summarize, I would recommend this book to everyone who already knows the basic PHP syntax and wants a solid introduction to the object-oriented additions to PHP 5. Zandstra’s enthusiasm and practical writing style makes the book a pleasure to read.

Reviewed July 2005


©2005 Adam Petersen adam@adamtornhill.com