Class Responsibility Collaboration Cards

from Wikipedia, the free encyclopedia

The CRC card ( Class Responsibility Collaboration card ) is an aid for object-oriented design . The concept was developed by Ward Cunningham and Kent Beck in the late 1980s .

The basic principle is to create an index card for each class and to note its properties on this. There is no generally valid notation for CRC cards . In general, however, you orientate yourself on the first maps drawn by Ward Cunningham. These consist of three areas:

  • at the top is the name of the class
  • on the left hand side write down the responsibilities of the class
  • on the right side are the classes with which the described class works

There are a number of extensions to the original concept that add additional areas and in some cases also use the back of the cards.

The advantage of CRC cards is that they are easy to use. You can easily add or remove information. Due to the simple approach, you are also independent of the programming languages ​​and tools used. The limited space also forces the developers to concentrate on the essential tasks of a class.

Relations between the classes can be illustrated in different ways. Either you write the names of the classes you dealt with on the card, or you do z. B. the cards on a wall and draw lines between the cards.

example

The name of the class and that of the super class (if any) are noted on the front of the card. In addition, the area of ​​responsibility and the relationship to other classes are briefly described.

Name of the class Super great

Area of ​​responsibility
Description of the methods
Clear description of the method tasks.

Cooperation with
relation to other classes.

The class is described in more detail on the back using a list of operations and attributes.

Operations
Directory of operations at a suitable level of detail.
At first only the name of the operation is given, later also the parameters.

Attributes
Directory of the attributes in a suitable level of detail.

Conclusion

Only the essentials of a class should be noted on CRC cards. The class name is usually listed first. The map is only added in the analysis phase, when more information about the class is available. If there is no longer any need, you can delete information or even remove a complete card.

Web links