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 case’s flow of events. An interaction diagram, as an instance of flow of events, shows a scenario how an actor actor’s interaction with the use case is processed

  1. Draw the following use case diagram (Figure 7.12 of the USDP book)
  2.   

  3. Select "Pay Invoice" use case in the left browser window and open its specification. In the documentation window of the specification, enter the following specification of flow of events for the use case (page 156 of the USDP book). (You may try copy the text below and paste it to Rose.)
  4. 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.

     

  5. Select "Pay Invoice" use case in the left browser window and create a new sequence diagram "pay-invoice" under the use case.
  6. In the following steps, according to the use case’s flow of events, you will draw a sequence diagram specifying the scenario that an buyer Joe pays an invoice to a seller John.

  7. For 1a, Drag the Buyer actor to the diagram and give the actor name "Joe". Create an object "system". Let Joe send a message "browse" to the system.
  8. For 1b, Create an object "joe01" of class "Invoice". Let the system send a message "getInvoice("Joe", 1)" to joe01 object.
  9. 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.

  10. For 2a, let Joe send a message "schedulePayment(1)" to system to schedule the payment for invoice01.
  11. For 2b, create an object "joeSchedule" of class "PaySchedule". Let system send a message "checkDuplicate(1)" to joeschedule.
  12. For 2c, create an object "joe01Request" of class "PayRequest". Let system send a message "create" to joe01Request.
  13. For 3a, in an action separated from this for 2a-2b, let system send a message "makePayment("joe", 1)" to itself.
  14. For 3b, let system send message "getRequest(1)" to joe01Request.
  15. 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.

  16. For 3c, let system send a message "paymentDone(1)" to actor Joe.
  17. Drag actor "Seller" to the right of the diagram and name it "John". Let system send a message "invoicePaid("Joe" 1).

  18. For 3d, let system send a message "calculateFee() to itself. Then let system send a message "reduce(fee)" to joeAccount.
  19. Up to now, you have completed the sequence diagram specifying the scenario that an buyer Joe pays an invoice to a seller John.

  20. In this step, you generate an equivalent collaboration diagram from the above sequence diagram, by selecting menu Browse->Create collaboration diagram.

 

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.