Gang of Four (GoF), in their book “Design Patterns: Elements of Reusable Object-Oriented Software”, catalogued a collection of 23 patterns under 3 categories. They are,
- Creational Design Pattern
- Structural Design Pattern
- Behavioral design patterns
Creational Design Patterns:
Creational Patterns hide the complexity of creating new object(s) from client code which is going to use these object(s).
Creational Patterns may be used when a decision needs to be taken at the time of object creation. These patterns automatically restrict the no of objects to be created from a class (Example: Singleton).
When initiating objects using ‘new’ keyword without proper design, may lead to tight coupling of objects. To resolve these issues, appropriate creational design patterns might be chosen.
The following 6 patterns fall under the category of creational design patterns:
- Factory Method Pattern
- Abstract Factory Pattern
- Singleton Pattern
- Prototype Pattern
- Builder Pattern
- Object Pool Pattern