Heigh-ho, it’s off to print we go
I got word from the production manager of my latest book, PHP Object-Oriented Solutions, that everything has gone to schedule, and the book shipped to the printers just before the weekend. It usually takes about three weeks after sending all the chapters and images to the printers before a book appears on the shelves in bookstores. I’m told that 18 August is now the official publication date. The eBook version should be ready about a week earlier (a link will appear on the book’s page on the friends of ED site as soon as it’s available).
I’m quite pleased with the way the book has turned out. Well, I would be, wouldn’t I?
It’s aimed at readers who already have a good understanding of PHP, but it doesn’t assume any prior knowledge of object-oriented programming (OOP). Although the book is devoted entirely to OOP in PHP, it makes the point right from the start that OOP isn’t a replacement for everything that you have already learned, but an extra, very powerful tool to add to your skillset. The book concentrates on a small number of custom-built classes that can be reused in a variety of projects. It also uses some of the built-in classes, such as DateTime, DateTimezone, SimpleXMLElement, and XMLWriter.
One chapter that turned into a voyage of discovery for me deals with the Standard PHP Library (SPL). Even though SPL has been part of PHP for more than four years, the documentation is difficult to follow. Once I peeled away the mysteries of the various iterators, I realized just how powerful they are. An iterator lets you use a foreach loop on an object, which is pretty useful in itself; but what makes iterators really useful is the way you can combine them. For example, I used a DirectoryIterator in combination with a RegexIterator and a LimitIterator to display a long list of images in a folder just ten at a time. Without SPL, it would have taken a lot of code. With SPL, just half a dozen lines.
PHP Object-Oriented Solutions is exclusively focused on PHP 5 (and ready for PHP 6 when it eventually emerges). The code will not work with PHP 4.
21 comments July 29th, 2008