Factory Method Pattern

The Factory Method pattern is extremely useful when a class cannot decide in advance the class of objects it must create. The task of specifying the objects is given to the subclasses, instead. The class delegates responsibility to one of several helper subclasses, and the user localizes the knowledge of the delegate. Factory Method Pattern