Abstract classes, Interfaces, and Patterns
- slide 34 : 41
Factory design patterns
There exists design patterns that insulate clients from the actual instantiation of a class C
Static factory methods
Overview:
Factory methods implemented with class methods (static methods) in C, or in another class
The design pattern
Factory Method
which handles instantiation in instance methods of client subclasses
Relies on instance methods in class hierarchies with virtual methods
The design pattern
Abstract Factory
which is good for instantiation of product families
Relies on instance methods in class hierarchies with virtual methods