Class Responsibility Collaboration (CRC) cards are used to document a class in the system and contains information about its responsibility and collaborations with other classes.

Responsibility and collaboration

When talking about the responsibility and collaboration of a class, it is important we make reference to the GRASP Design Principles. In object-oriented design, a class has to know its responsibility and do its responsibility. In structural modelling, most use cases involves a set of several classes, these classes form collaborations. Collaborations allow the analyst to think in terms of clients, severs, and contracts. A client object is an instance of a class that sends a request to an instance of another class for an operation to be executed. A server object is the instance that receives the request from the client object. A contract formalises the interactions between the client and the server objects. For example, a patient makes an appointment with a doctor. This sets up an obligation for both the patient and doctor to appear at the appointed time. An analyst can use the idea of class responsibilities and client-server-contract collaborations to help identify the classes, along with the attributes, operations and relationships, involved within a use case.

Elements of a CRC card

Each CRC card captures and describes the essential elements of a class. The front of the card contains the class name, ID, type, description, associated use cases, responsibilities, and collaborators. The name of a class should be a noun (but not a proper noun, such as the name of a specific person or thing).

Example


Back to parent node: Structural Modelling

System_Design_and_ModellingAnalysis_ModellingStructural_ModellingCRC_CardISYS2110

Reference

  • Alan Dennis, David Tegarden, & Barbara Haley Wixom, 2012, Systems Analysis and Design with UML, 4th Edition, Wiley.