Design Patterns
Explain how to use the design patterns. (Creational Patterns) Refer1 Refer2 Refer3 Refer4 1. Creational Design Patterns. Creational design patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code. 1.1 Simple Factory Factory is an object for creating other objects Use cases: when the class does not know beforehand the exact types and dependencies of the objects it needs to create. When a method returns one of several possible classes that share a common super class and wants to encapsulate the logic of which object to create. when designing frameworks or libraries to give the best flexibility and isolation from concrete class types Examples: You want to manufacture the products many times. ...