← Back to library

PHP 5 Objects, Patterns, and Practice

By Matt Zandstra

PHP 5 Objects, Patterns, and Practice

You can view this book's Amazon detail page here.

Tags: classes, object-oriented, objects, OO, patterns, PHP5, singleton, structure

Started reading:
10th October 2007
Finished reading:
29th October 2007

Review

Rating: 7

This book outlines many concepts valuable to the PHP developer seeking to take advantage of the full range of object-oriented enhancements added to the language with PHP 5. Although much of the book could easily have been converted to any object-oriented language, Zandstra begins with a solid introduction to the various php-specific functions specifically designed for programmers wishing to use php in an object-oriented fashion.

From there, he introduces a number of patterns of object-oriented design along with their intended uses, all with a mind to help programmers create the most orthogonal code possible (code that can be switched out easily with minimal impact on other parts).

His final section, on good programming practice, introduces coding tools such as CVS, phing, php documentor, and the PEAR packages, and helps point out common bad habits to avoid.

For me, having this book has already helped me to write and design better code. And it’s gotten me interested in learning more about design patterns and how they can enhance not just my code but the very vocabulary with which I describe it.

On the downside, I found parts of this book confusing. When he introduced the Factory and Abstract Factory patterns for instance, Zandstra never clearly stated which examples were the actual patterns and which ones were merely other possible designs that Factory could improve upon. In addition, there were numerous minor spelling errors and places where the book had clearly once said something different. Mistakes like these could be very confusing and sometimes forced me to reread a section to figure out what was actually meant.

Also, the book was written back when the latest version of PHP was 5.0.1. As a result, some of the features of the language have changed. To Zandstra’s credit, he does make a note whenever he thinks a function doesn’t behave quite like it should and recommends testing to see if the anomalous behavior might have changed.

Overall this is a good book that I’m glad to have on my shelf, and I’m sure I’ll refer to it again and again. But I’d really like to see a second edition.

Powered by Rob Miller's Now Reading plugin.