Files
DesignPatternsPHP/Creational/Builder/README.md
2014-07-31 14:13:53 -05:00

19 lines
539 B
Markdown

# Builder
## Purpose
Builder is an interface that build parts of a complex object.
Sometimes, if the builder has a better knowledge of what it builds, this interface could be an abstract class with default methods (aka adapter).
If you have a complex inheritance tree for objects, it is logical to have a complex inheritance tree for builders too.
Note: Builders have often a fluent interface, see the mock builder of PHPUnit for example.
## Examples
* PHPUnit: Mock Builder
## UML Diagram
![Alt Builder UML Diagram](uml/uml.png)