Jump to content

Class-responsibility-collaboration card

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Paradoctor (talk | contribs) at 15:41, 15 December 2015 (copyedit). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Class-responsibility-collaboration (CRC) cards are a brainstorming tool used in the design of object-oriented software. They were originally proposed by Ward Cunningham and Kent Beck as a teaching tool,[1] but are also popular among expert designers[2] and recommended by extreme programming supporters.[3] Martin Fowler has described CRC cards as a viable alternative to UML sequence diagram to design the dynamics of object interaction and collaboration.[2]

CRC cards are usually created from index cards. Members of a brainstorming session will write up one CRC card for each relevant class/object of their design. The card is partitioned into three areas:[1][2]

  1. On top of the card, the class name
  2. On the left, the responsibilities of the class
  3. On the right, collaborators (other classes) with which this class interacts to fulfill its responsibilities

Using a small card keeps the complexity of the design at a minimum. It focuses designers on the essentials of the class and prevents them from getting into its details and implementation at a time when such detail is probably counter-productive. It also discourages giving the class too many responsibilities. Because the cards are portable, they can easily be laid out on a table and re-arranged while discussing a design.

Creating CRC cards

To create a CRC card, you can begin by writing out a scenario which identifies the major actors and actions which the actors do. Only write out actions and actors specific to that particular scenario. Nouns should turn into the classes of the card, verbs typically turn into the responsibilities of the card, and collaborators are the other cards with which the card will be interacting with.

See also

References

  1. ^ a b Beck, Kent; Cunningham, Ward (Feb 2012), "A laboratory for teaching object oriented thinking", ACM SIGPLAN Notices, 24 (10), india, NY, USA: Abg: 1–6, doi:10.1145/74878.74879, ISBN 0-89791-333-7
  2. ^ a b c Martin Fowler, UML Distilled, chapter 4
  3. ^ A concise introduction at extremeprogramming.org