Braindump

Design Patterns Overview

Overview of Design Patterns

This is a short overview of design patterns. It's based on my experience from working through the book Head First Design Patterns published by O'Reilly (a recommended reading?, by the way).

Summaries

PatternSummaryExample in the book
Abstract FactoryAllows a client to create a family of objects without relying on an implementation.Ingredients factories
AdapterProvides a different interface for another object. 
CommandA command object represents an order to be executed.Remote control and its buttons
CompositeAllows clients to use collections of objects in the same way as single objects.The different menus in a restaurant
DecoratorExtends the behaviour of an existing object with new behaviour.Calculating the price of coffee specialities
FacadeProvides a simplified interface for another object or set of corresponding objects.Home cinema equipment
Factory MethodCreating a concrete implementation is delegated to subclasses. 
IteratorUse a collection of objects without knowing the implementation of the collection. 
ObserverThe observed subject notifies registered clients about changes. 
ProxyControl access to another object. 
SingletonEnsure that only one instance of a class exists. 
StateChange state based behaviour through delegation. 
StrategyChange behaviour through delegation.Ducks' flying and quacking
Template MethodSteps of an algorithm are implemented by subclasses.Brewing coffee and tea