-
Singleton
- restrict instantiation to a single instance
- Exactly one instance within an application memory space
- Global state
-
Memory Blocking
- Reduced performance in Multi-threaded apps
-
Can be used to
- Prevent polution of global / application namespace with variable declarations
- Configuration settings etc.
- Global logging provider?
- Factory Pattern
-
Builder
-
Product Class
-
Vehicle
- NumberOfWheels
- NumberOfDoors
- PassengerCapacity
- LoadCarryingCapacity
-
Abstract Product Builder Class
- Encapsulate Product Class
- Define steps to construct product
-
Concrete Builder Classes
- Create a Specific product
- Implement steps to consruct product
-
Director
- Controls Building
- Constructor takes Product Builder as Parameter
- Single Method to construct product
- Controls order of construction
- Observer