Chapter 11
The Builder Pattern
The builder pattern is used to separate the configuration of an object from its creation. The calling component has the configuration data and passes it to an intermediary—the builder—that is responsible for creating an object on behalf of the component. This separation can reduce the amount of knowledge that the calling component has about the objects it uses and concentrates default configuration values in the builder class, rather than being required in every component that creates objects. Table 11-1 puts the builder pattern in context.
Table 11-1. Putting the Builder Pattern into Context
Question | Answer |
---|---|
What is it? | The builder pattern puts the logic and default configuration values required to create an object ... |
Get Pro Design Patterns in Swift now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.