views:

45

answers:

1

The idea is that the ApplicationSettings class will get some default values from a configuration / resource file and later on some but not all from those settings will be applied to UserSettings

+1  A: 

You should have only instance fields in such a class, and make the whole class a Singleton if needed (although be careful not to expose it globally - singletons are evil).

Static fields cannot be serialized (which is important for a settings class). Second thing, by having instance fields, you can easily pass different instances of settings to different parts of your app. And the important point is to pass the settings to the rest of the application, not to make them globally visible so that every object can access them.

Groo