
Builder : Design Patterns in TypeScript
Design Patterns In TypeScript (book)
https://www.amazon.com/dp/B0948BCH24 : ASIN B0948BCH24
https://www.amazon.com/dp/B094716FD6 : ASIN B094716FD6
Documentation : https://sbcode.net/typescript/builder/
The Builder Pattern is a creational pattern whose intent is to separate the construction of a complex object from its representation so that you can use the same construction process to create different representations.
The Builder Pattern tries to solve,
How can a class create different representations of a complex object?
How can a class that includes creating a complex object be simplified?
The Builder and Factory patterns are very similar in the fact they both instantiate new objects at runtime. The difference is when the process of creating the object is more complex, so rather than the Factory returning a new instance of ObjectA, it calls the builders director constructor method ObjectA.construct() that goes through a more complex construction process involving several steps. Both return an Object/Product.
#builderPattern
#typescriptBuilder
#builderPatternTypescript