Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 4 - Chris Whalen
Midterm Spring 2004
1) What are CRC cards? Who invented them? What do they show?
CRC (Class-Responsibility-Collaboration) cards were conceived by Ward Cunningham. These cards are a tool for object oriented design for they help the designer visualize what classes are needed and how these classes will interact with each other. They are normally index cards with the class name at the top of the card, the class responsibilities underneath the class name to the left, and the class collaborators underneath the class name to the right.
2) How are CRC cards used?
Software designers physically step through their classes by using the CRC cards. The process goes like this:
Step 1. Place a card onto a table for each object. Place another card on the table for the object that the first card will be sending a message to.
Step 2. Perform a scenario walkthrough by either pointing to the CRC cards or by picking them up. As you point or pick the cads up, name their responsibilities and how they will handle each request.
Step 3. Pick up cards as they leave the scenario.
Step 4. Add cards, push cards to the side, to let the design evolve. CRC cards permit several design alternatives to sit on the table at the same time. Do not throw cards away, but push them to the side, in case it turns out later they are useful.
Step 5. Make sure each card has its responsibilities discovered in previous step along with their collaborators.
3) Develop CRC cards for the following scenario:
A customer calls a mail order company. A salesperson answers and gets the customer information (including credit card and shipping address). The customer gives the item numbers for the items in the order and the quantity desired of each. For each item number given the salesperson says the item name, price, and checks if the item is in stock. When the customer says that they have no more items to order the salesperson gives the customer the order total, shipping estimate, and confirmation number.
Shipping Address | Salesperson
Credit Card |
Call Company |
Place Order |
Answer Phone | Customer
Gather Customer Info |
Report Item Info |
Check Item Availability |
Produce Order Receipt|
Items | Customer
Quantities | Salesperson
Link to this Page