Class-Responsibility-Collaboration card
Encyclopedia
Class Responsibility Collaboration (CRC) cards are a brainstorming
Brainstorming
Brainstorming is a group creativity technique by which a group tries to find a solution for a specific problem by gathering a list of ideas spontaneously contributed by its members...

 tool used in the design of object-oriented software. They were proposed by Ward Cunningham
Ward Cunningham
Howard G. "Ward" Cunningham is an American computer programmer who developed the first wiki. A pioneer in both design patterns and Extreme Programming, he started programming the software WikiWikiWeb in 1994 and installed it on the website of his software consultancy, Cunningham & Cunningham , on...

 and Kent Beck
Kent Beck
Kent Beck is an American software engineer and the creator of the Extreme Programming and Test Driven Development software development methodologies. Beck was one of the 17 original signatories of the Agile Manifesto in 2001....

.

They are typically used when first determining which class
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...

es are needed and how they will interact.

CRC cards are usually created from index card
Index card
An index card consists of heavy paper stock cut to a standard size, used for recording and storing small amounts of discrete data. It was invented by Carl Linnaeus, around 1760....

s on which are written:
  1. The class name
  2. Its Super and Sub classes (if applicable)
  3. The responsibilities of the class.
  4. The names of other classes with which the class will collaborate to fulfill its responsibilities.
  5. Author


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 her/him from getting into its details and inner workings
Implementation
Implementation is the realization of an application, or execution of a plan, idea, model, design, specification, standard, algorithm, or policy.-Computer Science:...

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.

Example

Class name Super class
Subclasses
Classes that are derived from this one
Responsibilities
Description of methods
Collaborations
Relationship to other classes

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK