[Catalyst] Catalyst Selling Points
Charlton Wilbur
cwilbur at tortus.com
Wed Dec 28 00:00:52 CET 2005
> Charlton, I think we may be getting into the point of diminishing
> returns from these discussions of 80% / 20%. I've already agreed
> with you that we shouldn't use that measurement as a slogan,
> because--as you rightly pointed out--PHBs will misunderstand what
> it means and think that it's a promise that the REST of the app
> will be produced as quickly. So, let me instead ask--do you have
> specific ideas about what we might say? You mention CPAN and
> automated testing--what exactly are you thinking of? If you'd like
> to slap some examples up on this mailing list, or onto the wiki,
> maybe we could riff on that a bit.
Unfortunately, they don't make punchy slogans, but here are some
bullet points.
* The MVC paradigm allows you to cleanly separate the logic of the
application (the Model) from how it looks on the screen (the View) or
how the user interacts with the data (the Controller). This is a
time-tested design pattern (dating back to 1970-something?), and
Catalyst works smoothly with it.
* The M of MVC allows you to isolate your business logic and test the
code that implements it independently of anything else. It also
unties you from the web: you can use your Model as a backend for
anything else.
* The V of MVC means the look of the application is separate from the
business logic and from the user's interaction. You can re-skin your
application as you see fit without having to redesign the user's
interaction or the business logic at the same time.
* The C of MVC means you can think of an application as an event-
driven sequence of user interactions, without having to worry about
what page is doing what.
* The separation of code into Model, View, and Controller, combined
with Perl's Test::Harness, allows you to write automated tests.
Automated testing lets you be certain that when you've made a change
to one bit of code, it doesn't break any other bit of code -- or, if
it does, you find it.
* Any of the umpty-thousand modules on CPAN can be plugged into
Catalyst and form part of the Model, View, or Controller. Several
popular modules are already easily pluggable: Data::FormValidator for
validating user input; Class::DBI and DBIx::Class for data
persistence and entity-relationship modelling; HTML::Mason and
Text::Template for displaying things to the user.
* The Catalyst documentation suggests several basic configurations
and several approaches to web application development. These are
likely to be the most useful. But Catalyst is completely
reconfigurable: you can substitute parts that do what you need for
parts that don't do what you need.
* You can use Perl, an extremely expressive language. map, grep,
foreach, hashes, etc.
* The conventions used by Catalyst are straightforward and easy to
grasp by anyone who's used object-oriented Perl and mod_perl before.
Sure, most of these are advantages of MVC or of Perl rather than of
Catalyst per se. But I don't see Catalyst as innovating so much as
recapitulating: its meta-selling point is not really in any one
feature, but in the synthesis of MVC plus Perl plus web.
I mean, I've been doing web stuff for over a decade. Rapid
development doesn't impress me in itself, because the majority of the
time it's just delayed pain (usually with 20% interest, compounded
weekly) rather than avoided pain, and being able to do things twice
as fast means that the client can change his mind twice as often
without threatening the deadline. But show me that Catalyst gets rid
of the scut work up front *and* encourages a structure that makes
things easier to change in the short run and easier to maintain in
the long run, and there's a selling point. Show how you can use some
pain-avoidance techniques like test-driven development and automated
testing, and you've got me wondering about when I'll have time to
play with it. Throw in some more about Catalyst's shallow learning
curve, especially for people with Perl experience, and you've
reassured my manager as well, because there's a bus that passes in
front of my office every half hour and you never know when it might
swerve.
Charlton
--
Charlton Wilbur
cwilbur at tortus.com
More information about the Catalyst
mailing list