PHP 5 Objects, Patterns, and Practice
July 31st, 2010 by CGI & PHP.comProduct Description
…if you have seen true object-oriented development, and have had trouble using these concepts in PHP; don't despair any longer. Matt (Zandstra) has done all the work for you–all you need is a weekend or two to do a little reading. While being an easy read, Zandstra's introduction to the object-oriented features is, I believe, perfectly adequate to get started with object-oriented PHP programming. — Lasse Koskela, JavaRanch Bartender PHP 5 Obje… More >>
PHP 5 Objects, Patterns, and Practice
Popularity: 8% [?]

PHP Objects, Patterns, and Practice, Second Edition
Professional PHP Design Patterns
PHP 5 in Practice
OCP Java SE 6 Programmer Practice Exams
Real World Java EE Patterns Rethinking Best Practices
Pro PHP: Patterns, Frameworks, Testing and More






July 31st, 2010 at 5:42 pm
i enjoyed reading the book and learned a lot though i consider myself as an expierenced php programmer. basic and advanced stuff together with a balanced mixture. patterns make programming complex software architectures easier.
Rating: 5 / 5
July 31st, 2010 at 6:57 pm
This is a great resource for learning the Object oriented aspects of PHP and how to use the various design patterns. I have learned a lot of useful information using this book.
Rating: 5 / 5
July 31st, 2010 at 9:30 pm
Learning PHP is easy and rewarding, but as your software grows you will need to know how to manage your code, work as a team, and break your problems down into well defined abstractions. This book gathers together all the tools you need in around 400 pages. Not too long considering its scope. It's a practical guide with an easy style that gets straight to the point. It's a great introduction not just to PHP 5 but to object oriented methods in general. If you're just getting started, or if you're an old hand and want to see how large scale applications can be written in PHP, I recommend you read this book.
Rating: 5 / 5
July 31st, 2010 at 10:33 pm
The first quarter of this book is an excellent primer on what's new and different in PHP5's objects; much better than the terse, incomplete, and often times grammatically broken, descriptions one finds in the free online documentation. The remaining three quarters, while generally well written when you look at individual segments, commit the most heinous of errors the author strives to warn against: repetition. It seems like every other page contains a "Gang of Four" reference, complete with a thorough description of who the "Gang of Four" are and what the "Gang of Four" did and all the various reasons why you should run out and buy the "Gang of Four's" book instead of this one. By the fourth captioned pull-quote I just wanted to strangle the editor for allowing this to go to press. Once is enough, thank you.
Rating: 3 / 5
July 31st, 2010 at 10:57 pm
Apress publishes some great books (definitely check out Pro JavaScript Techniques and Pro JavaScript Design Patterns if you're working with AJAX). This book definitely lives up to that high standard.
The first part of the book provides a concise but very informative treatment of PHP5's object-oriented functionality, providing some valuable context for those less familiar with OO and demonstrating some of the more exotic features for veterans.
After discussing what patterns are, why they're useful, and some of their basic principles, the book then dives into the patterns themselves. Each pattern is presented according to a standard format: The Problem (what architectural nightmare you're trying to escape from), Implementation (the structure of the pattern, with plenty of explanation and sample code), and Consequences (the advantages and disadvantages of the pattern in various situations).
For the most part, the patterns are presented in a sensible order, starting with more basic patterns, and moving on to more complex ones which build on those concepts. Where appropriate, the book introduces a pattern with less-than-optimal code, and then shows you how to refactor it to improve the pattern. This way, you understand *why* the patterns are designed in particular (and sometimes less-than-intuitive) ways. In essence, you're starting with sloppy code, and then working through a series of refactorings to get the pattern to emerge.
All the usual suspects are here: Singleton, Factory, Composite, Decorator, Facade, Strategy, Observer, Visitor, Command, etc. The writing is clear and to-the-point, uses good examples (with a few exceptions), and addresses possible points of confusion from the get-go. Throughout, the basic pattern principles are emphasized and reinforced, especially when you've just seen an example that exemplifies them.
To be honest, I haven't finished the book–I'm on chapter 12 (Enterprise Patterns, which covers MVC)–but I've already learned so much that I have no qualms giving this a five-star review.
I have noticed a few errors in the code examples (mostly typos–misnamed methods and the like), but as long as you're paying attention to the text, you'll be able to spot them, and this has probably been fixed in the second edition.
By the way, don't pay the going rate in the Amazon Marketplace for this first edition–you can get the second edition for ten bucks cheaper.
Rating: 5 / 5