|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Singleton
from Grand patterns, the singleton pattern ensures that only one instance of a class is created. All objects that use an instance of that class use the same private instance that is got by ImplementingSingletonClass.getInstance(). It's not possible to put the getInstance() method in the interface, because the return type is the class implementing the interface. So, the fields and method of the instance are put in the source code of this interface as comments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |