Builder


Usage

  • Separate object construction from its representation
  • Separate the construction of a complex object from its representation so that the same construction process can create different representations

Diagram

Builder

Participants

Builder
  • Specifies an abstract interface for creating parts of a Product object
ConcreteBuilder
  • Constructs and assembles parts of the product by implementing the Builder interface
  • Defines and keeps track of the representation it creates
  • Provides an interface for retrieving the product
Director
  • Constructs an object using the Builder interface
Product
  • Represents the complex object under construction. ConcreteBuilder builds the product's internal representation and defines the process by which it's assembled
  • Includes classes that define the constituent parts, including interfaces for assembling the parts into the final result

Resources URL: 
notes/design_patterns/resources
Sources URL: 
notes/design_patterns/sources

See Also