Class-responsibility-collaboration card

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

The basic principle is for each class to create an index card and write down the features on this. For CRC cards, there are no generally accepted notation. However, it is generally guided to the first, drawn by Ward Cunningham cards. These consist of three areas:

  • The name of the class above
  • On the left to write the responsibilities of the class of small
  • On the right side are the classes that work with the class described

There are a variety of extensions of the original concept, which add additional areas and partly be sharing the back of the cards.

The advantage of CRC cards is the ease of handling. You can easily add or delete information. Due to the simple approach we used is also independent of programming languages ​​and tools. The limited space forces the developer in addition to focusing on the essential functions of a class.

Relations between classes can be illustrated in various ways. Either you write the name of the treating classes on the card or you do, for example, the cards on a wall fixed and draws lines between the cards.

Example

On the front of the card to record the name of the class and the superclass ( if any). In addition, the area of ​​responsibility and the relation are briefly described to other classes.

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

Cooperation with Relative to other classes.

On the back it describes the class a little more detail, using a list of operations and attributes.

Operations List of the operations in an appropriate level of detail. At first, only stating the name of the operation, and later of the parameters.

Attributes Record of the attributes in an appropriate level of detail.

Conclusion

In CRC cards only the essence of a class should be noted. First one usually leads to the class name. Only in the analysis phase, when more information about the class is available, the card is added. If there is no longer a need, you can also emphasize information or even remove an entire map.

192413
de