Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Builder pattern
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Structure== === UML class and sequence diagram === [[File:w3sDesign Builder Design Pattern UML.jpg|frame|none|A sample UML class and sequence diagram for the builder design pattern.<ref>{{cite web|title=The Builder design pattern - Structure and Collaboration|url=http://w3sdesign.com/?gr=c02&ugr=struct|website=w3sDesign.com|access-date=2017-08-12}}</ref>]] In the above [[Unified Modeling Language|UML]] [[class diagram]], the <code>Director</code> class doesn't create and assemble the <code>ProductA1</code> and <code>ProductB1</code> objects directly. Instead, the <code>Director</code> refers to the <code>Builder</code> interface for building (creating and assembling) the parts of a complex object, which makes the <code>Director</code> independent of which concrete classes are instantiated (which representation is created). The <code>Builder1</code> class implements the <code>Builder</code> interface by creating and assembling the <code>ProductA1</code> and <code>ProductB1</code> objects. <br/> The [[Unified Modeling Language|UML]] [[sequence diagram]] shows the run-time interactions: The <code>Director</code> object calls <code>buildPartA()</code> on the <code>Builder1</code> object, which creates and assembles the <code>ProductA1</code> object. Thereafter, the <code>Director</code> calls <code>buildPartB()</code> on <code>Builder1</code>, which creates and assembles the <code>ProductB1</code> object. === Class diagram === [[Image:Builder UML class diagram.svg|500px|center|Builder Structure]] ; Builder : Abstract interface for creating objects (product). ; ConcreteBuilder : Provides implementation for Builder. It is an [[factory (software concept)|object able to construct other objects]]. Constructs and assembles parts to build the objects.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)