Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
PerfectJPattern's version of the Factory Method Pattern only provides a supertype
base interface. The common base Factory interface defines a common create()
method.
Possible parameters required by subtypes to create the specific instances may be added using
Java Beans Setters. Providing parameters
required for the creational code via Java Beans setters rather than via constructors makes
instances of IFactoryMethod
reusable.
import org.perfectjpattern.core.api.creational.factorymethod.*; |