What Is A Pattern?: Aleksandra Tesanovic
What Is A Pattern?: Aleksandra Tesanovic
Aleksandra Tesanovic
Real-Time Systems Laboratory
Department of Computer and Information Science
Linköpings universitet
Sweden
• Definition
• Properties
• Types of patterns
Patterns do...
• provide common vocabulary
• provide “shorthand” for effectively communicating complex
principles
• help document software architecture
• capture essential parts of a design in compact form
• show more than one solution
• describe software abstractions
Patterns do not...
• provide an exact solution
• solve all design problems
• only apply for object-oriented design
• generative
– generate systems or pats of systems
– perspective and active
Name
meaningful name
Problem
the statement of the problem
Context
a situation giving rise to a problem
Forces
a description of relevant forces and constraints
Solution
proven solution to the problem
Examples
sample applications of the pattern
Resulting context (force resolution)
the state of the system after pattern has been applied
Rationale
explanation of steps or rules in the pattern
Related patterns
static and dynamic relationship
Known use
occurrence of the pattern and its application within existing
system
Consequences
trade-offs, concerns
Implementation
hints, techniques
Sample code
code fragment showing possible implementation
Known uses
patterns found in real systems
Related patterns
closely related patterns
[Coplien]
• …is a structured collection of patterns that build on each
other to transform needs and constraints into an
architecture [Software Design Patterns: Common Questions and Answers]
[Buschmann, POSA]
• pattern catalog
…a collection of related patterns, where patterns are
subdivided into small number of broad categories…
• pattern system
…a cohesive set of related patterns, which work together to
support the construction and evolution of hole
architectures...
MacApp MacApp
What is a pattern? September, 2001
Steps in reorganization
PRELIMINARY STEPS
1 documentation
2 finding staring points
– identification of classes / subsystems design patterns
with design goals similar to ones of parts of the system
design patterns
– experiences and future scenarios
– metrics / design rules critical application parts
– analyzing the application for and their deficiencies
existing patterns
REOGANIZATIONAL STEPS
1 finding and exploring suitable design patterns
2 reconstructing and documentation
– application classes corresponding to the design pattern
– incorporate names of the application classes to the classes in the
design pattern (e.g., LinkStrategy, HyperMediaDecorator)
What is a pattern? September, 2001
Results and experiences
RESULTS
• drastic reduction of dependencies between subsystems
• short design documentation
EXPERIENCES
• common vocabulary - main advantage
• reorganization is time-intensive task
• good knowledge of design patterns needed
• combination of several design patterns required