Creational Design Patterns
Abstract Factory
Intent: The Abstract Factory design pattern provides an interface for creating related objects without knowing about their concrete classes.
Also known as: Kit
The Abstract Factory design pattern addresses the same problem as Factory Method (code with hard-coded class name is hard to sub-class/extend/change). It defines a class (the abstract factory) whose purpose is to create objects as needed. These objects (typically returned as pointers) are created using factory methods (virtual constructors). Since these are virtual functions, in case of subclassing, they can be overriden. The client code is passed a factory object as a parameter. Thus the class of the created objects can be controlled through this parameter.