1 / 25

UML Sequence Diagram

Concepts & Notations. UML Sequence Diagram. Acknowledgements. The material in this tutorial is based in part on: The Unified Modeling Language Reference Manual, 2 nd edition , by James Rumbaugh , Ivar Jacobson, and Grady Booch. Interaction View Interaction Diagram Sequence Diagram

dafydd
Download Presentation

UML Sequence Diagram

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. Concepts & Notations UML Sequence Diagram

  2. Acknowledgements • The material in this tutorial is based in part on: • The Unified Modeling Language Reference Manual, 2nd edition, by James Rumbaugh, Ivar Jacobson, and Grady Booch

  3. Interaction View Interaction Diagram Sequence Diagram Examples UML Sequence Diagram

  4. Interaction View • Objects interact to implement behavior • Two ways to describe interaction • focus on individual objects (state machine) • focus on interactions of a collection of cooperating objects (interaction view) • Provides a more holistic view of the behavior of a set of objects

  5. Interaction Diagram • Collaboration Diagram • Emphasizes structural relations between objects • Sequence Diagram • Illustrates how objects interacts with each other • Emphasizes time ordering of messages

  6. book:Book :BookCopy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) Sequence Diagram member:LibraryMember

  7. book:Book :BookCopy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) Sequence Diagram X-Axis (roles) member:LibraryMember Y-Axis (time)

  8. book:Book :BookCopy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) Sequence Diagram X-Axis (roles) member:LibraryMember head symbol Y-Axis (time) life line

  9. book:Book :BookCopy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) Sequence Diagram X-Axis (roles) member:LibraryMember head symbol Y-Axis (time) activation double line life line

  10. bDay:Date Object • Naming • syntax • [instance Name]:[class Name] • Life line • represents the object’s life during the interaction

  11. Object • Active Object • holds the root of a stack executions • has its own thread of control • Passive Object • objects that are called by an active object • receive control only when called

  12. : Queue actor1 : … actor2 : … Object active object passive object active object pull pull

  13. Message • An interaction between two objects • operation call • signaling • RPC • An arrow between the life lines of two objects • Labeled with • name • arguments • control information

  14. : Queue actor1 : … actor2 : … Message pull pull message message

  15. Synchronous Message • The routine that handles the message is completed before the caller resumes execution synchronous message :A :B doYouUnderstand() Caller Blocked yes return (optional)

  16. Creation Message • An object may create another object via a create() message create message Preferred old:A create() :B

  17. old:A new:B destroy() Destruction Message • An object may destroy another object via a destroy() message

  18. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  19. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  20. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  21. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  22. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  23. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  24. :PrintServer :Queue :PrinterProxy job=dequeue() Examples Client print(doc,client) enqueue(job) Repeated forever with 1 min interludes [job]print(job.doc) status [job] done(status)

  25. Review • Time on y-axis, roles on x-axis • Activation bars represent executions of procedures • Active objects have bars • Solid arrowheads: synchronous • Stick arrowheads: asynchronous • Dashed message lines: return :PrintServer

More Related