Static Class Structure
Director
Builder interface
to create parts of a complex object.
builder)
to a Builder
object.
Builder
Builder1,…
Builder interface
by creating and assembling the parts
of a complex object.
Dynamic Object Collaboration
Director object
delegates creating and assembling
the parts of a complex object
to a Builder1 object.
Director is configured with a
Builder1 object.
Director
that calls buildPartA() on
the installed Builder1 object.
Builder1 creates a
ProductA1 object and
adds it to the ComplexObject.
Director calls
buildPartB() on
Builder1.
Builder1 creates a
ProductB1 object and
adds it to the ComplexObject.
Director can then get
the assembled ComplexObject from
the Builder1
and use it as required.