Creational design patterns abstract the instantiation process. They help make a system independent of how its objecsts are created, composed and represented. A class creational pattern uses inheritance to vary the class that’s instantiated, whereas an object creational pattern will delegate instantiation to another object.
Creational patterns become important as systems evolve to depend more on object composition than the class inheritance. As that happens, emphasis shifts away from hard coding a fixed set of behaviours towards defining a smaller set of fundamental behaviours that can be composed into any number of complex one. Thus creating objects with particular behaviours requires more than simply instantiating a class.
There are two recurring themes in these patterns. First, they all encapsulate knowledge about which concrete classes the systerm uses. Second, they hide how instances of these classes are created and put together. All the system at large knows about the objects is their interface as defined by abstract classes. Consequently, the creational patterns give you lot of flexibility in what gets created, who creates it, how gets created, and when. They let us configure a system with “Product” objects that vary widely in structure and functionality. Configuration can be static (that is, specified at compile-time) or dynamic (at run-time).
List of Creational patterns are:
- Abstract Factory
- Factory Method