Origin: | GoF 95 | |||||||||||||||
Reason: | Allow a client to construct a complex object, the product, by specifying only its type and content. | |||||||||||||||
Synopsis: | An interface or abstract class, the AbstractBuilder, defines a static method, getInstance that takes the product type and return a Concrete Builder. A Director calls methods of the Concrete Builder to build the product. | |||||||||||||||
Example: | An e-mail gateway transforms messages received in MIME format to specific formats for different e-mail systems. A message is composed of many parts/fields. | |||||||||||||||
Solution: |
|
|||||||||||||||
See also: |
AbstractFactory FactoryMethod Prototype creational pattern summary |