CSci 375/12 GRASP I
Table| Date | # | Topic (Participation 2pt) | Study pages (2 pts) | Quiz(15 pts) | Project Work(10 pts)
|
|---|
| Previous | 11 | Class Diagrams | 248-270 | Q5(221-270) | -
|
| Today | 12 | GRASP | 271-319 | - | W5(Interaction & Class Diagrams)
|
| Next | 13 | Object Design | 320-362 | Q6(271-362) | -
|
(Close Table)
Revision History
Table| Version# | Date | Description | Author
|
|---|
| 0 | 2005-01-03 | Used boiler plate to make template | RJB
|
| 1 | 2005-01-14 | Added Chapter headings and Notes | RJB
|
| 2 | 2006-02-14 | Updated to new look | RJB
|
| 3 | 2007-01-10 | Added project link | RJB
|
(Close Table)
The GRASP Patterns
- **** When you read this chapter take note of how Larman documents the use of GRASP.
He links a message to its objects with a GRASP pattern name. Do this in your
projects in this class.
What is a pattern
An Example Pattern: The Pizza Inversion Pattern
[ pizza-inv.html ]
(Ho Ho Only Serious).
What is GRASP?
(see GRASP below).
17.1 UML vs Principles
- * UML lets you communicate, recall, store ideas...
- * Principles help you choose the right way to go, make decisions and choices.
17.2 Object Design
- ** OO design is about choosing who does what inside the computers.
Figure 17.1 How it all fits together
[ artifactrelationships.gif ]
17.3 Responsibilities -- things that objects know how to do
* The R in gRasp.
**** Objects are little capsules of intelligence.
- **** They know how and know what: they have operations and attributes.
17.4 GRASP -- good ways to allocate responsibilities to objects
- Exercise: name as many GRASP as you can from memory.
Here
[ 16answer.html ]
are the 9 GRASP principles/patterns
17.5 Connections
17.6 Patterns
- *** a workable resolution to a set of conflicting forces.
* Patterns are the P in GRASP.
- * A Pattern is a "good enough" way of solving a complex problem. It
balances the competing forces in a sensible way. It has been used on at
least three similar situations. Patterns are found and recorded not
created.
- * Patterns resolve a set of forces in a repeatable and useful way.
- *** See inside cover of book.
- See my notes
[ patterns.html ]
- See the famous
[ wiki?CategoryPattern ]
- See Brad Appletons Documents
[ http://www.cmcrossroads.com/bradapp/docs/ ]
- For more Patterns and discussions of patterns see
[ wiki ]
(The WikiWikiWeb).
- Also checkout the Wikipedia entry
[ GRASP_%28Object_Oriented_Design%29 ]
17.7 Summary: process, responsibility metaphor, patterns, UML
17.8 Short Example: Monopoly
- Exercise: can you reconstruct this example without looking at the book?
- By the way here is a first rough transcription of these figures into C++:
[ testPlayMonopoly.cpp ]
17.9 Applying GRASP
17.10 Creator
- * take note of suitable creators for an object.
17.11 Expert
- A very powerful idea.
- *** Tends to incorporate parts of the domain model into the software design.
17.12 Low Coupling
- ***** Coupling has guided good software design for nearly 40 years.
- + Reduce dependencies.
17.13 Controller
- **** Don't fill up user interface classes with domain/business stuff.
- **** Separate the model and view by a controler.
[ patterns.html#MVC ]
- + Some people dislike use case/session controlers.
- + View is often technology dependent and Controllers determined
by the user's needs of the moment.
- + The "model" or domain layer is independent of technology
and inspired by the domain or business model.
17.14 High Cohesion
- **** Cohesion has guided good software design for nearly 40 years.
- + Separate concerns into different classes.
- + place responsibilities to give focussed objects.
- + Ballancing cohesion and coupling is an art form.
17.15 Resources
. . . . . . . . . ( end of section The GRASP Patterns) <<Contents | End>>
Questions and Answers
[ 12q.html ]
Exercises
UML class diagram notations. (Prep for quiz next time)
Example:
- Does every A have a D?
- Does every B Have a C?
- Does every B have a D?
- Does every A have a C?
Possble handout....
Next -- GRASP 1
Start by reviewing the
[ 13.html ]
on Object Design with GRASP.
Project Step 5 Interactions and Classes
[ w5.html ]
is due next class.