11
CIS 320-07 1 CRC Cards Class, Responsibility, Collaboration

07 UML CRC

  • Upload
    bbnc

  • View
    915

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 07 UML CRC

CIS 320-07 1

CRC Cards

Class, Responsibility, Collaboration

Page 2: 07 UML CRC

CIS 320-07 2

CRC Cards

Class, Responsibility, Collaboration CardsOriginally used to teach OOD

Beck and Cunningham (1989) c2.com/doc/oopsla89/paper.html

Not part of UMLUsed in XP (see links on Web site)Integral part of much OOD

Page 3: 07 UML CRC

CIS 320-07 3

What are they used for?

Identify and clarify objectsUnderstand behaviours for objects and

what they must carry outUnderstand how object cooperate with

one anotherCreating an OO Design

Page 4: 07 UML CRC

CIS 320-07 4

What is a CRC card?

4x6 card card (or physical substitute)

Class Name

Collaborations (bullet list)

Responsibilities(bullet list)

Page 5: 07 UML CRC

CIS 320-07 5

CRC Card Advantages

SimpleCheapFamiliarTouchable (manipulate)Shareable (used in a group)Portable (low tech)Possible documentation

Page 6: 07 UML CRC

CIS 320-07 6

Process

Walk through scenarios Define Classes Add responsibilities Find collaborators

Iterate Use other scenarios

Page 7: 07 UML CRC

CIS 320-07 7

Defining Classes

Drive using scenarios Start with domain objects and nounsBlue Sky (brainstorm and then refine)What objects are needed to make things

work?

Page 8: 07 UML CRC

CIS 320-07 8

Defining Responsibilities

Behaviour for which an object is accountable

What work has to be done?Use active verbsUse Cases will suggest responsibilitiesSplit object if too many responsibilities

Page 9: 07 UML CRC

CIS 320-07 9

Collaborations

Other object which collaborate to create some “higher” behaviour

Physical manipulation of cards during scenario

Overlapping cardsPiling cards (most abstract on top)

Page 10: 07 UML CRC

CIS 320-07 10

Iterate

Try other scenariosAdd cards as neededAdd responsibilitiesDivide objects if too complexDiscard cards if not used

Page 11: 07 UML CRC

CIS 320-07 11

Disadvantages

Can be noisy at first Not much quiet time