Michael Knopf

turning concepts into working products...

Responsibility-Driven Design using the Class Card Technique
Michael Knopf
Wednesday, June 18, 2008 | Share on Facebook RSS Feeds

To draw up a CRC card, simply take a 3" x 5" note card and write the proposed name of a class across the top of the lined side of the card. On the unlined side of the card, write a sentence or two that serves as a purpose statement for the class. 

The purpose statement should reflect the Object Role Stereotypes of the class. Divide the lined side of the note card into two columns. In the left column, list the responsibilities of the class (something along the lines of "knows the invoice header information" or "decides whether to send an e-mail message" or "sends an e-mail message"). Again, each of these responsibilities should fit in with the object role stereotypes of the class. In the right-hand column, list other classes that must be interacted with in order to fulfill the duties in the left-hand column. 

CRC cards seem to have been passed over in popularity by UML modeling, but the technique is very effective, much simpler, and all you need is a stack of 3" x 5" note cards. The Class Card object modeling technique is an extremely easy and simple way to design your applications objects. As an alternative to UML Diagrams, Class Cards are simply 3.5in X 5in pieces of paper (index cards) that you write information on about each object in your application. It helps us to think about our design in a "object oriented" manner, something most of us can relate with because we deal with "objects" each and every day of our lives