Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
69 views2 pages

What Is Singleton Design Pattern

The Singleton design pattern ensures that only one instance of a class is created and provides a global access point to that instance. It creates a class that can only be instantiated once by making the default constructor private and managing object creation through a public static property or method that returns the instance. Thread safety is also considered by using locking to prevent multiple threads from creating multiple instances.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views2 pages

What Is Singleton Design Pattern

The Singleton design pattern ensures that only one instance of a class is created and provides a global access point to that instance. It creates a class that can only be instantiated once by making the default constructor private and managing object creation through a public static property or method that returns the instance. Thread safety is also considered by using locking to prevent multiple threads from creating multiple instances.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

What is Singleton design pattern ?

Singleton design pattern creates a class


where single instance of class can be
created throughout the application. Where
ever object of that class is required same
instance is used.

Singleton Design
Pattern
Note:
1. Singleton class should be
sealed class so that it
should not be derived
further.
2. Singleton class constructor
should be private to avoid
class instance creation.
3. Multiple threading is
handle through locking.
4. Singleton design pattern
uses static property or
method to create single
instance

You might also like