Builder

E173606

Builder is a creational design pattern in object-oriented programming that separates the construction of a complex object from its representation, allowing the same construction process to create different representations.

All labels observed (2)

Label Occurrences
Builder canonical 1
ConcreteBuilder 1

How this entity was disambiguated

Statements (51)

Predicate Object
instanceOf Creational design pattern
Design pattern in object-oriented programming
addresses Telescoping constructor anti-pattern
aka Builder pattern
allows Different ConcreteBuilders to produce different product representations
Optional parameters without many constructors
Reusing construction process for multiple products
applicableWhen Construction algorithm should be independent of object parts and representation
Object construction is complex and involves multiple steps
Object must be created with different representations
consequence Improved control over construction process
More maintainable object creation code
Possible increase in number of classes
definesRoleOf Builder constructs and assembles parts of the product
ConcreteBuilder implements construction steps and provides product representation
Director controls the construction process
Product is the complex object being built
describedIn Gang of Four design patterns book
differsFrom Abstract Factory by focusing on step-by-step construction rather than families of products
enables Same construction process to create different representations
hasCategory Software design pattern
hasExampleLanguage C#
C++
Java
JavaScript
Python
hasIntent Separate construction of a complex object from its representation
oftenUsedWith Complex configuration objects
Fluent API style method chaining
Immutable value objects
participantsInclude Builder interface
Builder self-linksurface differs
surface form: ConcreteBuilder

Director
Product
promotes Fluent interfaces
Readability of object creation code
Separation of concerns
Single responsibility principle
reduces Complexity of constructors
Coupling between object construction and representation
Number of constructor parameters
relatedTo Abstract Factory
surface form: Abstract Factory pattern

Factory Method
surface form: Factory Method pattern
solves Complex object creation problem
supports Immutable object creation
Incremental object construction
Step-by-step object construction
typicalMethod build()
getResult()
reset()
usedIn Object-oriented programming

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

Builder participantsInclude Builder self-linksurface differs
this entity surface form: ConcreteBuilder