Factory Method

It provides an interface for creating specialized objects of a superclass, and allowing that each subclass decides which instance to create.

circle-info

The superclass will only have the creation abstract method. The implementation of the creation method will be inside each subclass.

circle-info

Factory Method pattern suggests that you replace direct object construction calls (using the new operator) with calls to a special factory method (like create()).

Last updated