Reading recommendation: PHP Design Patterns - Blog - Open Source - - php, photography and private stuff

Reading recommendation: PHP Design Patterns

Yesterday I received "PHP Design Patterns", the new book written by Stephan Schmidt, a well-known PHP community member and creator of cool library packages, like most of the PEAR XML section. I seized the time on the tram yesterday night to take a look at it and I have to admit I'm quite impressed. Stephan managed to write down a lot of practical experience in respect to the implementation of OO patterns with PHP.

The book is really well structures and I can only recommend it to everyone who wants to learn more on good OO development with PHP. Stephan first presents the new OO features of PHP 5 (based on 5.1), including overloading and some SPL stuff. The second chapter introduces basic OO design concepts to the reader and makes him familiar with basic UML. After that, Stephan starts the real topic. Chapter 3 deals with generation patters like Singleton and Factory. The following part has structural patterns as the topic and contains patterns like Composite, Decorator and Proxy. For each of these patterns Stephan explains the sense behind it and its purpose. Additionally he gives a practical example of how an implementation could look like, for a specific use case. Chapter 5 deals with behavior patterns, as there are Subject/Observer, Visitor, Iterator and some more, in the same way. The next section is named "Enterprise Patterns" and consists of 2 chapters. The first of those (chapter 6 "Data View and Business Logic") introduces the tier model for application and presents patterns used on the data level, like Active Record and Registry, as well as for implementing business logic (Domain Model). The second part (chapter 7 "Presentation Tier") goes into detail on e.g. Front Controller, Event Dispatcher and Template View.

All in all I really enjoyed digging into the parts I already read and I expect the rest to be as well as those. While some books only touch the theory of design patterns and avoid giving practical examples to the user, Stephan manages very good to combine both.

I want to recommend this book to everyone who is not absolutely familiar with OO development in PHP or who comes from another OO language into PHP development. It can really give you some highly important knowledge on object oriented design patterns and on good OO development in PHP. Beside that, it can give every OO developer from other languages a nice overview and reference on how the well-known patterns are implemented in PHP in contrast to e.g. Java or C#.

Great work, Stephan!

If you liked this blog post or learned something, please consider using flattr to contribute back: .



Add new comment

Fields with bold names are mandatory.