Software Design Reference

Design Patterns Cheat Sheet

Converted into the same previous HTML reference format, with navigation, responsive pattern cards, concise descriptions, key participants, and the original PDF pages preserved below.

Source-based conversion: This page preserves the terminology and pattern descriptions from the supplied two-page Design Patterns Cheat Sheet. Page 1 contains Creational and Structural Patterns; page 2 contains Behavioral Patterns. fileciteturn1file0L2-L18 fileciteturn1file0L118-L128

Creational Patterns

Abstract Factory

Provides an interface for creating families of related or dependent objects without specifying their concrete classes.

Key participants:ClientAbstractFactoryConcreteFactoryAbstractProductProductAProductB

Builder

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

Key participants:DirectorBuilderConcreteBuilderProduct

Factory Method

Defines an interface for creating an object but lets subclasses decide which class to instantiate.

Key participants:ProductConcreteProductCreatorConcreteCreator

Prototype

Specifies the kinds of objects to create using a prototypical instance and creates new objects by copying this prototype.

Key participants:ClientPrototypeConcretePrototype1ConcretePrototype2

Singleton

Ensures a class only has one instance and provides a global point of access to it.

Key participants:Singleton-instance-Singleton()+GetInstance()

Structural Patterns

Adapter

Converts the interface of a class into another interface clients expect.

Key participants:ClientTargetAdapterAdaptee

Bridge

Decouples an abstraction from its implementation so that the two can vary independently.

Key participants:ClientAbstractionImplementorConcreteImplementorAConcreteImplementorB

Composite

Composes objects into tree structures to represent part-whole hierarchies.

Key participants:ClientComponentLeafComposite

Decorator

Attaches additional responsibilities to an object dynamically.

Key participants:ComponentConcreteComponentDecoratorConcreteDecorator

Facade

Provides a unified interface to a set of interfaces in a subsystem.

Key participants:FacadeSubsystem

Flyweight

Uses sharing to support large numbers of fine-grained objects efficiently.

Key participants:FlyweightFactoryFlyweightUnsharedFlyweightClient

Proxy

Provides a surrogate or placeholder for another object to control access to it.

Key participants:ClientSubjectProxyRealSubject

Behavioral Patterns

Chain of Responsibility

Avoids coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.

Key participants:ClientHandlerConcreteHandler1ConcreteHandler2

Command

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

Key participants:ClientInvokerCommandConcreteCommandReceiver

Interpreter

Given a language, defines a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

Key participants:ClientContextAbstractExpressionTerminalExpressionNonterminalExpression

Iterator

Given a language, defines a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

Key participants:ClientAggregateConcreteAggregateIteratorConcreteIterator

Mediator

Defines an object that encapsulates how a set of objects interact.

Key participants:MediatorColleagueConcreteColleague1ConcreteColleague2ConcreteMediator

Memento

Without violating encapsulation, captures and externalizes an object's internal state so that the object can be restored to this state later.

Key participants:CaretakerOriginatorMemento

Observer

Defines a one-to-many dependency between objects so that when one object changes state all its dependents are notified and updated automatically.

Key participants:SubjectObserverConcreteSubjectConcreteObserver

State

Allows an object to alter its behavior when its internal state changes.

Key participants:ContextStateConcreteStateAConcreteStateB

Strategy

Defines a family of algorithms, encapsulates each one, and makes them interchangeable.

Key participants:ContextStrategyStrategyAStrategyB

Template Method

Defines the skeleton of an algorithm in an operation, deferring some steps to subclasses.

Key participants:AbstractClassConcreteClassTemplateMethod

Visitor

Represents an operation to be performed on the elements of an object structure.

Key participants:ClientVisitorConcreteVisitorElementConcreteElementAConcreteElementB

Original PDF Pages

The original visual pages are included here so the UML-style diagrams and relationships from the source remain available alongside the converted HTML content.

Original PDF Page 1 Original Design Patterns Cheat Sheet page 1
Original PDF Page 2 Original Design Patterns Cheat Sheet page 2