Book-review "Magento PHP Developers Guide"
Magento programming - a vast space that a lot has been written about, but many claim not enough. With his book Magento PHP Developer's Guide, Allan MacGregor tries to combine the most important subjects of Magento development into one book. I would say he has done that job very nicely.
Not for the weak for heart
An important note to those who are new to Magento development: It is not for the weak of heart. To build your own Magento module, you will need a solid understanding of PHP OOP - but even then, Magento programming requires a study: The application relies heavily on a structure of class-hierarchies that will take time to get used to. Also, Magento defines most of its data in abstract XML-code first, meaning that you have to get familiar with that abstraction layer as well.
That said, Allan covers all this in a thorough and consistent manner. All topics are covered: MVC, theming (bits of XML-layout), the API (SOAP and REST), and unit testing. Sometimes, the book is covering huge chunks of code, which might be quite tough to get through for newbies. But hey, if you want to learn Magento coding, you better go in deep.
What we found interesting ourselves was that Allan discusses the usage of VirtualBox and Vagrant as a means to quickly setup new development environments. Indeed, if hosting space is limited, this offers for easy deployment. And while VirtualBox can be run on your local desktop (as Allan discusses), things can even become cooler when you setup a remote VirtualBox server so that multiple people can work in the same space. Just our 50 cents.
Sometimes we would have wished that Allans explanation goes a bit deeper: The chapter about events and observers explains how the Magento core generates events, so that observers might be written to hook into those events. In our opinion, this is one of the most valuable ways of extending Magento in a clean way. So we would expect numerous examples here, but unfortunately none were given. But because the basics are covered, a developer should be able to pick up from here anyway.
The good stuff
However, other parts are covered to make up for this: One of our favorite parts in the book was about REST: Mainly because REST was only introduced in Magento 1.7 so not much has been written about it. Another good part is the part on collections - fundamental knowledge for any Magento developer, and explained very well by Allan.
All these topics being covered deeply make this book definitely worth buying. Kudos to Allan MacGregor.