CRC Cards
Recently I took part in a brainstorming session about the design of a c# application. We chose to use Class Responsibility Collaboration (CRC) Cards to come up with our basic object model and get the responsibilities straight. I have used this technique a few times before, and always with good results.
I think CRC Cards help to keep the brainstorming focused and at the end of the session you have your model ready, on paper. You should definately give this technique a try when you have to do some (re)designing or refactoring.
Thursday 08 Jun 2006 | Guy Mahieu | agile(t) , modeling(t)
An interesting approach is to use object cubes which are derived from CRC cards as discussed by David West in his bok Object Thinking. Object cubes have 6 sides of which the first side is the typical CRC, side 2 contains a short description of the object, side 3 is the contract, side 4 contains the data needed, side 5 contains the method signatures and side 6 events.
Sounds interesting indeed, but I wonder if it gives any added value; I like the CRC card approach because it gives you the basic info you need without the extra’s and they are easy to maintain during meetings and development.
Since I don’t have a copy of the book I’m curious on how do those cubes work: are they actual cubes and do you have to use glue, tape and scissors to put them together? Or are they purely virtual?
Object Cubes are basically like the CRC cards index cards, for Object Cubes you either use 3 index cards and use each side or just 6 seperate index cards.
The Object Cube technique is an extension to the CRC cards. Whether you use an Object Cube or the CRC card approach all depends on how much you want to design. On side 3 for example you can specify which of the responsabilities can be exposed publicly, internally … On side 4 you define the data types for example whether the object uses an IList … The first two sides (CRC + description) is in plain English and it’s okay to use language specific syntax on the other sides. For example on side 5 where you can capture the method signatures it is okay to use C# syntax if the entire team is C# oriented.