in reply to Why CGI::Application?
sub some_state { my $self = shift; # do some stuff here to populate %template_params return $self->print( $display_mode, $template_name, %template_params, ); }
Also, you might be confusing something I was having issues with, at first. I originally thought I needed to implement my entire application as one monolithic C::A app. But, a friend of mine showed me what his company did. They have some 20 different C::A's that all work together, passing responsability off as necessary. They have one main C::A, which handles logging and the homepage. Then, every major subsystem (reports, user admin, preferences, etc) have their own C::A. If something is complicated, create another C::A inside that. His rule of thumb was 10-12 states, at most. More than that and you should look at breaking it up into two C::A's (if possible). Also, every one of your C::A's inherits from some abstract superclass that inherits from C::A, which implements things like how to connect to the DB, what CGI class to use, how to display, and other basic functionality.
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Why CGI::Application?
by Arunbear (Prior) on Jan 13, 2004 at 14:06 UTC | |
by dragonchild (Archbishop) on Jan 13, 2004 at 18:12 UTC | |
by t'mo (Pilgrim) on Jan 14, 2004 at 19:58 UTC | |
by dragonchild (Archbishop) on Jan 14, 2004 at 20:56 UTC | |
by wfsp (Abbot) on Apr 27, 2007 at 10:23 UTC | |
by dragonchild (Archbishop) on May 01, 2007 at 18:22 UTC |