Forums Register Login

Best practices for accessing application configuration

+Pie Number of slices to send: Send
What are the current best practices for loading and accessing configuration values on application level. My understanding is that Singletons should not be used. I have read something about thread local, but I was wondering what else is in use and has proven to work well. Spring comes to mind as well, but as the application I am working on is rather small I would prefer not to add too many libraries.

What I mean with application level configuration is stuff like database drivers, colors, input/output paths for files, etc. So basically configuration values that you would like to access from all over the application and that you do not want to pass around from class to class.

Cheers,
M
+Pie Number of slices to send: Send
I believe, using Singleton sensibly is normally recommended. Singletons allow you to refer/access to resources that need to be shared across an application.
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 896 times.
Similar Threads
properties file
Finally SCEA with 91 %
Agile Testing: New to Agile Methodologies
Can I access the Application Context from a Struts 2 Action?
Is it a good practice to save files in local system via signed applet
GUI�s, OO, events and decoupling
Cleared Java Genius in Annapolis Junction, MD
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 10:23:16.