Professional Documents
Culture Documents
One thing to consider in choosing a design pattern is what will vary in a design. Instead of looking at the cause of
redesign, this approach looks at what you want to be able to change without redesign. As you will see, the focus
switches to encapsulating the concept that varies. Table below shows the nine design patterns this book explains divided
into purpose, scope, and aspects of the pattern that can vary.
Design pattern purpose, scope, and variation
Purpose
Creative
Structural
Scope
Class
Object
Class
Object
Behavioral Class
Object
Object
Object
Object
Name
Factory
Prototype
Adapter*
Adapter*
Decorator
Template Method
State
Strategy
Chain of Responsibility
Observer
Steps in algorithm
States of objects
An algorithm
Object that can fulfill request
Number of objects that depend on other objects; how many
dependent objects can stay up to date
*The Adapter pattern has two configurations: one class and one object.