2. Identifying Classes
• Perform a “grammatical parse” on a
description of the system to be built.
• Classes are determined by underlining each
noun or noun clause and entering it in a
simple list –these are candidate classes.
• Synonyms should be noted.
3. Identifying Classes
• Use Case Scenario
Customer confirms items in shopping cart.
Customer provides payment and address to
process sale. System validates payment and
responds by confirming order and provides
order number that Customer can use to check
on order status. System will send Customer a
copy of order details by email.
4. Identifying Classes
• Use Case Scenario
Customer confirms items in shopping cart.
Customer provides payment and address to
process sale. System validates payment and
responds by confirming order and provides
order number that Customer can use to check
on order status. System will send Customer a
copy of order details by email.
5. Identifying Classes
• Noun List
Customer Order
Item Order Number
Shopping cart Order Status
Payment Order Details
Address Email
Sale System
7. Identifying Responsibilities
• Use Case Scenario
Customer confirms items in shopping cart. Customer
provides payment and address to process sale.
System validates payment and responds by
confirming order and provides order number that
Customer can use to check on order status. System
will send Customer a copy of order details by email.
8. Identifying Responsibilities
• Use Case Scenario
Customer confirms items in shopping cart. Customer
provides payment and address to process sale.
System validates payment and responds by
confirming order and provides order number that
Customer can use to check on order status. System
will send Customer a copy of order details by email.
Confirms items Confirm order
Provide payment and address Provide order number
Process sale Check order status
Validate payment Send order details email
9. Assigning Responsibilities
get status
Confirms items
Provide payment and address
Process sale
Validate payment
Confirm order
Provide order number
Check order status
Send order details email
Paymen
t
Shopping
Cart
ItemCustomer
Order Email
Display totals
Set payment and
Address detail
Process order
Validate payment
Confirm order
Get order number
Get status
Create order confirmation email
Send email
✓
✓
✓
✓
✓
✓
✓
✓
10. CRC Cards
• An index card that is use to represent
– A class
– the responsibilities of classes and
– the interaction between the classes.
• An informal approach to object oriented modeling.
• The cards are created through scenarios, based on the
system requirements, that model the behavior of the
system.
• The name CRC comes from Class, Responsibilities, and
Collaborators which the creators found to be the
essential dimensions of object oriented modeling.
11. CRC Cards
• Class Responsibility Collaborator (CRC cards) are a
brainstorming tool used in the design of object-
oriented software.
14. Payment
Responsibility Collaborator
Set payment
and
Address detail
Order
Validate
payment
Customer
Responsibility Collaborato
r
Shopping
Cart
Item
Shopping Cart
Responsibility Collaborato
r
Display Totals Customer
Item
Item
Responsibility Collaborato
r
Shopping
Cart
Order
Email
Responsibility Collaborator
Send email Order
Order
Responsibility Collaborato
r
Process order Customer
Confirm order Item
Get order
number
Payment
Get status Email
Create order
confirmation
email
15. Payment
Responsibility Collaborator
Set payment
and
Address detail
Order
Validate
payment
Customer
Responsibility Collaborato
r
Shopping
Cart
Item
Shopping Cart
Responsibility Collaborato
r
Display Totals Customer
Item
Item
Responsibility Collaborato
r
Shopping
Cart
Order
Email
Responsibility Collaborator
Send email Order
Order
Responsibility Collaborato
r
Process order Customer
Confirm order Item
Get order
number
Payment
Get status Email
Create order
confirmation
email
16. Why uses CRC cards?
• They are portable. No computers are required
so they can be used anywhere.
• The allow the participants to experience first
hand how the system will work. No computer
tool can replace the interaction that happens by
physically picking up the cards and playing the
roll of that object.
• The are a useful tool for teaching people the
object-oriented paradigm.
Hinweis der Redaktion
Not all of these will be behaviors. Some these will be combined, some of these will be splitted, some of are unnecessary and some of are replaced by something.
But where (in which objects) these responsibilities are belong?
Do not think about official method names. Just use the verb phrase