The Builder design pattern is used in fast-food restaurants. The same procedure is always used to prepare a burger and the packaging (box and paper bag), even if there are many different kinds of burgers (classic, cheeseburger, and more) and different packages (small-sized box, medium-sized box, and so forth). The difference between a classic burger and a cheeseburger is in the representation, and not in the construction procedure. The director is the cashier who gives instructions about what needs to be prepared to the crew, and the builder is the person from the crew that takes care of the specific order. The following figure provided by www.sourcemaking.com shows a Unified Modeling Language (UML) sequence diagram of the communication that takes place between the customer (client), the cashier (director), and the crew (builder) when a kid's menu is ordered [j.mp/builderpat].
Mastering Python Design Patterns
By :
Mastering Python Design Patterns
By:
Overview of this book
Table of Contents (23 chapters)
Mastering Python Design Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The Builder Pattern
The Prototype Pattern
The Adapter Pattern
The Decorator Pattern
The Facade Pattern
The Flyweight Pattern
The Model-View-Controller Pattern
The Proxy Pattern
The Chain of Responsibility Pattern
The Command Pattern
The Interpreter Pattern
The Observer Pattern
The State Pattern
The Strategy Pattern
The Template Pattern
Index
Customer Reviews