Introduction
These pages are based on several books:
Gamma et al, Design Patterns: Elements of
Reuse in Object Oriented Software;
Buschmann et al, A System of Patterns;
Pree,
Design Patterns for Object-OrientedSoftware Development; and
Coplien and Schmidt, Pattern Languages for
Program Design.
This is meant to be used as a quick tutorial on design patterns.
Much more information on design patterns can be found in the Patterns
Home Page,
http://st-www.cs.uiuc.edu/users/patterns/patterns.html and the
Portland Pattern Repository,
http://www.c2.com:80/ppr/.
What is a design pattern?
- A design pattern is to design is what a class library is to coding
- Documentation of expert software engineers' "behaviour"
- Documentation of specific reoccuring problems (and solutions)
- Abstraction of common design occurances
- Large range of granularity -- from very general design principles to
language-specific idioms
Properties of design patterns (Buschmann 1996)
- A pattern addresses a recurring design problem that arises in specific
design situations, and presents a solition to it.
- Patterns document exsiting, well-proven design experience.
- Patterns identify and specify abstractions that are above the level of
single classes and instances, or of components.
- Patterns provide a common vocabulary and understanding for design
principles.
- Patterns are a means of documenting software architechtures.
- Patterns support the construction of software with define properties.
- Patterns help you bukld comples anc heterogeneous software architectures.
- Patterns help you to manage software complexity.
What's in a design pattern?
- pattern name
- problem statement: where do I apply it?
- solution: elements that make up the design
- concequences
Description elements
Design Patterns (Gamma et al 1995) uses the following headings in its
pattern catalogue:
- Pattern name and classification
- Intent
- Also known as
- Motivation
- Applicability
- Structure
- Participants
- Collaborations
- Consequences
- Implementation
- Sample code
- Known uses
- Related patterns
Not all authors use all these headings. Context is often added by other authors
(Buschmann 1996).
Patterns provide:
- A common design vocabulary
- A documentation and learning aid
- An adjunct to existing design methods
- A target for refactoring