Moose

If you’re a perl programmer, than you’ve most likely already heard of  Moose.  If not, there’s a plethora (okay, maybe just a myriad) of blog entries about the popular “postmodern object system” just waiting to be Googled.  Although I first heard of Moose in late 2007 and attended a session on it in early 2008 at the frozen perl conference, I must admit, I haven’t had the chance to write any applications utilizing this technology …. until now.

I’ve started to lay some of the groundwork I think I’ll need to create a replacement custom data import and reporting system for my place of employment.

Some of my most basic wants / needs will be :

  • I’ll want a Config class, which reads in a config file, perhaps a ‘MooseX::Singleton’ or stored via a ‘Registry Pattern’
  • I’ll want a Log4perl class, or better yet, a ‘Moose::Role’ Logger is probably the way to go.  By using a ‘Role’, we can use the ‘with’ keyword and give the classes that need a logger one very easily without writing any additional code.
  • I’ll need some IO classes / modules for data extraction and generic file IO stuff
  • I’ll need some RegExp modules for data validation
  • I’ll have to do quite a bit of database interaction… I might look at using an ORM, perhaps ‘DBIx::Class’, and I’ll want to keep it database independent given that we’re currently using MySQL as our RDBMS but if we want to switch in the future, writing the interface and code in a OO style should make a change as painless as possible

There’s much more that I’ll need when I get a chance to sit down and evaluate all of my requirements and I’ve decided that using Moose for any new perl projects is a no brainer (unless I’m writing a vanilla CGI app or don’t need OO).

My goal here is to report on / update you with my experience working with this technology and hopefully just add to an already rapidly growing community of perl developers using Moose.

  1. No comments yet.

  1. No trackbacks yet.