What is Factory Pattern?
Factory Pattern is a creational design pattern. It is responsible for creating instances of objects without using directly the object constructor. For this reason Factory Pattern is widely used in frameworks, to encapsulate the logic of creating the objects and to make the framework independent of the objects it needs to work with.
There are several types of factories, depending of the implementation:
- Static factories
- Factories where the new objects are registered
- Factories implemented using Reflection (depending on programming language)
- Factory Method – The Factory Method Design Pattern originally published in the book known as Gang Of Four (Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1994). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley )
FactoryPattern.com is just another blog about the same old fashioned object oriented design and this where the name came of.