[Skip Navigation] [ CSUSB ] / [CNS] / [Comp Sci & Engineering] / [R J Botting] / [CS375] [Search ]
[About] [Contact] [Grades] [Objectives] [Patterns] [Projects] [Question] [Schedule] [Syllabus]
Session: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
[Text Version] 12.html Mon Sep 28 15:44:31 PDT 2009

Contents


    CSci 375/12 GRASP I


    Table
    Date#Topic (Participation 2pt)Study pages (2 pts)Quiz(15 pts)Project Work(10 pts)
    Previous11Class Diagrams248-270Q5(221-270)-
    Today12GRASP271-319-W5(Interaction & Class Diagrams)
    Next13Object Design320-362Q6(271-362)-

    (Close Table)

    Revision History


    Table
    Version#DateDescriptionAuthor
    02005-01-03Used boiler plate to make templateRJB
    12005-01-14Added Chapter headings and NotesRJB
    22006-02-14Updated to new lookRJB
    32007-01-10Added project link RJB

    (Close Table)

    The GRASP Patterns

    1. **** 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

    2. * UML lets you communicate, recall, store ideas...
    3. * Principles help you choose the right way to go, make decisions and choices.

      17.2 Object Design

    4. ** 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.
    5. **** They know how and know what: they have operations and attributes.

      17.4 GRASP -- good ways to allocate responsibilities to objects

    6. 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

    7. *** a workable resolution to a set of conflicting forces.
      * Patterns are the P in GRASP.
    8. * 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.

    9. * Patterns resolve a set of forces in a repeatable and useful way.

    10. *** See inside cover of book.
    11. See my notes [ patterns.html ]
    12. See the famous [ wiki?CategoryPattern ]
    13. See Brad Appletons Documents [ http://www.cmcrossroads.com/bradapp/docs/ ]

    14. For more Patterns and discussions of patterns see [ wiki ] (The WikiWikiWeb).
    15. Also checkout the Wikipedia entry [ GRASP_%28Object_Oriented_Design%29 ]

      17.7 Summary: process, responsibility metaphor, patterns, UML

      17.8 Short Example: Monopoly

    16. Exercise: can you reconstruct this example without looking at the book?
    17. By the way here is a first rough transcription of these figures into C++: [ testPlayMonopoly.cpp ]

      17.9 Applying GRASP

      17.10 Creator

    18. * take note of suitable creators for an object.

      17.11 Expert

    19. A very powerful idea.
    20. *** Tends to incorporate parts of the domain model into the software design.

      17.12 Low Coupling

    21. ***** Coupling has guided good software design for nearly 40 years.
    22. + Reduce dependencies.

      17.13 Controller

    23. **** Don't fill up user interface classes with domain/business stuff.
    24. **** Separate the model and view by a controler.

      Model-View-Controller packages in the UML

      [ patterns.html#MVC ]

    25. + Some people dislike use case/session controlers.
    26. + View is often technology dependent and Controllers determined by the user's needs of the moment.
    27. + The "model" or domain layer is independent of technology and inspired by the domain or business model.

      17.14 High Cohesion

    28. **** Cohesion has guided good software design for nearly 40 years.
    29. + Separate concerns into different classes.
    30. + place responsibilities to give focussed objects.

    31. + 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:

    [C--<>B---|>A<>----D]


    1. Does every A have a D?
    2. Does every B Have a C?
    3. Does every B have a D?
    4. 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.

Review Questions

[ 12r.html ]

Standard Definitions

  • CS202::= See http://cse.csusb.edu/dick/cs202/.
  • CS372::= See http://cse.csusb.edu/dick/cs372/.

  • DCD::diagram="Design Class Diagram", shows the classes that will be implemented in code.
  • DRY::XP="Don't Repeat Yourself".

  • ESSUP::Process= See http://www.ivarjacobson.com/essup.cfm, Ivar Jacobsen simplified "Essential" UP.

  • Glossary::= See http://cse.csusb.edu/dick/cs375/uml.glossary.html.
  • GoF::="Gang of Four", [ patterns.html#GoF ]
  • GRASP::patterns="General Responsibility Assignment Software Patterns", a set of guidelines for designing objects and classes. They take a single event that the system must handle and determine a good class to carry it out. See [ patterns.html#GRASP -- General Responsibility Assignment Software Patterns ]
  • Grades::= See http://cse.csusb.edu/dick/cs375/grading/.

  • KISS::Folk_law="Keep It Simple, Stupid", in agile processes this means never drawing a diagram or preparing a document that doesn't provide value to the clients and stakeholders. In all processes it means never designing or coding what is not needed, see YAGNI.

  • OO::shorthand="Object-Oriented".

  • OOAD::="Object-Oriented Analysis and Design", See chapter 1 in text.
  • patterns::="Documented families of problems and matching solutions", see Patterns.
  • Patterns::= See http://cse.csusb.edu/dick/cs375/patterns.html.

  • Process::="How to develop software".

  • RJB::=The author of this document, RJB="Richard J Botting, Comp Sci Dept, CSUSB".
  • RUP::Process="Rational UP", a proprietary version of UP.

  • SSD::="System Sequence Diagrams", see chapter 10.

  • TBA::="To Be Announced".

  • UML::="Unified Modeling Language". [ Unified_Modeling_Language ]

  • UP::="Unified Process", an iterative, risk-driven, and evolutionary way to develop OO software.

  • YAGNI::XP="You Ain't Gonna Need It", an XP slogan that stops you planning and coding for things that are not yet needed. As a rule the future is not predictable enough to program a feature until the stakeholders actually need it now. In this class it means "It won't be on the final or in quizzes".

  • XP::="Extreme Programming", the ultimate iterative code-centric, user-involved process.

    End