Helpless Automation
Application Development
-
Creating a Singleton (Instance) Class in C#
In application development there are various situations in which it makes sense to code a class in a manner that it can be created (instantiated) once and used throughout the lifetime of the application. Generally this type of class is called a Singleton object.
When creating and object, CPU cycles are used up during the:
- Creation of the Object
- Initialization of the Object
- Loading of the Object, including seed data from the dB etc.