Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://234102]
help
Chatterbox?
[marinersk]: Poking around I find references to the XP Nodelet but something's not clicking. It shows up when I have votes; it shows up when my XP changes; but I can't see how to make it show up all the time. Am I missing something obvious here?

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2017-05-29 13:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?