|
|
|
|
|
by fendy3002
1739 days ago
|
|
Not OP, but it's useful for if: - something is done to object when some props is set or validation, such as .withStuffedCrust("cheese"), it'll set the internal props as crust="stuffed" and stuffContent="cheese" - it's branching. So rather than making user looking for the components or configuration themselves, library author can guide them with builder. Such as: myVehicleBuilder.withSixTires().withTrailerAttachment().attach(container)
In this case withTrailerAttachment (and possibly withOpenBack or withBox) won't show up if you call withTwoTires(), and attach won't show up if you don't call withTrailerAttachment(). |
|