Design Patterns: Weslei A. de T. Marinho
Design Patterns: Weslei A. de T. Marinho
Weslei A. de T. Marinho
TALK OUTLINE
Pattern Definition
GRASP Patterns
GoF Patterns
GoF Patterns Classification
Creational Patterns
Structural Patterns
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“ (Christopher Alexander)
WHAT IS A PATTERN?
“Pattern is a named and well-known
problem/solution pair that can be applied in
new contexts, with advice on how to apply
it in novel situations and discussion of its
trade-offs, implementations, variations,
and so forth.” (Craig Larman)
WHY USE PATTERNS?
• A pattern addresses a recurring design problem that arises
in specific design situations, and presents a solution to it.
• Patterns document existing, 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 architectures.
WHY USE PATTERNS?
Patterns support the construction of
software with defined properties.
Patterns help you build complex and
heterogeneous software architectures.
Patterns help you to manage software
complexity.
TYPES OF PATTERNS
• GRASP Patterns
• Architectural Patterns
• Design Patterns
• Idioms
• …
• E.g.: Usability Patterns
• Anti-Patterns
BASIC PATTERN METAMODEL
Pattern
Problem Solution
name
Consequence
GOF PATTERN METAMODEL
ExampleDomai
SampleCode Intent
n *
*
A.K.
A *
relPatterns
* Issues
Pattern
*
name
* Participant
Applicability * *
(Problem)
Structure
(SolutionGraphicalDescription
) ClassDiagram
B:
In practice, the level of coupling alone can't be considered in isolation from other principles
such as Expert and High Cohesion. Nevertheless, it is one factor to consider in improving a
design.
HIGH COHESION
Name: High Cohesion