[Catalyst] sample code for feedback

Rob Kinyon rob.kinyon at gmail.com
Thu Jun 23 23:05:20 CEST 2005


The things I would emphasize for Catalyst are the following:
1) It does all the mod_rewrite/C::A::P::Dispatch crap for you with the
attributes. Given that, it's very easy to see immediately what's going
to be the initial handler for what. This is important in Ajax
applications.

2) Each function is very small, often under 20 lines. Given that
understandability is directly related to how many screens something
covers, have a given method cover less than half a screen is
important.

3) Something I've started to do is to set $dbh =
'Poli::M::DB::Petition'. That way, I have less characters cluttering
me up.

4) I'd rewrite the sign() method to be:
if ( $results->has_missing() or $results->has_invalid() ) {
    # Handle error condition
}

# Handle happyday

That's more intuitive to me, but that's personal preference.

5) I'd also emphasize how important $c->forward() is to this
framework. CGI::App has it, but it's not central. In here, it's
central to the whole way the thing works.

6) Along those lines, I'd emphasize the fact that MyApp::V::TT is the
place where the setup for the template handling goes. This means that
your MyApp setup is for app-specific things, MyApp::C is for
controller-specific things, etc. This means that you don't have to
wade through irrelevant stuff to understand the specific configuration
item(s) you're looking for.

Rob



More information about the Catalyst mailing list