Fork me on GitHub
 
 

Domain Driven Design using CRC cards

Written by Aravind H.U on Aug 23, 2014

When we model classes for Domain, in any agile project, we start brainstorming the entities involved in the system, the way they communicate with each other, there properties and behaviours.

When we collaborate this brainstorming activity with all stakeholders, it get messed up and thoughts shared by collaborators might get missed out or misunderstood. So an alternative approach to brainstorm is to use CRC cards, it stands for Class Responsibility and Collaboration cards.

These cards are just paper handouts of post card size. Its very easy to create these cards, more than that its very easy to dispose if you make a mistake. These cards are spread across your round meeting table by representing each class with a card. Each card consists of 3 sections, name of the class, Responsibilities of the class, and the list of collaborated classes it interacts with.

Usually people use CRC cards in the below format.

Sample Class responsibility and collaboration card

You can create N number of cards, by reviewing requirement documents or an Agile user Story.

When we create CRC cards, we should not worry about code naming conventions, because these are not actual, Its almost similar to UML diagrams but its more easier and simpler than UML.

Using these cards you could analyze dependencies, coupling, and cohesion factors between entities by keeping related cards one above the other, you can also think of interfaces, abstractions protocols and many more.

Using CRC cards allows us to easily apply and adopt Object oriented design principles and practices, we can easily apply and adopt SOLID and GRASP principles For eg.. If your list of responsibilities in any card is too huge then you have to redesign it because its more likely that you might end up creating a God object.

Remember as I said before, CRC cards help when we do system design in collaboration, when we collaborate and build cards, we should always have some one to lead so that focus on cards remain stable other wise we might end up with mess and waste time :) .

Share this:

Disclaimer

I hope that you won’t object if I occasionally use contractions and the less formal “you” instead of “one” in my posts presented here. That makes writing it easier for me and ensures a less formal atmosphere.

I attempt to post articles here as carefully as possible, but I cannot guarantee absolute freedom from errors in general at this time. Please bear with me. If you would like to help me please contact me

The information contained in this website is for general information purposes only. I try to keep the information up to date and correct, I make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose.

Any reliance you place on such information is therefore strictly at your own risk.

×