Creational patterns

Creational patterns focus on how objects are instantiated in a system. These patterns aim to reduce complexity in creating objects and allowing the instantiation of objects in a controlled way, thus providing flexibility in the way that objects are created and represented in the system.

These patterns enforce constraints for object creation, such as the number of instances that can be created in an application. This encourages the idea of coding to interfaces in which objects can be instantiated without knowledge of the specific implementation classes. It also reduces the tight coupling of objects within the system. The instantiation of objects will not be coupled directly into the code, but will be done in a way that can reduce complexity when we have to change from one implementation to another.

Patterns such as Factory, Builder, Singleton, and Prototype come under the category of creational patterns.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset