oopooadcrc-cards

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.


Solution

  • 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