CRC Cards - Construction

Software EngineeringObject Oriented Programming
1.0x

CRC Cards - Construction

Created 3 years ago

Duration 0:03:55
lesson view count 410
Select the file type you wish to download
Slide Content
  1. CRC Cards: Construction

    Slide 1 - CRC Cards: Construction

    • Emerson Murphy-Hill
    • Creative Commons Attribution 4.0 License.
    • Material Produced by NCSU Software Engineering Faculty.
  2. Step 1:  Identify and assign candidate classes

    Slide 2 - Step 1: Identify and assign candidate classes

    • Read requirements specification.
    • Highlight nouns and noun phrases to give candidate classes (possibly excluding abstract nouns).
    • Write each candidate class down on an index card.
    • Assign each index card to one person who is participating in the CRC card modelling session.
  3. Step 2:  Determine a set of specific scenarios

    Slide 3 - Step 2: Determine a set of specific scenarios

    • Develop a comprehensive and specific set of end-to-end scenarios based upon the requirements.
    • A scenario is a sequence of actions that illustrates behavior.
    • Example:
    • Requirement: The alarm clock shall allow a user to set the time.
    • Scenario: The user sets the time for 1:15PM.
  4. Step 3:   Walk through the scenario, naming cards and responsibilities

    Slide 4 - Step 3: Walk through the scenario, naming cards and responsibilities

    • Walk through the handling of a scenario case pointing to or picking up the cards, naming their responsibilities and how they handle and delegate each request.
    • Add new cards as classes are needed.
    • Note: It’s always good to do very basic/mainstream scenarios first, then explore alternative/complicated scenarios.
  5. Clear Intersection Example

    Slide 5 - Clear Intersection Example

    • Car wants to drive through an intersection.
    • The car can only drive through the intersection if the traffic light is green and there are no cars in the intersection.
    • Otherwise, the car needs to join a queue.
  6. Step 1:  Identify and assign candidate classes

    Slide 6 - Step 1: Identify and assign candidate classes

    • Car wants to drive through an intersection.
    • The car can only drive through the intersection if the traffic light is green and there are no cars in the intersection.
    • Otherwise, the car needs to join a queue.
    • Car
    • Traffic light
    • Queue
    • Intersection
  7. Step 2:  Determine a set of specific scenarios

    Slide 7 - Step 2: Determine a set of specific scenarios

    • Car approaches the intersection and the light is green and there are no cars in the way.
    • Car approaches the intersection and the light is red.
    • Car is in the queue and the light turns green.
  8. Step 3:   Walk through the scenario, naming cards and responsibilities

    Slide 8 - Step 3: Walk through the scenario, naming cards and responsibilities

    • Index Card: Car
    • Responsibility
    • Drive
    • Join
    • Collaborator
    • Traffic light
    • Queue
    • Intersection
    • Car
    • Car approaches the intersection and the light is green and there are no cars in the way.
    • Car approaches the intersection and the light is red.
    • Car is in the queue and the light turns green.