[cgiapp] Some general questions on CGI::App and OO web application design philosophy

Brad Van Sickle bvs7085 at gmail.com
Sat Jun 6 21:47:31 EDT 2009


This isn't a technical question, so I hope I'm not misusing this list...

I just "discovered" CGI::App a few weeks ago, and I'm still pretty new 
to writing web applications using a reusable, extendable OO framework.   
I can clearly see it's a better way of doing things than chaining .cgi 
scripts together, but I can't help but wonder if I'm not using 
CGI::Application to it's full potential.

Currently, I'm working on creating a content management system for a 
static website.  The CMS has quite a few sections (manage users, manage 
events, manage articles, etc... ) but each section does basically the 
same things (displays the current records, allows you to delete or edit 
current records, allows you to create a new record) Right now I have it 
set up so each section is it's own application.  I have an instance 
script and a package for each section.  Within that package I change out 
the SQL statements and related code, load different templates for the 
create/edit forms, etc...  It works well, but I'm not sure that this is 
the "right" way of doing things.

It seems to me that there is probably a way to do this by using a 
different instance script for each section, but having them all leverage 
the same package by initializing it with section specific data on the 
forms and SQL statements, and than adding in subclasses or instance 
script code for any additional methods that may be required... but I'm 
still kind of new with OO PERL and I can't quite wrap my head around the 
details.  Coding that class to handle dynamically passed SQL statements 
and process dynamic forms seems very very difficult to me.

I guess I'm just looking for advice on how more experienced programmers 
and the users/creators of CGI app are organizing their projects on a 
philosophical level.   Is there a way I'm missing to reuse this code, or 
is "best practice" to create different packages for each 
function/section of the app like I'm currently doing. 


More information about the cgiapp mailing list