Creates an instance of several derived classes

Used to create an instance of the class, with its subclasses depending on which class to initiate at runtime depending upon the type of class.

Can be implemented by two types, based on the type of base class and method implementation:

  1. Creator class being abstract and not providing an implementation of the factory method.
  2. Creator class being concrete and provides implementation of factory method

Reference Example