The builder configures and assembles objects, and can ensure domain constraints are always satisfied and only valid complex object configurations are returned.

We can combine this with the Factory Method (Design Pattern) or Abstract Factory (Design Pattern) in order to allow varying the specific type of complex object.

Benefits:

  • Encapsulates object configuration + constraints are encapsulated and located in a single place
  • Groups construction logic for multiple inter-dependent classes

Disadvantages:

  • More indirect code
  • Needs to be combined with factory pattern to enable easy switching of concrete implementations.