D
dave
If I have a class that hold, for instance, user settings that should be
accessible to the entire program logic, what is a good paradigm to use?
In C++, I would have made it a global object, protected if necessary
for thread safety. In C#, of course, there are no global objects.
The Program object is static, so cannot contain object instances.
While I could store it in my main form pass it around, that seems
cumbersome. I could do a singleton, but this seems like a lot of work
just to get around the "better programming style precludes global
objects" imperative.
What is the simple yet "proper" method people tend to use for this in
C# (to which I am new)?
Thanks!
Dave
accessible to the entire program logic, what is a good paradigm to use?
In C++, I would have made it a global object, protected if necessary
for thread safety. In C#, of course, there are no global objects.
The Program object is static, so cannot contain object instances.
While I could store it in my main form pass it around, that seems
cumbersome. I could do a singleton, but this seems like a lot of work
just to get around the "better programming style precludes global
objects" imperative.
What is the simple yet "proper" method people tend to use for this in
C# (to which I am new)?
Thanks!
Dave