From the course: Design Patterns: Creational

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Flexibility in configuration

Flexibility in configuration

From the course: Design Patterns: Creational

Start my 1-month free trial

Flexibility in configuration

The director uses a builder to build a product step by step. And so the builder interface must be flexible and general enough to support a variety of concrete builders and the products they make. Remember that the intent of the builder pattern is to separate the construction of a complex object from its representation, so that the same construction process can be used to create different representations of a product. By creating a general interface, we are building in flexibility to the builders we use. builder lets us vary a product's internal representation. As we saw with the car example, we can create two door sedans or four door sedans, or two door SUVs or four door SUVs in someone the builder hides the internal structure of the cars. So the director does not have to worry about the complex details of assembly. If we want to change how that assembly happens. We change the concrete builder, without affecting the director…

Contents