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 ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-28 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found