Class-responsibility-collaboration Cards (CRC) cards is a tool that is used in creating software that is object-oriented. As a teaching tool, it was originally developed by Ward Cunningham and Kent Beck. The CRC cards are also highly-recommended by many programmers and supporters. This card is said to be the alternative for sequence program and is used for object collaboration.
CRC Cards are usually made from index cards and each of the members will write on the CRC Cards for any relevant class of their design. The card is divided into 3 major areas: the class name, the responsibilities of each class and the collaborators of other classes. CRC cards also help to avoid too many responsibilities for the class. Since these cards are portable, they can be easily seen and be easily re-arranged.
When to Use
CRC cards were originally created to teach object-oriented concepts. But they are also used to as a modeling technique. They can be used as an effective tool for conceptualizing models and also for detailed design. Many people find the CRC very wonderful, but some find it very cold. They can be used perfectly if the team is with so many details and the team is getting bogged. They can also be used when identifying the class seems so cluttered and there are no clear definitions. It is not good to have a long list of responsibilities. It may not fit your index card. CRC cards can also be used for any interactive designs. Many agile teams are making use of the CRC cards as a requirement and often use for designing an important set of objects.
Since this card represents the collection of similar objects they can be used in many ways. For example, in a university system, the classes there are represented by seminars, professors, and students. At the top of the CRC, the names of the classes will appear. And this is usually written in a singular noun phrase or a singular noun only. Singular names are used because of the fact that each class generally represents the version of an object.
Creating CRC Models
How you do you create models of CRC? These are the following steps on how to do it:
- Find Classes. This is the first step in making your model. This identifies the building blocks for the application. It is also good to look for 3-5 classes.
- Find Responsibilities. After finding the classes, it is now the time to look for the responsibilities. But, it must interact with the other classes to make the job well-done.
- Define the Collaborators. The class must collaborate with other classes. Collaboration comes in two forms: request to perform the task and a request for information.
- Move the cards. Understanding the system is letting everyone understands it. It is easier to understand if there are two cards that collaborate. And it is also easy to know the relationship between these classes.
There are also responsibilities that every class knows and does. For example, every student has their own name, phone numbers, and address. These are the information that the student knows. And when the student enrolls in a seminar or requests a transcript, these are the students does. Responsibility refers to the things that the class knows and the responsibility they do. There are times that the class needs to fulfill a responsibility but doesn’t have enough information to do it. What they need to do is to collaborate or interact with the card.
— Slimane Zouggari