Spencer Christensen wrote:
> 
> My run_modes were large and bulky, and communicating between them got very
> frustrating.  I realized that this was a design problem with my code because I
> was duplicating code in a lot of places.  So I started to break my code up into
> essentially two categories: subroutines that return HTML, and those that
> get/store data.  I noticed that I didn't need every subroutine to be a run_mode.
>  Some could be just functions that I call from a run_mode (or many run_modes).
> My run_modes became much smaller, and my code became much more object oriented.
> Instead of linking run_modes together, each run_mode stands alone but makes
> several calls to supporting functions.  I still have a lot of work to do on my
> project, but it has gotten better with this approach.

I went through the same process-- I tried to make my "Data" modules a
sub-class of CGI::App
at first and it Just Didn't Work. I like the new division because now I
could write another
front end to my data modules that might run from the command line or
something else besides CGI. 
(so a cron script could manipulate the data, for example). 

  -mark 

 . . . . . . . . . . . . . . . . . . . . . . . . . .
   Mark Stosberg              Principal Developer  
   [EMAIL PROTECTED]       Summersault, LLC     
   v: 765-939-9301 ext 223    website development  
 . . . . . http://www.summersault.com/ . . . . . . .

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to