Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one elaborate design using CRC cards?

I've always been wondering how people use CRC (class responsiblity collaboration) cards. I've read about them in books, found vague information on the internet, but never grasped it really. I think someone ought to make a youtube video showing a session with CRC cards, since one of my books described it as being very hard to formulate in text, that it should be "taught by someone who already masters it". Sadly, I know noone around here who uses CRC cards and I'd like to learn more.

UPDATE

Any links to videos showing people elaborating with this technique would be appreciated.

like image 655
Statement Avatar asked Sep 19 '08 02:09

Statement


People also ask

What is the CRC card design technique?

Class-responsibility-collaboration (CRC) cards are a brainstorming tool used in the design of object-oriented software. They were originally proposed by Ward Cunningham and Kent Beck as a teaching tool, but are also popular among expert designers and recommended by extreme programming supporters.

How CRC cards are helpful in system Modelling?

CRC cards are used to represent the responsibilities of classes and the interaction between the classes. Analysts create the cards based on scenarios that outline system requirements. These scenarios model the behavior of the system under study.

When would you use a CRC card?

CRC cards are useful when the development of classes need to be divided between software engineers, as the cards can be physically handed over to them. A useful time to do this is when classes are being reviewed, for, say, determining whether they are appropriate in a design.


3 Answers

It's hard to summarize in an SO answer, but I'll try. One of the challenges of designing objects is balancing thinking from an overall perspective with thinking from the perspective of an individual object. You need the overall perspective to get the computation completed, but you need the individual object perspective to effectively subdivide the logic and data.

Maintaining this balance is where CRC cards come in. When they are sitting there on the table, you get to look at the computation as a whole. When you pick up a single card, though, you are physically, kinesthetically encouraged to take the point of view of that one object--I have this little piece of this computation to do with limited resources, how am I going to accomplish it?

Over time, the ability to simultaneously hold both perspectives seems to soak into the brain. Less and less gets written on the cards. Then the cards are blank. After a while people just point to where the card would be if they would bother taking a blank one off the stack. Eventually, people have the benefits of the thinking style without needing cards at all. When talking with someone who hasn't mastered the balance, pulling out reals cards can be a useful communication assist, though.

The biggest weakness I find with the cards is the lack of feedback. You can fool yourself about how the code is going to turn out. I would suggest using cards only until an interesting question comes up, turn to tests/code for confirmation, and then resume designing.

Ward and I made a video 15 or so years ago of a design session, but I don't find it online anywhere and I don't have a copy. I'm not sure it would be useful as a teaching tool in any case. I don't know of other videos, but they could be interesting, especially if you got to compare several different designer's styles.

like image 185
Kent Beck Avatar answered Oct 07 '22 17:10

Kent Beck


I'll try to give an answer. So CRC cards are generally used for modelling in a Object-Oriented environment to get a better understanding of the system that has to be developed (but that I think you'll know already). CRC cards come at the very end, when you arrive just before the actual implementation. The different steps to reach that level could be the following:

  1. The starting point is to do the requirement elicitation. Involving the customer early and continuously is suggested here (take a look at Agile approaches, i.e. Extreme Programming)
  2. The requirements can then be modeled either with Use Case diagrams (UML) or with User stories (agile extreme programming approach). The key problem here is to find the right involved objects. This depends very much on the domain you're in, of course. If you go the "hard" way, you can apply techniques like "noun extraction". So you parse the specification document and extract all nouns (including composite names and those with adjectives). Analyze all of them and discard the irrelevant ones.
  3. Once you have the right nouns -> objects you can start creating your CRC cards. So what is done in a CRC session? The main task is to find and assign the responsibilities of your (previously) found objects which are then put down on small index cards (our CRC cards). "Responsibilities" are mainly the core functionalities of a specific object and the "collaboration" part are the needed other objects for fulfilling certain functionalities (these are the dependencies among the different objects in your model). Important points for assigning the responsibilities is that the responsibilities are distributed well on the whole system in some kind of balanced way. Another very important point is to avoid any duplication of responsibilities among the objects (this is where the CRC cards help).
    A CRC session should start with a brainstorming meeting, having an active discussion among the developers and it should be performed on the actual index cards directly.

I hope I was able to somehow help you.

Regards,
Juri

like image 37
Juri Avatar answered Oct 07 '22 18:10

Juri


go to the source - Kent Beck, Ward Cunningham, ever heard of them?

like image 22
Steven A. Lowe Avatar answered Oct 07 '22 19:10

Steven A. Lowe