I’m building a class to hold some global variables.
I’m just curios what would make the diference in using a static or a non-static class for this purpose.
Example
public class Modules
{
public static int Modul1{ get { return 1; } }
}
or
public static class Modules
{
public static int Modul1{ get { return 1; } }
}
Declaring like a static you add at least 2 architectual restrictions :
1) None can derive from that class and extend it in any way.
2) Internal members can be only static ones.
So if you want to use this class like a config base, use it like a static class definitely.