Singleton

GPTKB entity

Statements (45)
Predicate Object
gptkbp:instanceOf Design pattern
gptkbp:alternativeTo Dependency injection
Service locator
gptkbp:category Creational pattern
gptkbp:criticizedFor Difficult unit testing
Global state
Hidden dependencies
gptkbp:describedBy gptkb:Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software
gptkbp:example Logger
Configuration manager
Database connection pool
gptkbp:guarantees A class has only one instance
https://www.w3.org/2000/01/rdf-schema#label Singleton
gptkbp:implementedIn Double-checked locking
Eager initialization
Lazy initialization
Static block initialization
gptkbp:pattern Creational
gptkbp:popularizedBy gptkb:Gang_of_Four
gptkbp:problemAddressed Controlling object creation
Limiting number of instances
gptkbp:provides A global point of access to the instance
gptkbp:threadSafe Can be an issue in multithreaded environments
gptkbp:usedIn gptkb:Java
gptkb:Objective-C
gptkb:Python
gptkb:Swift
gptkb:C#
gptkb:C++
PHP
Software engineering
gptkbp:bfsParent gptkb:Bayleaf_Farmhouse
gptkb:Winkhurst_Tudor_Kitchen
gptkb:Diocese_of_Maitland-Newcastle
gptkb:Arundel_and_South_Downs
gptkb:Chichester_District
gptkb:Winston_County,_Mississippi
gptkb:Richard_Singleton
gptkb:Wollemi_National_Park
gptkb:Hunter_Valley
gptkb:Dungog_Shire
gptkb:NSW_TrainLink_coach_services
gptkb:Upper_Hunter
gptkb:Hunter_River
gptkbp:bfsLayer 6