Aliaspooryorik
ColdFusion ORM Book

Book Review: PHP 5 Objects, Patterns, and Practice

So what am I, a ColdFusion developer, doing reading a PHP book? Well, I do work on PHP sites. However my main reason for reading this book is that ColdFusion and PHP have a lot in common. Both are web-orientated, loosely typed languages that started out as purely procedural, which have added object orientated features. There is a real lack of OOP books for the ColdFusion community and although this book is PHP based it is not that hard to translate the concepts to ColdFusion. Anyway, on with the review!

With version 5, PHP has grown up and can now be considered for building enterprise level applications in OOP. This book is aimed PHP developers who want to make the leap to OOP.

As the title of the book suggests, the book is split into three sections; objects, design patterns and good practice.

The Objects section is a pretty good guide which introduces the reader to the fundamentals of Object Orientated programming. However, despite the fact that handling data entered in forms is such a common thing to do in web development, this book makes no mention of how you would go about getting, validating and storing that data. To me this is a big oversight in a book that aims a getting existing procedural developers to switch to OOP.

The Design Patterns section covers all the well-known design patterns that are listed in the seminal work by the Gang of Four "Design Patterns: Elements of Reusable Object-Oriented Software". Before the author delves into the patterns, there is a good chapter entitled "Some Pattern Principles". This acts as a good segue between the OOP section and the Design Patterns section. This chapter also does a good job of getting the reader up to speed with UML.

The explanations are good and are demonstrated with accompanying code. I the patterns where introduced according to type, such as "generating objects" (e.g. Factory Method). The problem is presented before the solution which is a good approach. All the patterns are shown in code and as UML.

The Practice section is probably where this book stands out from standard programming books as this is a really important part of software development which is often over looked as it is language agnostic. As such these important processes are not usually covered in language specific publications and I salute the author for writing this section. I was a little disappointed the see that the Version Control software referred to is CVS as arguably Subversion has replaced it as the dominate open-source Version Control software of choice. Whilst you won't learn everything about setting up a complete development environment it will set you well on your way.

What I like about this book is that it is not just a bunch of code samples, it focuses more on how to use tried and tested design patterns (a natural partner to OOP code), combined with good practices such as using version control and unit testing to help you produce good, maintainable applications.

As I mentioned above there are a few things that let this book down. I'd like to see Subversion instead of CVS as the version control software (and GIT deserves a mention). Also, the section on patterns, would really benefit from having a list of all the design patterns, under "patterns" in the index, then it would be much more useful to use this book for a reference (especially when you can't remember the pattern's name!).

If you are serious about developing enterprise level applications in PHP then you really should read this book. If you develop in another web language such as ColdFusion, then this book is still worth reading mainly as there really aren't many other books out there that cover OOP, design patterns and practices in one book.

PHP Objects, Patterns, and Practice is published by Apress.

 


No comments

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.

Please subscribe me to any further comments
 

Search

Wish List

Found something helpful & want to say ’thanks‘? Then visit my Amazon Wish List :)

Categories

Recent Posts