Creational patterns are design patterns that deal with how an object is created. There are two basic ideas behind creational patterns. The first is the encapsulation of the knowledge of which concrete types should be created, and the second involves hiding how instances of these types are created.
There are five well-known patterns that are a part of the creational pattern category. They are as follows:
- Abstract factory pattern: This provides an interface for creating related objects without specifying the concrete type
- Builder pattern: This separates the construction of a complex object from its representation so that the same process can be used to create similar types
- Factory method pattern: This creates objects without exposing the underlying logic of how the object (or the type of object) is created
- Prototype pattern: This creates an object by cloning...