Lecture Notes

advertisement
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Application of Robustness Diagram for
Perform Order Entry Use Case
The system displays an Order Entry window. The Assistant Trader (AT) first
selects the investment involved in the order from a list of available investments.
The AT then enters the ticket number that appears on the paper ticket for the
order and also specifies whether the trade is a buy or a sell. The system verifies
that the ticket number is not a duplicate, if the number is unique, the system
creates a new order. When the AT chooses to proceed, the system brings up
the appropriate trade entry window, which the AT uses to enter the primary data
for the trade.
Alternate courses:
If the ticket number already exists in the Trade List, the system prompts the AT
to enter a new ticket number.
If the investment associated with the order does not appear in the Investment
List, the system invokes the Define Investment use case.
Robustness Diagram for Perform Order Entry Use Case
1
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Application of Robustness Diagram for
Enter Buy Trade Use Case
The system creates a new trade with the ticket number attached to the order. It also
brings up a Bond Trade Entry window. The AT uses this window to enter the
appropriate values for the trade. When the AT chooses to submit the trade, the
system validates both general trade values and bond-specific values (for instance, it
makes sure the coupon rate is "reasonable") before processing the trade. If the
grade passes all validation tests, the system submits it to the Trade Queue, from
which the trade is later sent to the Back Office system to be cleared and processed
further.
Alternate Course
If the validation fails, notify the user, highlight the erroneous values, and get new
values from the user.
Robustness Diagram for Entry Buy Trade Use Case
2
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Larman’s Conceptual model for the Point of Sale System
Precondition:
What relevant objects and associations must exist prior to a Sale?
Postcondition:
When a Sale is successful,
what objects are created or deleted?
what links are made or broken?
what attributes are modified?
3
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Name:
Responsibilities:
enterItem (upc:number,quantity:integer)
1.
2.
Pre-conditions
Record sale of an item and add it to the sale.
Display the item description and price.
UPC is known to the system
Post Conditions:
Exceptions:
If UPC is not valid, indicate an error
Obj. Created /
Deleted Link
Formed / Broken
Attribute Modified
Details:
Instance Creation
If a new sale, a Sale was created
Link formed
If a new sale, the new Sale was associated with the POST
Instance Creation
A SalesLineItem was created
Link formed
A SalesLineItem was associated with the Sale
Attribute modified
SalesLineItem.quantity was set to quantity
Link formed
SalesLineItem associated with a ProductSpecification
based on UPC match.
4
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Name:
endSale( )
Responsibilities: Record that it is the end of entry of sale items and
display sale total
Obj. Created / Deleted
Link Formed / Broken
Attribute Modified
Attribute Modified
Name:
Details:
Sale.isComplete was set to true
makePayment(amount:Number)
Responsibilities: Record the payment, calculate balance and print receipt
Obj. Created / Deleted
Link Formed / Broken
Attribute Modified
Details:
Instance Creation
Payment was created
Attribute Modified
Payment.amountTendered was set to amount
Link formed
Payment linked with Sale
Link formed
Sale linked with Store, to add it to historical log of
completed sales
5
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Use Case:
Start Up
Actors:
Manager
Type:
Primary
Description: A Manager powers on a POST in order to prepare it for use
by Cashiers. The Manager validates that the date and time
are correct, after which the system is ready for Cashier use.
Name:
startUp ( )
Responsibilities: Initialize the system
Obj. Created / Deleted
Link Formed / Broken
Attribute Modified
Details:
Instance Creation
Store, POST, Product Catalog and
Product Specifications
Link formed
Product Catalog with Product Specifications
Link formed
Store with Product Catalog
Link formed
Store was linked with POST
Link formed
Post with Product Catalog
6
SE 430 -- Object-oriented Modeling
Responsibilities, Contracts, Interaction Diagrams
Self-delegation / recursion -- shown by an object sending a message to itself
and a rectangle overlapping its current activity
7
Download