My Favorite Design Patterns

Pattern Definition Type
Singleton

Ensure a class only has one instance, and provide a global point of access to it.

 
Command

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

 
Template Method

Define the skeleton of an algorithm in an operation, deferring some
steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure.

 
Factory Method

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.

 
Builder

Separate the construction of a complex object from its representation so that the same construction processes can create different representations.

 
Decorator

Attach additional responsibilities to an object dynamically. Decorators
provide a flexible alternative to sub classing for extending functionality.

 

Leave a Reply

Your email address will not be published. Required fields are marked *