posted 15 years ago
Are you talking about maintaining an application configuration? If that is so, I would do it this way..
Have a class that provides methods to read application configuration properties, like config.getproperty(propertyName). All the classes that need to read some property will call this method.
The class constructor is private and read the properties file here. Class will have a private variable that holds its own instance.
Other objects of the application obtain an instance of this class by calling a static method Configuration.getInstance(). This method returns the local variable that we talked about above.
write a method to reload configuration that makes the local instance variable null and re creates it . Call this method when ever a change is made to your properties file.
Hope it helps.