CSC/ECE 517 Fall 2007/wiki2 5 kq: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
This Wiki Page is edited by Kunta Tsai and Qinyi Ding
 
== This Wiki Page is edited by Kunta Tsai and Qinyi Ding ==
 


=Topic=
=Topic=

Revision as of 19:43, 20 October 2007

This Wiki Page is edited by Kunta Tsai and Qinyi Ding

Topic

CRC cards. Hundreds of Web pages cover CRC cards. Which explain them best? Which explain them in the context of specific languages, e.g., Ruby and Java? Which exercises can be used to teach them best, (i) interactively over the Web, (ii) to a class of students, via in-class exercises, (iii) for self-study?

Definition

A Class Responsibility Collaborator (CRC) model (Beck & Cunningham 1989; Wilkinson 1995; Ambler 1995) is a collection of standard index cards that have been divided into three sections, as depicted in Figure 1. A class represents a collection of similar objects, a responsibility is something that a class knows or does, and a collaborator is another class that a class interacts with to fulfill its responsibilities.

Figure 1

Advantages of CRC Card

Using a small card keeps the complexity of the design at a minimum. It focuses the designer on the essentials of the class and prevents him from getting into its details and inner workings at a time when such detail is probably counter-productive. It also forces the designer to refrain from 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 with other people.

A common method to determine what cards should be created is to read a specification for the program being designed and consider if each noun should be a class and if each verb should be a responsibility of the noun or class to which it belongs. Naturally, the existence of a noun or verb does not require a class or responsibility in the program, but it is considered a good starting point.

Best Page Related to CRC

Examples of CRC

Ruby Example

Java Example

Teaching Exercises for CRC

Exercise for Teaching Interactively over the Web

Exercise for Teaching in a Class

Exercise for Self-study

Reference