Possibly-Useful Design Patterns

Template Method

Intent: encapsulate the outline/sequence of an algorithm and allow the specific steps to be specialized by subclasses.


Intent: ensure that only one instance of an class exists in the system.


Intent: encapsulate operations as objects. Allows saving operation history (to support undo, for example). All commands, no matter what they do, can be invoked in the same way.

Abstract Factory and Factory Method

Both are used instead of constructors -- if you know the methods to call, you can use them to create objects without:

Factory Method lets you create objects without knowing exactly what class you are creating:

Abstract Factory lets you create related/dependent objects -- an abstract factory has a Factory Method for each kind of Product it creates.

Adapter (Wrapper)

Intent: change the interface through which a class can be used, allowing otherwise incompatible classes to be used together.


Intent: add and/or override behavior for an object.


Intent: create a structure in which objects can be grouped inside other objects and groups can be used anywhere primitive objects are used.

Chain of Responsibility

Intent: delegate requests to a chain of objects. The objects in the chain decide which object handles the request, so the requestor does not have to hard-code which object to call.