Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best practices for accessing application configuration

 
max oschen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, using Singleton sensibly is normally recommended. Singletons allow you to refer/access to resources that need to be shared across an application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic