Design Patterns. Weslei A. de T. Marinho. Talk Outline. Pattern Definition GRASP Patterns GoF Patterns GoF Patterns Classification Creational Patterns Structural Patterns. What is a Pattern?.
Weslei A. de T. Marinho
"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)
B is a creator of A objects.
If more than one option applies, usually prefer a class B which aggregates or contains class A.
Problem: Who knows about a Square object, given a key?
How to distribute the responsibilities for obtain the sale’s total?
Given following classes:
What is better for a makePayment design?
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.
In practice, the level of cohesion alone can't be considered in isolation from other responsibilities and other principles such as Expert and Low Coupling.
Table 1: Designpatternspace