8.09.2011

About Patterns - Builder

The Builder pattern allows a developer to construct objects using a consistent construction process but yield different representations. This pattern is useful when the parts that make up an object should be different from the algorithm used to make the object and the construction process needs to produce different representations.

A few items to consider with the Builder pattern:

  • The internal representation of the object built by the Builder is hidden
  • The pattern encapsulates the construction and representation of the object built
  • The pattern gives you more flexibility in the construction process

More information including a sample implementation is available here.