Intent: To create exactly one object of a class, and to provide global point of access to it. Motivation: While developing applications, we will face frequent situations where there is a need to create exactly one instance of a class. For example, in a GUI application there is a requirement that there should be only one active instance of the application’s user interface. No other instance of the user interface of the application should be created by the user. Another example is the requirement to maintain only one print spooler. We need to allow the class to have exactly
The post What is singleton pattern in design patterns appeared first on Coding Security.
What is singleton pattern in design patterns
read more
Tidak ada komentar:
Posting Komentar