CRC Cards

Class, Responsibility, Collaboration

CIS 320-07


CRC Cards
„ Class, Responsibility, Collaboration Cards „ Originally used to teach OOD
ƒ Beck and Cunningham (1989) ƒ

„ Not part of UML „ Used in XP (see links on Web site) „ Integral part of much OOD
CIS 320-07 2

What are they used for?
„ Identify and clarify objects „ Understand behaviours for objects and what they must carry out „ Understand how object cooperate with one another „ Creating an OO Design

CIS 320-07


What is a CRC card?
„ 4x6 card card (or physical substitute)
Class Name

Responsibilities (bullet list)

Collaborations (bullet list)

CIS 320-07


CRC Card Advantages
„ „ „ „ „ „ „ Simple Cheap Familiar Touchable (manipulate) Shareable (used in a group) Portable (low tech) Possible documentation
CIS 320-07 5

„ Walk through scenarios
ƒ Define Classes ƒ Add responsibilities ƒ Find collaborators

„ Iterate
ƒ Use other scenarios

CIS 320-07


Defining Classes
„ „ „ „ Drive using scenarios Start with domain objects and nouns Blue Sky (brainstorm and then refine) What objects are needed to make things work?

CIS 320-07


Defining Responsibilities
„ Behaviour for which an object is accountable „ What work has to be done? „ Use active verbs „ Use Cases will suggest responsibilities „ Split object if too many responsibilities

CIS 320-07


„ Other object which collaborate to create some “higher” behaviour „ Physical manipulation of cards during scenario „ Overlapping cards „ Piling cards (most abstract on top)

CIS 320-07


„ „ „ „ „ Try other scenarios Add cards as needed Add responsibilities Divide objects if too complex Discard cards if not used

CIS 320-07


„ Can be noisy at first „ Not much quiet time

CIS 320-07


Sign up to vote on this title
UsefulNot useful