Context:

Creating an object by fixed criterion. Possibly reconfiguring it later.

Challenge:

to create the object without specifying its type.

Skill:

Participants:

Client:

Uses Factory Method to obtain Products.

Factory Method:

The capability to create Products of pre-configured type. An efficient data-driven replacement for a switch/case statement.

Concrete Factory Method:

The capability to create a Concrete Product. There is usually one instance of the Concrete Factory Method, accessed through global Factory Method reference (typically singleton). Where the Concrete Factory Method serves no other function, (and where genericity is supported) it can be parameterized over the type of Concrete Product that it creates.

Product:

The type of Product declared to be created.

Concrete Product:

The Product actually created, as configured via the current Concrete Factory Method.

Signature:

Factory Method (typically Singleton) creates Products for Client. Each Concrete Factory Method is built to produce the respective Concrete Product. In the extreme case, Concrete Factory Method is parameterized over Concrete Product.

Used patterns and idioms:

Singleton.

Used by:

Dynamic Pluggable Factory.

Scope:

Languages that that lack the class object. (Elsewhere, where objects are created by default, a global reference to the respective class object will suffice.)