Presentation is loading. Please wait.

Presentation is loading. Please wait.

What are Sequence Diagrams? Collaboration Diagrams allow designer to specify message flow between collaborating objects –Focus on relationship between.

Similar presentations


Presentation on theme: "What are Sequence Diagrams? Collaboration Diagrams allow designer to specify message flow between collaborating objects –Focus on relationship between."— Presentation transcript:

1 What are Sequence Diagrams? Collaboration Diagrams allow designer to specify message flow between collaborating objects –Focus on relationship between objects Sequence Diagrams contain the same information as Collaboration Diagrams –Focus on sequence, not relationship

2 What if there are many object interactions? Jonathon Michelle Dale 1:M1 4:M4 10:M10 Collaboration Diagram is too cluttered and confusing 9:M9 7:M7 6:M6 2:M2 3:M3 5:M5 8:M8

3 Sequence Diagram JonathonMichelleDale M1 M3 M2 M4 M5 M6 M7 M8 M9 M10

4 Sequence Diagrams: An Example Logging into a system :CUSTOMER:HOMEPAGE clickLogin()

5 display() :LOGIN PAGE

6 :CUSTOMER:LOGIN PAGE Enter user ID and Password clickOK()

7 :CUSTOMER:HOMEPAGE :LOGIN PAGE :ACCOUNT validateLogin(userID,password ) loginOK() display() «destroy» X

8 :CUSTOMER:HOMEPAGE :LOGIN PAGE :ACCOUNT validateLogin(userID,password ) loginOK() display() «destroy» X clickLogin() display() Enter user ID and Password clickOK() «create»

9 How about an ATM machine? Basic Course (UC12: withdraw money) –Insert Card –Enter PIN –Select “Withdrawal” from Main Menu –Enter Amount –Take cash –Take card

10

11 The Cell phone Example :Dialer :Cell Radio send:Button :Speaker :Display The Object Diagram for Cell Telephone System :Button

12 :Dialer :Cell Radio send:Button :Speaker :Display The Collaboration Diagram for Cell Telephone System :Button 1*: Digit 1.1: Display Digit 1.2: Emit Tone 2: Send 2.1: Connect 2.1.1: In Use

13 Cell Phone Sequence Diagram digit:Button:Digitbutton Adapter :Dialer:Display:Speaker Buttonpressed() Digit(code) DisplayDigit(code) EmitTone(code) send:Button :Sendbutton Adapter :Dialer:Cellradio:Display Buttonpressed() Send() Connect(pno) InUse()

14 Create and Destroy :Dialer:CellRadio Connect(pno) Create() :Connection Destroy() Connect(pno) ConnectionMade() End(pno) Disconnect(pno) Disconnected() X

15 Race Conditions Occurs when single object concurrently receives message from competing clients Consider an incoming call on a cell phone –Cell radio detects incoming call and sounds ringer –Cell radio also informs Dialer that a call is coming in and places the dialer in a special state –In this state, the Send button, when pressed, answers the call –The send button has different meanings in different circumstances (what is this called?) But what happens if the incoming call comes when a outgoing call is being made?

16 Race Condition :Sendbutton Adapter :Dialer:Cellradio:Ringer Answer() :Sendbutton Adapter :Dialer:Cellradio:Ringer Send() Connect(pno) Send() Incoming call() ring()

17 Try One A sales clerk starts a new transaction He/she enters the transaction details (account# and product) System retrieves product and customer details, and associated discount Clerk confirms transaction The system updates receivables accounts System informs clerk that transaction is complete


Download ppt "What are Sequence Diagrams? Collaboration Diagrams allow designer to specify message flow between collaborating objects –Focus on relationship between."

Similar presentations


Ads by Google