Provide an interface for creating families of related or dependent objects without specifying concrete classes.
Kit
Use the Abstract Factory pattern when
- a system should be independet of how its products are created, composed, and represented
- a system sould be cofingured with one of multiple families of products
- a family of related product objects is designed to be used togheter, and you need to enforce this constranint
- you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations
- AbstractFactory: declares an interface for operations that create abstract products objects
- ConcreteFactory implements the operations to create concrete product objects
- AbstractProduct: declares an interface for a type of product object
- ConcreteProduct: defines a product object to be created by the corresponding factory. Implements the AbstractProduct interface
- Client: uses only interfaces delcared by AbstractFactory and AbstractProduct classes
The knowledge reported in this guide is the result of the study and reworking of the Gang of Four book "Design Patterns: Elements of Reusable Object-Oriented Software".
