Factory Method is a widely used, creational design pattern that can be used in many situations where multiple concrete implementations of an interface exist.
The pattern removes complex logical code that is hard to maintain, and replaces it with a design that is reusable and extensible. The pattern avoids modifying existing code to support new requirements.
This is important because changing existing code can introduce changes in behavior or subtle bugs.
In this video course, you learned:
- What the Factory Method design pattern is and what its components are
- How to refactor existing code to leverage Factory Method
- Situations in which Factory Method should be used
- How Object Factories provide more flexibility to implement Factory Method
- How to implement a general purpose Object Factory and its challenges
- How to specialize a general solution to provide a better context