10 Catalyst models in 10 days, wrap-up
Published · Monday, 27 July 2009 (Updated · 29 August 2011)
You can download and run the entire application with all the code we went through in our ten—twelve really—articles from github, p5-myapp-10in10. The distribution includes some extras and suggested exercises. You are responsible for installing the dependencies. They are clearly labeled for each model and the Makefile.PL included should set you up to install most if not all of them automatically.
There are a few things I hope you got out of this–
- A sense of creativity and possibility for your model classes.
- An interest in modern Perl practices and packages like Moose and using—helping to patch, improve, or extend when necessary for your needs—CPAN solutions instead of rolling your own from scratch for the majority of your code.
- To stop thinking of models as nothing but data stores and think of them as services instead.
- A sense of awe for Catalyst.
One application with 10 disparate models, only one of which was an ORM-style DB model, coexisting easily, happily.
A clean, new application which can readily consume, accelerate, and improve your messy, difficult legacy code. And while this project turned out to be much more work that I was expecting, all the code was written in a couple of hours a night, a few nights a week, in a month.
For managers out there evaluating what frameworks you might like to try, please take serious notice of that. Though Catalyst and some of its pieces have a learning-curve, an experienced developer can create and deploy a fairly deep, scalable, extensible, robust, high-performance application in a month with it. While there are other options like Ruby on Rails, Django, Struts or Spring, CakePHP, or whatever, it should start to be clear that–
- Catalyst by its agnosticism—a hundred different models, a dozen different views, any amount of controllers in several dispatch styles? No problem!—is perhaps the most flexible web framework available.
- Note that this is considered a weakness by some. Superior flexibility comes with a price: you need discipline and strong developers to ensure it’s a strength and not a weakness. The take away being: if something is blocking your code from doing what you want, it is not Catalyst.
- If used in modern style with test-driven development and other agile-ish practices, Perl is as clean and maintainable as any other programming language and it’s still faster to develop in than most of, perhaps all of, the others.
- It has the power of the CPAN, the largest, most active open source codebase in history with solutions for nearly everything, including problems you don’t even know you have yet.
Thanks for reading. I hope you had as much fun doing so as I did writing it.
Some resources and more to explore
- The full application code, p5-myapp-10in10.
- Catalyst’s public face.
- The Catalyst wiki.
- Enlightened Perl.
- PerlMonks, one of the best technical forums there is.