One of the techniques that I’ve found to be of some value is the usage of class instances as enums. An example of this is…
public class MonitorType
public static readonly class BenQMonitor = new MonitorType("BenQ");
public static readonly class SamsungMonitor = new MonitorType("Samsung");
One thing I haven’t had to deal with yet was serializing one of these.
If you think about it though this would cause a problem though since de-serialization would cause a new instance to be created, when really you want your singleton instance. But thankfully this little problem has been solved via this little article. Good thing to keep in the back of your brain if you follow this enum approach (or any other approach where you would serialize a singleton.).