> -----Original Message-----
> From: Jerry Hamlet [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 14, 2002 11:28 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [cgiapp] Application Configuration Discussion
>
>
> On 3/14/02 6:11 AM, "Cory Trese" <[EMAIL PROTECTED]> wrote:
>
> > List --
> >
> > Thank you in advance for any time spent reading or
> replying, I appreciate
> > it.  I'm developing a large application using
> CGI::Application (or at least
> > thinking about it very seriously.)  The application we
> are going to create
> > will need to serve many users, and groups of users will
> need to have
> > different sets of configuration options.
> >
> > GOALS:
> > 1. These options should be easy to use within the framework of
> > CGI::Application
> > 2. These options should be stored in a central location
> >
> > Thoughts:
> >
> > I've considered a number of options, but never having
> done any serious
> > CGI::Application programming, I am in no position to make
> any type of
> > judgment.
> >
> >
>
> I would suggest creating a "Configuration" module/class
> that'll handle the
> reading and writing of a file or database. Your main application can
> instantiate an object of this class (or one of it's
> subclasses), and then
> you can use a reference to it throughout your
> CGI::Application app. Ala:
>
>     my $config = MyModules::Configuration->new();
>
>     open USERFILE, $config->param('userinfo');
>
>     <blah, blah, blah .... >
>
>
> Using a configuration module/class allows you to subclass
> it for all your
> various needs, and it's use isn't tied to CGI::Application,
> you could use it
> in other applications/scripts

You could also use this as an extra layer of abstraction--within the
Configuration module, you could store the data in a DB, or using the
Storable module, or in a text file, and the rest of your app doesn't
need to know about these details.

Andy Huhn
Get weather bulletins delivered to your email, pager, or fax for as
little as $2.00/month!
http://www.stormnow.com


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to