Book Review:
Catalyst, Accelerating Perl Web Application Development by Jonathan Rockway, Packt Publishing 2007.
In a time when less experienced users are experimenting with web frameworks for development, Ruby on Rails has gained notable marketshare in the area of easy set-up and minimal configuration. As one of many Perl-based frameworks, Catalyst operates in the same space and for many new users will be measured by this same quick-configuration criteria. So it follows that many users will want a book that will get them up and running quickly.
The Catalyst book succeeds in getting to the point quickly and diving in. Chapter 1 gives you a very quick overview of Model-View-Controller (MVC) architecture. Chapter 2 then starts with a simple Catalyst application, essentially a 'Hello, World' application. Keeping with the goal of easy configuration, the initial set-up involves running a script to create the core application framework. The rest of the chapter then walks through each directory that script created. I liked this high-level description because it's common for MVC frameworks to have many files in many different places and you don't often find a comprehensive overview in most documentation.
Even with tools for fast configuration and convenient interfaces, the reality is that there are still many decisions you need to make when creating even a fairly simple web application. And each decision offers plenty of wrong choices to an inexperienced user. "Catalyst," the book, does a good job of presenting the common best practice for decisions ranging from basic database setup to reusable code design.
These design decisions are presented in a quick matter-of-fact way without going into full discussions of every area. This was the right decision to make for a book helping you to get running fast. If you're looking for more in-depth disussion of different options for session handling, authentication/authorization, database design, or other web technologies, you'll need to look in books dedicated to those topics.
There is no question about the credentials of the author. Jonathan Rockway is a key member of the core Catalyst team and has been giving Catalyst presentations for years. This experience shows as the advice and best practices offered throughout the book are solid.
The first real sample application described is an address book. This is a good choice as it is something anyone can relate to and naturally fits a CRUD framework. It also builds nicely, starting from very simple features, like getting data in and out of your address book, to other typical features like external configuration files, sessions, and authentication and authorization. Many of the features demonstrated here could be easily re-implemented in any web application you might be building.
The book then transitions to a more complex sample application, a tool to track opinions on IRC. It can track people with multiple different nicks across multiple different channels. Once it has some data, the book shows how to build interfaces that can show various data on the positive and negative comments around various topics.
While the example did a good job of demonstrating Catalyst features, I was puzzled by the choice of IRC as the problem space. My impression is that IRC is very much still a tool used rarely outside technical communities. If the book hoped to reach a wider audience, some of whom may be new to programming, this example could be a stumbling block. For someone not familiar with IRC, I think it would be difficult to focus on the Catalyst code because they would be trying to wrap their head around what IRC is and exactly what the sample application was doing.
As with any techincal book, it contains a significant amount of raw code. Of course it needs to show you the code to demonstrate how to do things and describe what's going on. However, I found myself wondering if there were a different way to provide some of the code samples, perhaps as an appendix, at the end of the chapter, or as a download. For completeness, you want all of the code provided in the book, but I think people seldom type everything in from a book, so it seemed some sections could have been pared down.
As with any technical book, examples can become out of date after printing, and there are some cases here. Errata are posted on the
Packt Publishing website and there is also a wiki hosted on
the Catalyst website. I imagine it could be frustrating for a new user working through the early examples (in Chapter 3, for example) without referring to these resources.
Any book has it's share of typos that get past the editors, but I seemed to notice a few more than typical, especially toward the end of the book. I don't know that any of these would cause any serious issues in understanding, but they can be distracting.
Finally, if you are interested in some newer web development technologies like AJAX, REST, and RSS, the author has you covered. There is a chapter devoted to these technologies and additional supporting technologies outside the Catalyst framework to get you going.
As an introduction to Catalyst, and MVC web development, this book succeeds in getting you going and explaining all of the key features you need for web application development. However, some might find the cost a bit steep (list US $39.99, $35.99 on Amazon) for a fairly slim volume. My recommendation is if you know you are going to be doing development with Catalyst, "Catalyst" the book would probably be a useful reference and you'll find many of the examples reusable. If you are just dabbling with Catalyst, you can probably get the introduction you need from the online documentation available on the
Catalyst website and the Catalyst framework documentation.