UML Sequence Diagrams
During the requirements analysis phase, the system can be treated as a single "black box", which means that we can look at the system's behavior (what it does) without explaining how it does it. Read this section to see an example of a simplified trace diagram that shows only system input events. This is called a system sequence diagram.
13. Contracts for Some Operations in POST system
Tables 3.12 and 3.13 show examples contracts for “enterItem” operation and “makePayment” operation of the POST system.
Table 3.12: Contract for enterItem Operation Contract
|Responsibilities:||Enter (or record) sale of an item and add it to the sale. Display the item description and price.|
|Cross References:||System Functions: R1.1, R1.3, R1.9
Use Cases, Buy Items:
|Note:||Use superfast database access.|
|Exceptions:||If the UPC is not valid, indicate that it was an error.|
|Pre-conditions:||UPC is known to the system.|
Table 3.13: Contract for makePayment Operation
|Responsibilities:||Record the payment, calculate balance and print receipt|
|Cross References:||System Functions: R2.1
Use Cases: Buy Items
|Note:||Use superfast database access
|Post-conditions:||1. A Payment was created (instance creation).
2. Payment.amountTendered was set to amount (attribute medication).
3. The Payment was associated with the Sale (association formed)
4. The Sale was associated with the Store, to add it to the historical log of completed sales (association formed).