Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are.
Published byModified over 4 years ago
Presentation on theme: "Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are."— Presentation transcript:
Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are created during some are destroyed during An active object is indicated by a narrow rectangle Focus of control Time is represented vertically down the diagram. Time moves forward as you go downwards Iteration is shown with a frame
Diagramming notation :sale s4:sale A sale object named s4 An unnamed sale object s4 An object named s4 Sale The class Sale
: register: sale : payment makePayment() payment() sd Make payment Sequence Diagram named Make payment Object is created
X : register: sale : payment makePayment() payment() sd Make Payment Object is destroyed
Message to ‘self’ A reflexive message : sale calcTotal() getTotal()
Iteration :Sale :SalesLineItem t=getTotal() st = getSubTotal() loop [I < numItems] loop is one of the keywords you can use to specify the nature of the fragment Note page 167 and use of alt
e.g. Singleton pattern Suppose CarMatchOffice works according to the Singleton Pattern. This means there must be at any time, at most, one instance of CarMatchOffice. The getInstance operation returns the single instance of the class. getInstance will create the instance if it does not already exist. > CarMatchOffice instance getInstance()
clientCarMatchOffice getInstance() alt Figure 17-21. Behaviour in Singleton Pattern :CarMatchOffice CarMatchOffice() Inst=CarMatchOffice() getInstance() [inst == null] [else] getAddress() When you ask for the instance of CarMatchOffice, there are two ways it can complete.
Examples 9.1-9.8 pages 179-182 Discusses construction of a sequence diagram Problem: create a sequence diagram to model the messages that occur when a Journey is created Figure 9-43 shows a diagram with CarSharer, Address, Journey, … Figure 6-11 shows the relationship of Address to Location Example 9-8 shows a scenario where the addresses are geolocated. Note that geolocate() is a method that manages this.
Use Case: Process Sale … Main Success Scenario 1.Customer arrives at POS checkout with goods and/or services to purchase 2.Cashier starts a new sale 3.Cashier enters item identifier 4.System records sale line item and presents item description, price, and running total. Price calculated from a set of price rules. Cashier repeats steps 3-4 until indicates done. 5.System presents total with taxes calculated 6.Cashier tells customer the total, and asks for payment. 7.Customer pays and System handles payment 8.System logs completed sale and sends sale and payment information to the external Accounting System and Inventory System. 9.System presents receipt 10.Customer leaves with receipt and goods Assignment 2: Q1: Construct a sequence diagram for a use case