Thursday, May 24, 2012

Static vs. Abstract Factory

The key idea of static factory method is to gain control over object creation and delegate it from constructor to static method. The decision of object to be created is like in Abstract Factory made ouside the method (in common case, but not allways). While the key (!) idea of Factory Method is to delegate decision of what instance of class to create inside Factory Method. E.g. classic Singleton implementation is a special case of static factory method.  
Grygoriy Gonchar -http://stackoverflow.com/questions/929021/what-are-static-factory-methods-in-java

No comments:

Post a Comment