previous | start | next

The FACTORY METHOD Pattern

Solution

  1. Define a creator type that expresses the commonality of all creators.
  2. Define a product type that expresses the commonality of all products.
  3. Define a method, called the factory method, in the creator type.
    The factory method yields a product object.
  4. Each concrete creator class implements the factory method so that it returns an object of a concrete product class.

previous | start | next