Singleton is one of the most frequently used Design Patterns in Software Engineering. You should apply Singleton pattern if you want to ensure that your class will have only one instance with a global point of access to it.
Let's look at Singleton code:
public sealed class Singleton { private static readonly Singleton instance = new Singleton(); private Singleton(){} public static Singleton GetInstance { get { return instance; } } }
As you can see the code is pretty simple. Class is defined as sealed in order to prevent derivation. Also Singleton variable is marked readonly, which means that it can be assigned only during static initialization or in a constructor.
This approach has only one downside - it's not thread safe. This code must be improved if you work in multithreaded environment.