I have a static class which I use to get access to my public properties (global for whole app) and methods which I use during application run. For example I set some property in static class and during app run time I can get value from property.
But I can create non static class with singleton pattern and use it in the same way.
Question: Which approach is correct in my case?
The sample below shows that you can use interfaces with a singleton class (which is impossible with static class.)
I prefer this pattern above a large list of static methods/properties or several static classes.
Those interfaces can provide subject specific settings which can even be used as parameters to other methods or classes without that those classes need to know where the settings come from, as long as the contract is respected.
And this can be used in a simple manner as as:
or