Builder design pattern

Separate the construction of a complex object from its representation so that the same construction process can create different representations. - GOF Design Patterns

The Builder design pattern is used to construct a complex object step by step, and finally it will return the complete object. The logic and process of object creation should be generic so that you can use it to create different concrete implementations of the same object type. This pattern simplifies the construction of complex objects and it hides the details of the object's construction from the client caller code. When you are using this pattern, remember you have to build it one step at a time, which means you have to break the object construction login into multiple phases, unlike other patterns, such as the abstract factory and the factory method pattern, which the object in a single step.

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

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