CRC Modeling

 

CRC = Class Responsibility Collaborator

CRC Modeling =

analyze own needs with:

  • brainstorming (collect), process, organize, review, build CRC Model
  • Subject Matter Expert/ Domain Experts



    Assigning Collaborations

    Identify relationships among classes

    • Each class is specialist in some set of knowledge and behaviors
    • Classes must cooperate to accomplish nontrivial tasks
    • Thus collaborations between classes are important
    Pair collaborations with responsibilities on CRC card

    Use scenario-based role-play to find and/or test these collaborations

    • Scenario is a system behavior and sequence of system events to realize it
    • Simulating execution enables team to discover responsibilities and collaborations and/or check correctness of those already found

    Add collaborations when relationships found

    • Identify clients and servers

      Server -- class that provides a resource

      Client -- class that uses a resource

      Server is collaborator of client, not vice versa

      ATM example: In a withdrawal operation, Account is a client of the Withdrawal class


    • Identify hierarchies of classes

      ATM example: Transaction as superclass of Withdrawal, Deposit, etc.