More GRASP Patterns - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

More GRASP Patterns

Description:

Indirection. Pure Fabrication. Protected Variations. Polymorphism. Alternatives based on type ... Indirection. Using adaptors or intermediaries. ... – PowerPoint PPT presentation

Number of Views:128
Avg rating:3.0/5.0
Slides: 17
Provided by: dmi69
Category:

less

Transcript and Presenter's Notes

Title: More GRASP Patterns


1
Chapter 25
  • More GRASP Patterns

2
GRASP Patterns
  • Creator
  • Expert
  • Coupling
  • Cohesion
  • Controller
  • Polymorphism
  • Indirection
  • Pure Fabrication
  • Protected Variations

3
Polymorphism
  • Alternatives based on type
  • Use polymorphic operations for related
    alternatives or behaviors
  • Do not test for the type of an object and use
    conditional logic to perform different
    alternatives based on type.

4
Fig. 25.1
5
Fig. 25.2
6
Fig. 25.3
7
Fig. 25.4
8
Fig. 25.5
9
Fig. 25.6
10
Fig. 25.7
11
Pure Fabrication
  • When assigning responsibilities to domain classes
    lead to problems with cohesion, coupling, expert,
    or other patterns.
  • Use fabricated software classes.
  • Example
  • Sales class that does DB access for persistent
    storage.
  • Better have a PersistentStorage class.
  • Entity Javabeans EJB in Java EE.

12
Fig. 25.8
13
Fig. 25.9
14
Indirection
  • Using adaptors or intermediaries.
  • Decouple two classes, especially when one of them
    is under constant changes.

15
Fig. 25.10
16
Protected Variations
  • Identify points of variations and instability.
  • Assign responsibilities to interfaces.
Write a Comment
User Comments (0)
About PowerShow.com