Upload
bbnc
View
915
Download
1
Embed Size (px)
Citation preview
CIS 320-07 1
CRC Cards
Class, Responsibility, Collaboration
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
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
CIS 320-07 4
What is a CRC card?
4x6 card card (or physical substitute)
Class Name
Collaborations (bullet list)
Responsibilities(bullet list)
CIS 320-07 5
CRC Card Advantages
SimpleCheapFamiliarTouchable (manipulate)Shareable (used in a group)Portable (low tech)Possible documentation
CIS 320-07 6
Process
Walk through scenarios Define Classes Add responsibilities Find collaborators
Iterate Use other scenarios
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?
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
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)
CIS 320-07 10
Iterate
Try other scenariosAdd cards as neededAdd responsibilitiesDivide objects if too complexDiscard cards if not used
CIS 320-07 11
Disadvantages
Can be noisy at first Not much quiet time