GoF Design Patterns Template
The GoF design patterns are in the middle of these levels of abstraction
A design pattern names, abstracts, and identifies key aspects of a common design structure that makes it useful for creating a reusable object-oriented design.
The GoF design patterns are
descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context.
GoF Classification Of Design Patterns
Purpose- what a pattern does
- Behavioral Patterns – Deal with the interaction of classes and objects
- Creational Patterns – Concern the process of object creation
- Structural Patterns – Deal with the composition of classes and objects
Scope- what the pattern applies to
Class Patterns
- Focus on the relationships between classes and their subclasses
- Involve inheritance reuse
Object Patterns
- Focus on the relationships between objects
- Involve composition reuse
GoF Essential Elements Of Design Patterns
Pattern Name
- Having a concise, meaningful name for a pattern improves communication among developers
Problem
- What is the problem and context where we would use this pattern?
- What are the conditions that must be met before this pattern should be used?
Solution
- A description of the elements that make up the design pattern
- Emphasizes their relationships, responsibilities and collaborations
- Not a concrete design or implementation; rather an abstract description
Consequences
- The pros and cons of using the pattern
- Includes impacts on reusability, portability, extensibility
GoF Pattern Template
| Pattern Name and Classification | A good , concise name for the pattern and the pattern’s type |
| Intent | Short statement about what the pattern does |
| Also Known As | Other names for the pattern |
| Motivation | A scenario that illustrates where the pattern would be useful |
| Applicability | Situations where the pattern can be used |
| Structure | A graphical representation of the pattern |
| Participants | The classes and objects participating in the pattern |
| Collaborations | How to do the participants interact to carry out their responsibilities? |
| Consequences | What are the pros and cons of using the pattern? |
| Implementation | Hints and techniques for implementing the pattern |
| Sample Code | Code fragments for a sample implementation |
| Known Uses | Examples of the pattern in real systems |
| Related Patterns | Other patterns that are closely related to the pattern |
References: Prof. Bob Tarr's Notes
