What are CRC Cards?

Apr 13 2021

They are commonly used for brainstorming to help design object-oriented software.

CRC cards are used after “use-case” descriptions before class diagrams within software development.

They are usually created from index cards. The card is partitioned into three areas

  1. On the top: the class name
  2. On the left: the responsibilities of the class
  3. On the right: collaborators (other classes) with which this class interacts to fulfill its responsibilities.

Using a small card minimises the complexity of the design. And focuses on the essentials of the class and prevents designers from getting into the small details and implementation at a time when details like those are probably counter-productive.

One benefit is that it discourages giving the class too many responsibilities.

If they’re are written on physical cards, they can easily be laid out on a table and re-arranged when discussing design.

How to create

  • Begin by writing out a scenario which identifies the major actors and actions which are performed by the actors.
  • Only write actors and actions specific to the scenario.
  • Nouns should turn into the classes of the card
  • Verbs typically turn into the responsibility of the card
  • Collaborators are the other cards that the card will be interacting.
  • Use in small groups / for small projects
  • Keep it informal
  • Use to brainstorm many different logical paths.

Pros vs Cons

Advantages

  • Very cooperative and very collaborative technique
  • Helps determine what classes are needed
  • Ongoing process
  • User inpur is very useful
  • Allows for learning from others
  • Allows to compare ideas

Disadvantages

  • Not great if you need a lot of detail
  • Cooperation of users required
  • No timeline throughout the cards
  • Hard with large projects.

Summary 📝

Sometimes when planning work before coding, its good to think about where code belongs or what responsibilities a class should have because it will help with the organisation as well as making things easier for developers.

It can be difficult to sum up all the pieces of code, functions or classes needed to build a feature and methods like this can help make the overall design be more thoughtout and less prone to brittleness in the future

I personally haven’t seen or experienced a CRC-card session, but if I were to apply the thought process behind the concept and apply it to my own workflow, I’d bet that the quality of the work I create would improve.

Written on April 13, 2021