File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Best practices for accessing application configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Best practices for accessing application configuration" Watch "Best practices for accessing application configuration" New topic
Author

Best practices for accessing application configuration

max oschen
Greenhorn

Joined: Jul 07, 2011
Posts: 1
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
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

I believe, using Singleton sensibly is normally recommended. Singletons allow you to refer/access to resources that need to be shared across an application.


S.D. MADHAN
Not many get the right opportunity !
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Best practices for accessing application configuration