At the start of May I received (along with a couple of
other people it seems) a couple of books from Julie Miller at Apress publishing with the sole condition being that I post a short review. Liking to think[1] that I would do this anyway it seemed like an offer I couldn’t refuse. So here goes . . .
When the title talks about patterns, frameworks, testing and more it’s not kidding. Kevin McArthur has managed to stuff a lot of information into the three hundred and some pages which make up this book. The inevitable trade-off is that no one section is a complete introduction to the subject it’s covering. Despite this the book is filled with what I can only describe as, “Ah-hah!” and “Doh!” moments. Explanations that suddenly clear away confusions or present better ways of doing something which in hindsight seem so obvious but clearly weren’t beforehand. If this seems sickeningly positive so far it’s because judging the book as a whole there really isn’t anything I can find to criticise. One criticism that
has been raised is that for a book titled “Pro” it doesn’t cover enough “enterprise”-y[2] subjects. Greater emphasis could have been given to some concepts but many of the ideas I associate with “enterprise”-y projects are here. Lacking any general aspects to criticise I’ll “go to town” on the individual sections . . .
The book is broken up into five parts and I’ll comment briefly on each. The five sections listed in the
table of contents are
- OOP and Patterns
- Testing and Documentation
- The Standard PHP Library (SPL)
- The Model-View-Controller (MVC) Pattern
- Web 2.0
OOP and Patterns
As with all the sections this should be viewed as an introduction and not a complete reference. If you’re really looking to brush up your familiarity with OOP and patterns all the major publishers have books, which are more relevant, to help you out. That being said this is a solid introduction. Personally I found the programming by contract section, a subject I was aware of but not familiar with, particularly useful.
Testing and Documentation
For me this was the weakest section of the book. The section is broken down into three chapters; documentation and coding standards, reflection API and then testing, deployment and continuous integration. The documentation section was good to the point where I suspect I’ll refer to it as frequently as I do the PHPDoc manual. I was slightly surprised to see no mention of
PHP_CodeSniffer though. The chapter on the reflection API highlighted a lot of functionality I had not come across before but I felt the examples were excessive. Moving on to the testing, deployment and continuous integration chapter I had the feeling that all those examples in the previous chapter were at the expense of this chapter. Sparse is probably the best description I can give. The basics of the different tools (
subversion,
PHPUnit,
phing,
Xinc and
Xdebug) are here but too much just isn’t covered.
The Standard PHP Library (SPL)
Thankfully the book returns to form when talking about SPL. The Introductory chapter is actually
freely available online so take a look if you want to get a feel for the writing. There was a slight hint of the repetition which I find so often plagues technical books when going through this section. The emphasis has to be on slight though and it quickly passes. It was a useful reminder of just how concise the rest of this book is.
The Model-View-Controller (MVC) Pattern
This section quickly produces a basic implementation of an MVC framework and then moves on to some examples of using the
Zend Framework. When I first came to this section I was slightly disappointed to find it was based on version 1.0.3 (ZF is currently at version 1.5.2). This doesn’t turn out to be too limiting though and Zend_Form was the only functionality I would have liked to see covered which wasn’t.
Web 2.0
Even now I can’t decide how I feel about this section. It’s a mix of three subjects which I feel only partially relate to the core subject. Having said this most PHP developers with a few years experience will have come across AJAX and web services so perhaps they aren’t so out of place. The third subject is certificate authentication. Again this chapter is
freely available online. Although I feel these pages would have been best turned to other subjects I can’t deny that in all three subjects I learnt something new.
Final Impressions
Overall this is a really solid book. There are some things I would change but I can easily see myself revisiting at least 75% of the content on a regular basis. If you're unfamiliar with any of the sections covered I would have no concerns with recommending this book.
[1]I received “The Object-Oriented Thought Process” last Christmas and still haven’t reviewed it. Look out for that in the next fortnight or so.
[2]I really don’t want to get into what enterprise means so I’m not going to.
In addition to Pro PHP I also received the book, “Practical Web 2.0 Applications with PHP” from Apress. This is a very different book to Pro PHP. Whereas Pro PHP introduced a variety of fairly advanced topics and then left it up to us to decide when
Tracked: Aug 10, 20:15