- Creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.
- The basic form of object creation could result in design problems or in added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.
- Creational design patterns are composed of two dominant ideas.
- Encapsulating knowledge about which concrete classes the system uses.
- Hiding how instances of these concrete classes are created and combined.
- Creational design patterns are further categorized as
- Object-creational patterns
- Object-creational patterns deal with Object creation.
- Object creation to another object
- Class-creational patterns
- Class-creational patterns deal with Class-instantiation.
- Object creation to subclasses.
- Five well-known design patterns that are parts of creational patterns are the
- Builder pattern
- Separate the construction of a complex object from its representation so that the same construction process can create different representations
- Factory method pattern
- Centralize creation of an object of a specific type choosing one of several implementations
- Abstract factory pattern
- A class requests the objects it requires from a factory object instead of creating the objects directly
- Singleton pattern
- Restrict instantiation of a class to one object
- Prototype pattern
- Used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects
- Dependency Injection pattern
- A accepts the objects it requires from an injector instead of creating the objects directly
Tuesday, 9 October 2018
Creational pattern
About Unknown
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment