about
12/05/2022
ObjectFactories Repo
ObjectFactories Repository
Ways of building abstract creational facilities for Dependency Inversion
Quick Status
1.0 Concept
2.0 Design
-
Widget Factory
A classic form of DIP and most frequently used. -
Abstract Factory
Supports adding additional interfaces to provide language needed by new functionality, without breaking clients using the original capability. In this design, a class that needs to be modified inherits from the originial interface, and adds inheritance from a new interface. Clients only using the original capability have pointers only to that interface. Clients that need the new functionality obtain a pointer to the new interface using dynamic_cast. -
Program To Interface
This example builds a factory using a map with keys that identify classes used to create instances, and values that are creational functions for for instances of each class.