Singleton Pattern In C#

Singleton Pattern

Singleton Pattern

It is used to for if we want to send single object to other classes in our class. So what can we do this type situations? Answer is so simple. Singleton class. So us class is not derived for other classes, it must send one instance to others, and other classes reach the element on it. Instance is readonly, static. So we when created it that can one time assigned and we reach to it anywhere in class.And also we used Lazy<T>. It provides waiting time until instance created. So memory will doesn't busy with this instance until it called. Simple and effective method to memory management.

Comments

Popular posts from this blog

CIFAR-10 Dataset Classification Using Convolutional Neural Networks (CNNs) With PyTorch

Radial Basis Function Networks with PyTorch

Long-short-term-memory (LSTM) Word Prediction With PyTorch