Interested in helping build Docs? Read the Contribution Guide or share your feedback.
Creational Design Patterns
Creational design patterns concern themselves with the instantiation of objects. At the time of creation, additional logic may be needed to decide what or how object types need to be created.
Five main creational design patterns are outlined below:
- Singleton: Ensures a class has only one object instantiated during the programs lifecycle.
- Builder: Decouples the responsibility of object creation from the desired object’s class. It is normally implemented when a class requires many properties to be set during its construction.
- Prototype: Adds cloning functionality to an objects class.
- Factory: Creates objects without specifying the specific class.
- Abstract Factory: Groups object factories based on a common theme.