With reference to the .NET Settings mechanism, and inspired by a couple of the answers to this question, it seems that some people advocate wrapping the use of Settings via another wrapper class, perhaps a singleton.
Isn't the Settings class a singleton already?
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
// rest of class...
}
.
.
.
So, what is the benefit of wrapping Settings in another class and doing this:
int foo = MySettingsWrapper.MyInt;
instead of doing this directly where needed:
int foo = Settings.Default.MyInt;