Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Object Oriented configuration values

by IlyaM (Parson)
on Feb 10, 2003 at 12:55 UTC ( #234102=note: print w/ replies, xml ) Need Help??


in reply to Object Oriented configuration values

To my taste application object and configuration object are quite distinct things so I would not mix them. Personally I'd make application object a facade to configuration object:

my $object = OurApp->new(...); print $object->config->base_directory, "\n";

Here $object->config returns config object. One advantage of this method is that fixes your problem with possible method and config variables name collisions.

It is also worth to mention that you are probably reinventing the wheel. AppConfig provides similar OO inteface to config files (i.e. config vars as methods)

--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org


Comment on Re: Object Oriented configuration values
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://234102]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (16)
As of 2014-10-30 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls