From the course: Design Patterns: Creational

Unlock the full course today

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

The Builder pattern

The Builder pattern

From the course: Design Patterns: Creational

Start my 1-month free trial

The Builder pattern

- [Narrator] The builder pattern is another creational design pattern, meaning it relates to creating objects, but this pattern is different from the factory patterns we just talked about. As we saw in the previous videos about the various factory patterns, factories are concerned with encapsulating the decision about what type of products, that is concrete objects, to create. The builder pattern is concerned with encapsulating the complexities of how we build an individual object. Let's take a look at the definition of the builder pattern. It says that the builder pattern separates the construction of a complex object from its representation, so that the same construction process can create different representations. That means we want to allow the client the flexibility to create different representations of the same kind of object. Imagine you've got a system for building cars. You want to be able to build a two-door…

Contents