Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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,
Quality Perl Programming and Unix Support UK managed @ offshore prices -
Personal website -

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-11-29 18:49 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (752 votes), past polls