CS3013 Software Engineering II
Lab 2
Dates: Feb. , 2001
In this lab, you will practice deriving interaction diagrams (i.e. sequence and collaboration diagrams) from a use cases flow of events. An interaction diagram, as an instance of flow of events, shows a scenario how an actor actors interaction with the use case is processed
Precondition: The buyer has received the goods or services ordered and at least one invoice from the system. The buyer now plans to schedule the invoice(s) for payment.
Flow of Events
(1) The buyer invokes the use case by beginning to (a) browse the invoices received by the system. (b)The system checks that the content of each invoice is consistent with order confirmations received earlier (as part of the Confirmation Order use case) and somehow indicates this to the buyer. The order confirmation describes which items will be delivered, when, where, and at what price.
(2) (a) The buyer decides to schedule an invoice for payment by the bank, and (c) the system generates a payment request to transfer money to the seller's account. (b) Note that a buyer may not schedule the same invoice for payment twice.
(3) Later, if there is enough money in the buyer's account, (a) a payment transaction is made on the scheduled date. (b) During the transaction, money is transferred from the buyer's account to the seller's account, as described by the abstract use case Perform Transaction (which is used by Pay Invoice). (c) The buyer and the seller are notified to the result of the transaction. (d) The bank collects a fee for the transaction, which is withdrawn from the buyer's account by the system.
In the following steps, according to the use cases flow of events, you will draw a sequence diagram specifying the scenario that an buyer Joe pays an invoice to a seller John.
Create an object "orderConfirmation" and attach to it a note "from Order Confirmation use case". Let the system send a message "getConfirmation("Joe") to orderConfirmation
Let the system send a message "checkConsistence" to itself.
Let the system send a message "checkOk" to Joe.
Create an object "joeAccount" of class "BuyerAccount". Let system send a message "getAccount()" to joeAccount.
Create an object "johnAccount" of class "SellerAccount". Let system send a message "getAccount()" to johnAccount.
Create an object "performTransaction" and attach a note "from Perform Transaction use case" to it. Let system send a message "transfer(joeAccount, johnAccount, amount)" to performTransaction.
Drag actor "Seller" to the right of the diagram and name it "John". Let system send a message "invoicePaid("Joe" 1).
Up to now, you have completed the sequence diagram specifying the scenario that an buyer Joe pays an invoice to a seller John.
Before you leave the lab, ask the lab instructor to check your diagrams, and save your model to a floppy and submit it to the lab instructor.