Wednesday 15 April 2009

Catalyst Perl looking good

I have used Catalyst Perl to develop a number of sites such as recruitment extranets and shopping carts over the past 3 years. But how is it looking?

I would say:

Catalyst and the database Object Relational Mapper (ORM) DBIx::Class have really come of age.

Firstly, the ORM rocks. I was laughing to myself the other day at a conversation some Java programmers were having about using Hibernate and generating database accessor stubs. OMG, lots of extra lines of code you need to maintain and that can get out of date. And with an ActiveRecord style approach you don't get cool features that DBIx::Class has. To see why "Chained Result Sets are what make DBIC Great" check out jshirley's slideshow "Demystifying DBIx::Class"

Then this week a colleague was asking about generating JSON from a Web REST-dispatching framework. He'd lashed together something with CGI::Application and Template::Toolkit. He could have just used the Catalyst plugin Catalyst::Controller::REST and his job would have been done in a few lines of code. You put in a few action handlers that correspond to your REST verbs, e.g. programme to handle a URI like /programme/id/123/keywords,  and then the framework dispatches them and generates JSON (or XML or YAML...) for you automatically. The number of lines of code correspond to how maintainable an application is, right? That's a no-brainer of a win for you right there.

Catalyst has evolved to become a scalable, reliable product and is now being used to run the BBC's iPlayer 2 site. Marina Kalkanis comments on how the BBC uses Catalyst to serve 1000 hits per second.

To finish off with here are a couple of new Catalyst Perl sites