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

[cgiapp] RE: Splitting large projects.


Create a base class, called Project::Application. Then, every single one
of the modules is a child of Project::Application. Those are the guys
that actually have your run-modes.

Doing this has a number of other benefits:
1) Centralized way of printing stuff
2) Centralized way of handling security
3) Centralized way of setting up things like database handles

I actually have two separate applications. They both have their own base
classes (Foo::Application and Bar::Application), but those inherit from
Company::Application, which inherits from CGI::Application. This way, I
can have app-specific code inherited by all the runmodes in that app,
but all my applications can share useful code among themselves.

Now, these baseclasses may initially be stubs. But, you want that stub
there, because you'll find stuff to put in it. Trust me.

Rob

-----Original Message-----
From: John Day [mailto:suppressed 
Sent: Thursday, April 08, 2004 11:51 AM
To: suppressed
Subject: Splitting large projects.

I have looked at the "Template and Directory Structure" page on the
wiki, but I am still a little confused.

Currently I have a largeish app where all the run modes are in a single
module, there are around 15,000 lines and 130 run modes. It is a
monster, but it works and I am happy to leave the current version like
that.

I am starting a new project today which is going to be bigger, and I
would like to break things up. But if I put the run modes into modules
of their own how do they get access to the params and to the CGI query
for example?

I am reasonably new to OO-perl so I figure their is something I am
missing here! Any advice appreciated.

John Day


---------------------------------------------------------------------
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.