Creational design patterns are concerned with the object creation mechanism, i.e., the instantiation process. The main idea is to hide the object creation process from the user and provide a flexible way to create objects.
Creational design patterns become more important as the system evolves since they give the software more flexibility to change. In addition, they are helpful when a system must be independent of how its objects are created.
The creational design patterns are categorized into two types. They are as follows:
- Object-Creational Patterns: Object-creational patterns deal with object creation (object creation to another object)
- Class-Creational Patterns: Class-creation patterns are class instantiation (object creation to subclasses)
Creational patterns are distinguished from one another by their different ways of controlling the object creation process. Some of the most commonly used creational design patterns include the
- The Abstract Factory Pattern
- The Factory Pattern
- The Builder Pattern
- The Dependency Injection Pattern
- The Lazy Initialization Pattern
- The Object Pool Pattern
- The Singleton Pattern
These patterns provide various solutions for creating objects in a manner that increase flexibility and reuse of existing code.