Skip to content

Files

Latest commit

author
Dominik Liebler
Sep 24, 2013
1a3f16a · Sep 24, 2013

History

History
This branch is 1058 commits behind DesignPatternsPHP/DesignPatternsPHP:main.

Builder

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 24, 2013
Sep 21, 2013
Sep 24, 2013
Sep 21, 2013
Sep 21, 2013
Sep 24, 2013

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