[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Separate database module?


Sean,

I use design by composition by creating objects that I
include into the Perl CGI::Application space.  That
object accesses the database, reads and writes on
behalf of that codespace.

use Product;
 ...
   $product = Product->new($prod_id_field);

   # selection on product choice
   return $product->select_screen;

   ...

So it keeps the CGI::Application clean.

Sincerely,

David Scott

--- Sean Davis <suppressed> wrote:

> I am building a cgi::application that queries pretty
> extensively (at 
> least for me) from a MySQL database.  I am having
> trouble with 
> maintainability, as the SQL code is mixed into the
> perl code and, 
> unfortunately, we are changing the database schema
> fairly often right 
> now.  I was wondering what hints folks have about
> managing the SQL 
> parts away from the logic of the code.  For my
> limited programming 
> skills, writing subroutines within my CGI::App is
> easiest but probably 
> not the most flexible.
> 
> Thanks,
> Sean
> 
> 
>
---------------------------------------------------------------------
> Web Archive: 
>
http://www.mail-archive.com/suppressed/
>              
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail:
> suppressed
> For additional commands, e-mail:
> suppressed
> 
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.