1 / 17

What are Sequence Diagrams?

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.

Download Presentation

What are Sequence Diagrams?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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? 8:M8 Jonathon 3:M3 5:M5 1:M1 4:M4 10:M10 9:M9 7:M7 Dale 2:M2 6:M6 Michelle Collaboration Diagram is too cluttered and confusing

  3. Sequence Diagram Jonathon Dale Michelle M1 M2 M3 M4 M5 M6 M7 M8 M9 M10

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

  5. :HOMEPAGE :LOGIN PAGE display()

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

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

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

  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. The Cell phone Example :Speaker :Cell Radio :Dialer :Button send:Button :Display The Object Diagram for Cell Telephone System

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

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

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

  14. 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?

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

  16. 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

More Related