The used examples and notions almost come from OOD Design.
Factory
Intent
creates objects without exposing the instantiation logic to the caller
refers to the newly created object through a common interface
When to use
a framework delegate the creation of objects derived from a common superclass to the factory - we need flexibility in adding new types of objects that must be created by class
code examples and specific problems
Parameterized Factories
The most significant problem to this implementation is that it violates open close principle. If we need more new product classes, we need to change the code in ProductFactory.
Class Registration – using reflection
The main drawback of reflection implementation is performance. It could cause a up to 10% performance loss comparing to the non reflection implementations.