Given its limited space, what you can say on a CRC card will be brief. But CRC cards are much more than a compact space to record design ideas. They are real and tangible. You can pick up a card and talk about it as if it were the object itself, forgetting that the card “stands in” for a “real” object. You can use CRC cards to explore what candidates are and how they relate to others. You can move a card closer to any collaborators. You can poke at them, making as many connections and distinctions as you can. You can pick them up and lay out a new arrangement that amplifies a fresh insight, looking for patterns and similarities and differences. Which objects do similar things? Put them in a pile. Which objects are part of a neighborhood working on part of the problem? Move them closer. Get a sense of how your candidates fit and relate. Some useful ways to cluster candidates are as follows:
- By application layer
- By use case
- By stereotype role
- By neighborhood
- By abstraction level
- By application theme
There is no standard way to fill out or use CRC cards. Several books have been written on the “art” and “practice” of CRC card modeling. David Bellin and Susan Suchman Simone’s The CRC Card Book (Addison-Wesley, 1997) talks much about the process and people aspects of CRC cards. In Nancy Wilkinson’s Using CRC Cards: An Informal Approach to Object-Oriented Development (SIGS, 1995), a CRC model for a library application is worked out and its translation to a C++ implementation is described.
Figure out what works best for you. Use CRC cards to express your ideas. Jot down initial ideas on the unlined side: At the very minimum, record a candidate’s name, a brief description, and its role stereotypes (see Figure 3-2). That’s mainly what you’re initially looking for. Later you’ll get more specific.
Figure 3-2. The purpose of a candidate is recorded on the unlined side of a CRC card.
But you can also note things of interest: Does a candidate play a role in a well-known design pattern? Name that pattern and the candidate’s role in it. Is it intended to fit into a narrow context, or, if carefully designed, might it be used in different applications? Note anything unusual and worth remembering. Is it an important abstraction? Put a big star by its name. As shown in Figure 3-3, use CRC cards to express what you think is important to know about a candidate.
Figure 3-3. You can add scribbles, questions, and comments to a CRC card to help you remember key points.