Origin: | GoF 95 | |||||||||||||||
Reason: | Provide an interface for creating families of related or dependent objects without specifying their concrete classes (aka Kit). | |||||||||||||||
Synopsis: | An interface, the abstract factory, defines abstract methods that return product components. A creator uses a different concrete factory per family of products. Different objects are created by different virtual methods of the concrete factory. | |||||||||||||||
Example: | A graphical toolkit needs to support multiple look-and-feels. Applications cannot hardcode widgets for a particular look-and-feel or they would be too difficult to change for another look-and-feel. | |||||||||||||||
Solution: |
|
|||||||||||||||
See also: |
Builder FactoryMethod Prototype creational pattern summary |