CTIN 289 - Interactive Snippets Library

Powered by 🌱Roam Garden

CRC Cards

A CRC card contains three pieces of information:

The Class name

The class's main Responsibilities, described in human language using only a few words

The class's main Collaborators, that is, the names of other classes that this one talks to

A collaborator is a class that your class needs a reference to.

For example, a Player might spawn Missiles. But if the Player doesn't actually need to talk to Missiles, then it's not a collaborator.

When you think about the Collaborators, imagine it as a one-way arrow. What classes does this one talk to?

Sometimes one class needs to talk to another, but it's only in one direction. In that case, class A is a collaborator of class B.

Other times, the classes need to talk to each other. In that case, A is a collaborator of B, and B is also a collaborator of A.