Creational Patterns: Rules of Thumb
Creational Patterns: Rules of Thumb
Abstract Factory
Creates an instance of several families of classes
Builder
Separates object construction from its representation
Factory Method
Creates an instance of several derived classes
Object Pool
Avoid expensive acquisition and release of resources by recycling
objects that are no longer in use
Prototype
A fully initialized instance to be copied or cloned
Singleton
A class of which only a single instance can exist
Rules of thumb
Problem
Discussion
Structure
The Abstract Factory defines a Factory Method per product. Each Factory
Method encapsulates the new operator and the concrete, platform-specific,
product classes. Each "platform" is then modeled with a Factory derived
class.
Example
Rules of thumb