Design Patterns - Singleton Pattern
Key words: Global access point of the instance, Code Smell
UMLPermalink
Singleton PatternPermalink
Pseudo CodePermalink
class Singleton {
static private Singleton instance;
private Singleton() {}
public static Singleton getInstance() {
if(instance == null) {
instance = new Singleton();
}
return instance;
}
}