Purpose of the builder pattern
To extract the object construction code out of its own class and move it to separate objects called builders
A director class
-defines the order in which to execute the building steps, while the builder provides the implementation for those steps.
The IBuilder interface
declares product construction steps that are common to
all concrete builders.
The concrete builders
provide different implementations of the construction steps.
Products
are objects being created by the builder.
The client
It must associate one of the builder objects with the director.
Advantages of the Builder Pattern
Disadvantages of the Builder Pattern
The overall complexity of the code increases since the pattern requires extra classes on top
of the Product.
When to use the Builder Pattern
-To get rid of multiple overloaded constructors.
Rather use different builders for different combinations of parameters.
-when you want your code to be able to create different
representations of some product
The _________assures that there is one and only one instance of a class and provides a global
point of access to it.
Singleton
The ________ pattern is used to create a duplicate object or clone of the current object.
Prototype
The _________ defines an interface or abstract class for the factory class and
allow subclasses thereof (concrete creators) to decide which product class to instantiate.
Factory Method pattern
The ________ pattern allows the production of concrete products that belong together
in a family.
Abstract Factory