What is a pattern?
"Each pattern describes a problem which occurs over and over
again in our environment, and then describes the core of the solution to
that problem, in such a way that you can use this solution a million
times over, without ever doing it the same way twice"
History: Architecture background - Christopher Alexander discovered and
cataloged patterns in architecture.
Purpose:
Goals
- Search for elements in software design that are reusable.
- Search for ways to document and generalize software design expertise.
- Provide a common vocabulary for software designers to
communicate effectively.
- Facilitate learning and dissemination of software design expertise.
- Help novice designer become expert fast.
Patterns:
- Not primitive building blocks
- Not complex, domain specific designs
Used in:
- Application programs: specific domain and purpose;
- Toolkits: collections of general purpose classes;
- Frameworks: collections of classes with particular
architectures and styles, usually domain-specific but
highly customizable.
The GoF book documents 23 of these patterns.
To define a pattern, need the following:
- Name
- Purpose and problem solved
- How the above problem is solved
- The constraints and forces we have to consider to
accomplish the pattern
In practice, we will use the following template
- Name
- Intent
- Problem
- Solution
- Participants and Collaborators
- Consequences (cause and effect)
- Implementation
- GoF Reference (page number)


