You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Michael MATTOX <mi...@verideon.com> on 2004/04/06 18:16:36 UTC

[Configuration] Caching properties

>From what I've seen of the documentation and javadocs, using Configuration
requires creating  new object which will then read in the properties file.
If I have 20 classes, all using the same property file, I'd like to avoid
having 20 Configuration objects that parse the config file 20 times.  Is
there anything wrong with creating a singleton which has a
getConfiguration() method to return a global Configuration class?  I know I
could go one step further and have the Singleton implement the Configuration
interface but that seems to be a lot of unnecessary work.

An alternative would be like in log4J where they have a static getLogger()
method in the Logger class.  But in looking at the source, log4J actually
creates a new logger each time instead of caching it.

Any suggestions?

Michael


--
This E-mail is confidential.  It may also be legally privileged.  If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free.  The sender does not accept liability for any errors or omissions.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org