Object Oriented Software Modeling and Design  CE 350 Abdel-Karim Al-Tamimi, Ph.D. [email_address] http://faculty.yu.edu.jo...
Overview <ul><li>Interaction Diagrams: </li></ul><ul><ul><li>Sequence Diagram </li></ul></ul><ul><ul><li>Collaboration Dia...
Interaction Diagrams <ul><li>Scenario modeling describes how the objects in a system interact with each other in a scenari...
Interaction Diagrams <ul><li>An interaction diagram can be used to model the collaborating objects in scenarios, showing t...
Interaction in UML <ul><li>Interaction diagram:  models the behavior of a group of objects that work together to achieve a...
Sequence Diagram <ul><li>Sequence diagrams  emphasize the sequence in which messages are exchanged </li></ul><ul><li>A seq...
Sequence Diagram: Example Al-Tamimi 2011 ©
Sequence Diagram: Example Al-Tamimi 2011 ©
Interaction Diagrams Notation in UML Al-Tamimi 2011 © Naming Format Notation An object of an unspecified class. A named ob...
Interaction Diagrams Notations in UML Al-Tamimi 2011 © Object Category  Description Graphical Notations  Actor Object An e...
Interaction Diagrams Notations in UML Al-Tamimi 2011 © Object Category  Description Graphical Notations  Boundary Object A...
UML Notations - Messages Al-Tamimi 2011 © Message Description Notation Procedure call  or other nested flow of control The...
UML Notations - Messages Al-Tamimi 2011 © Message Description Notation Return message  Message returned from the procedure...
UML Notations - Messages Al-Tamimi 2011 © Message Description Notation Lost Message The sender is known, the receiver is n...
Messages Notations Summary Al-Tamimi 2011 ©
Sequence Diagram: Lifeline and Activation Al-Tamimi 2011 © Object with Lifeline Object with Activation Activation:  show t...
Sequence Diagram: Branching Al-Tamimi 2011 © Conditional Message Transmission
Sequence Diagram: Iteration Al-Tamimi 2011 ©
Sequence Diagram: Alternate Message Reception Al-Tamimi 2011 ©
Sequence Diagram: Recursion Al-Tamimi 2011 ©
Example Al-Tamimi 2011 © Life line Creation Deletion
Example Al-Tamimi 2011 © Life line Activation iteration
Example Al-Tamimi 2011 © Life line collective iteration
Example Al-Tamimi 2011 © Concurrent Branch
Example Al-Tamimi 2011 ©
Example Al-Tamimi 2011 ©
Example Al-Tamimi 2011 ©
Tips and Tricks: Return Type <ul><li>Two ways to show return type of a message </li></ul>Al-Tamimi 2011 ©
Tips and Tricks: Object Destruction Al-Tamimi 2011 ©
Tips and Tricks: Iteration (looping) with A Condition Al-Tamimi 2011 ©
Tips and Tricks: Optional/Conditional Messages Al-Tamimi 2011 ©
Tips and Tricks: Conditional Messages (Mutual Exclusive) Al-Tamimi 2011 ©
Tips and Tricks: Looping Using Explicit Notations Al-Tamimi 2011 ©
Tips and Tricks: Looping Using Implicit Notations Al-Tamimi 2011 ©
Tips and Tricks: Nesting of Frames Al-Tamimi 2011 ©
Tips and Tricks: Relating Interaction Diagrams (Using Ref) / Interaction Occurrence Al-Tamimi 2011 ©
Tips and  Tricks: Polymorphic Message Al-Tamimi 2011 ©
Tips and Tricks: State Invariant Al-Tamimi 2011 ©
Tips and Tricks: State Invariant  Al-Tamimi 2011 ©
Tips and Tricks: Parallel Al-Tamimi 2011 ©
Tips and Tricks: Negative Operator/Invalid Operation Al-Tamimi 2011 ©
Tips and Tricks: Critical Region/Atomic Al-Tamimi 2011 ©
Tips and Tricks: Decomposition Al-Tamimi 2011 ©
Tips and Tricks: Continuations Al-Tamimi 2011 ©
Tips and Tricks: Continuations Al-Tamimi 2011 ©
Tips and Tricks: Hard Timing Requirements Al-Tamimi 2011 ©
Tips and Tricks: Break Fragment Al-Tamimi 2011 ©
Collaboration Diagram <ul><li>Collaboration  diagrams provide another way to model a scenario. </li></ul><ul><li>Shows the...
Example: Telephone System Al-Tamimi 2011 ©
Example: Message with Durations Al-Tamimi 2011 ©
Example: Printing Transcripts Al-Tamimi 2011 ©
Example: Printing Transcripts Al-Tamimi 2011 ©
Example: from Java IO API Al-Tamimi 2011 ©
Example: ATM Machine <ul><li>The  ATM  prompts the user to insert a card </li></ul><ul><li>The  user  inserts an  ATM  car...
Example: ATM Machine <ul><li>The  user  enters the amount to withdraw. </li></ul><ul><li>The  ATM  asks the bank consortiu...
ATM Machine: Part1 Al-Tamimi 2011 ©
ATM Machine-Part2 Al-Tamimi 2011 ©
Soft-Drink Vending Machine Sequence Diagram Al-Tamimi 2011 ©
Soft-Drink Vending Machine Collaboration Diagram Al-Tamimi 2011 ©
Example Al-Tamimi 2011 ©
Resources <ul><li>Chapter 4, Object-Oriented Technology: From diagram to code with Visual Paradigm for UML </li></ul><ul><...
Upcoming SlideShare
Loading in...5
×

Lecture07

2,860

Published on

Interaction Diagrams: Sequence and Collaboration Diagrams

Published in: Education
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total Views
2,860
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
207
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Lecture07

  1. 1. Object Oriented Software Modeling and Design CE 350 Abdel-Karim Al-Tamimi, Ph.D. [email_address] http://faculty.yu.edu.jo/altamimi Al-Tamimi 2011 ©
  2. 2. Overview <ul><li>Interaction Diagrams: </li></ul><ul><ul><li>Sequence Diagram </li></ul></ul><ul><ul><li>Collaboration Diagram </li></ul></ul>Al-Tamimi 2011 ©
  3. 3. Interaction Diagrams <ul><li>Scenario modeling describes how the objects in a system interact with each other in a scenario </li></ul><ul><li>A scenario is a sequence of events that occurs during one particular execution path within a use case of a system </li></ul><ul><li>Each event involves the interaction of objects passing messages between them </li></ul>Al-Tamimi 2011 ©
  4. 4. Interaction Diagrams <ul><li>An interaction diagram can be used to model the collaborating objects in scenarios, showing the </li></ul><ul><ul><li>objects involved in the scenario and </li></ul></ul><ul><ul><li>the messages sent and received by them </li></ul></ul><ul><li>These objects may be external or internal to the system </li></ul><ul><li>The messages represent the invocation of operations of the receiving objects </li></ul><ul><li>Two kinds of interaction diagrams: sequence diagrams and collaboration diagrams </li></ul><ul><li>Sequence diagrams focus on the time sequencing of messages </li></ul><ul><li>Collaboration diagrams focus on the structural organization of the links between collaborating objects </li></ul>Al-Tamimi 2011 ©
  5. 5. Interaction in UML <ul><li>Interaction diagram: models the behavior of a group of objects that work together to achieve a user goal </li></ul><ul><li>An interaction describes a series of messages that a selected set of participants exchange within a situation limited in time </li></ul><ul><li>The entire diagram represents one interaction, but can be using several messages </li></ul>Al-Tamimi 2011 ©
  6. 6. Sequence Diagram <ul><li>Sequence diagrams emphasize the sequence in which messages are exchanged </li></ul><ul><li>A sequence diagram helps us identify a set of collaborating objects involved in a scenario of a use case </li></ul><ul><li>A sequence diagram has two dimensions: the vertical dimension and the horizontal dimension </li></ul><ul><li>Object icons are placed horizontally at the top of the sequence diagram, and messages are passed between them </li></ul>Al-Tamimi 2011 ©
  7. 7. Sequence Diagram: Example Al-Tamimi 2011 ©
  8. 8. Sequence Diagram: Example Al-Tamimi 2011 ©
  9. 9. Interaction Diagrams Notation in UML Al-Tamimi 2011 © Naming Format Notation An object of an unspecified class. A named object of a specified class. An unnamed object of a specified class.
  10. 10. Interaction Diagrams Notations in UML Al-Tamimi 2011 © Object Category Description Graphical Notations Actor Object An external entity that interacts with the system Entity Object   An object that models the data in the system. It often represents an object in the problem domain
  11. 11. Interaction Diagrams Notations in UML Al-Tamimi 2011 © Object Category Description Graphical Notations Boundary Object An object that handles the communication between actor objects and the system. Control Object   An object that models the flow of control and functionality that do not naturally belong to entity objects or boundary objects.
  12. 12. UML Notations - Messages Al-Tamimi 2011 © Message Description Notation Procedure call or other nested flow of control The message sender waits for the completion of the procedure call of the message receiver (waits for a reply) Asynchronous communication The sender dispatches a message and immediately continues with the next step of execution (there are no reply arrows)
  13. 13. UML Notations - Messages Al-Tamimi 2011 © Message Description Notation Return message Message returned from the procedure call Message with travel delay The message will take a significant amount of time to arrive at the receiving object. (This is only used in sequence diagrams.)
  14. 14. UML Notations - Messages Al-Tamimi 2011 © Message Description Notation Lost Message The sender is known, the receiver is not Found Message The sender is unknown, and the receiver is known Create Message A message creates a new instance
  15. 15. Messages Notations Summary Al-Tamimi 2011 ©
  16. 16. Sequence Diagram: Lifeline and Activation Al-Tamimi 2011 © Object with Lifeline Object with Activation Activation: show the duration of the execution of a method in response to a message
  17. 17. Sequence Diagram: Branching Al-Tamimi 2011 © Conditional Message Transmission
  18. 18. Sequence Diagram: Iteration Al-Tamimi 2011 ©
  19. 19. Sequence Diagram: Alternate Message Reception Al-Tamimi 2011 ©
  20. 20. Sequence Diagram: Recursion Al-Tamimi 2011 ©
  21. 21. Example Al-Tamimi 2011 © Life line Creation Deletion
  22. 22. Example Al-Tamimi 2011 © Life line Activation iteration
  23. 23. Example Al-Tamimi 2011 © Life line collective iteration
  24. 24. Example Al-Tamimi 2011 © Concurrent Branch
  25. 25. Example Al-Tamimi 2011 ©
  26. 26. Example Al-Tamimi 2011 ©
  27. 27. Example Al-Tamimi 2011 ©
  28. 28. Tips and Tricks: Return Type <ul><li>Two ways to show return type of a message </li></ul>Al-Tamimi 2011 ©
  29. 29. Tips and Tricks: Object Destruction Al-Tamimi 2011 ©
  30. 30. Tips and Tricks: Iteration (looping) with A Condition Al-Tamimi 2011 ©
  31. 31. Tips and Tricks: Optional/Conditional Messages Al-Tamimi 2011 ©
  32. 32. Tips and Tricks: Conditional Messages (Mutual Exclusive) Al-Tamimi 2011 ©
  33. 33. Tips and Tricks: Looping Using Explicit Notations Al-Tamimi 2011 ©
  34. 34. Tips and Tricks: Looping Using Implicit Notations Al-Tamimi 2011 ©
  35. 35. Tips and Tricks: Nesting of Frames Al-Tamimi 2011 ©
  36. 36. Tips and Tricks: Relating Interaction Diagrams (Using Ref) / Interaction Occurrence Al-Tamimi 2011 ©
  37. 37. Tips and Tricks: Polymorphic Message Al-Tamimi 2011 ©
  38. 38. Tips and Tricks: State Invariant Al-Tamimi 2011 ©
  39. 39. Tips and Tricks: State Invariant Al-Tamimi 2011 ©
  40. 40. Tips and Tricks: Parallel Al-Tamimi 2011 ©
  41. 41. Tips and Tricks: Negative Operator/Invalid Operation Al-Tamimi 2011 ©
  42. 42. Tips and Tricks: Critical Region/Atomic Al-Tamimi 2011 ©
  43. 43. Tips and Tricks: Decomposition Al-Tamimi 2011 ©
  44. 44. Tips and Tricks: Continuations Al-Tamimi 2011 ©
  45. 45. Tips and Tricks: Continuations Al-Tamimi 2011 ©
  46. 46. Tips and Tricks: Hard Timing Requirements Al-Tamimi 2011 ©
  47. 47. Tips and Tricks: Break Fragment Al-Tamimi 2011 ©
  48. 48. Collaboration Diagram <ul><li>Collaboration diagrams provide another way to model a scenario. </li></ul><ul><li>Shows the roles of objects and associations of objects in an instance of collaboration </li></ul><ul><li>Focus on structures of the objects rather than temporal sequence of operations </li></ul><ul><li>In a collaboration diagram, each object is represented by an object icon, and links are used to indicate communication paths on which messages are transmitted </li></ul><ul><li>Messages are presented in the same way as those in a sequence diagram; in fact, sequence diagrams and collaboration diagrams are semantically equivalent </li></ul>Al-Tamimi 2011 ©
  49. 49. Example: Telephone System Al-Tamimi 2011 ©
  50. 50. Example: Message with Durations Al-Tamimi 2011 ©
  51. 51. Example: Printing Transcripts Al-Tamimi 2011 ©
  52. 52. Example: Printing Transcripts Al-Tamimi 2011 ©
  53. 53. Example: from Java IO API Al-Tamimi 2011 ©
  54. 54. Example: ATM Machine <ul><li>The ATM prompts the user to insert a card </li></ul><ul><li>The user inserts an ATM card </li></ul><ul><li>The ATM prompts the user to input the PIN </li></ul><ul><li>The user enters the PIN </li></ul><ul><li>The ATM asks the bank consortium to verify the ATM card number and PIN </li></ul><ul><li>The bank consortium verifies the ATM card number and PIN with bank </li></ul><ul><li>The bank notifies the bank consortium that the PIN is correct </li></ul><ul><li>The bank consortium notifies the ATM the PIN is correct </li></ul><ul><li>The ATM prompts the user to select a service </li></ul><ul><li>The user selects the withdraw cash service </li></ul><ul><li>The ATM prompts the user to enter the amount to withdraw </li></ul>Al-Tamimi 2011 ©
  55. 55. Example: ATM Machine <ul><li>The user enters the amount to withdraw. </li></ul><ul><li>The ATM asks the bank consortium to process the request. The bank consortium forwards the request to bank. </li></ul><ul><li>The bank confirms the successful execution of the request to the bank consortium which in turn notifies the ATM that the request has been approved </li></ul><ul><li>The ATM displays the successful transaction screen, ejects card and then dispenses cash requested </li></ul><ul><li>The ATM shows the main menu to the user for selecting the next service </li></ul>Al-Tamimi 2011 ©
  56. 56. ATM Machine: Part1 Al-Tamimi 2011 ©
  57. 57. ATM Machine-Part2 Al-Tamimi 2011 ©
  58. 58. Soft-Drink Vending Machine Sequence Diagram Al-Tamimi 2011 ©
  59. 59. Soft-Drink Vending Machine Collaboration Diagram Al-Tamimi 2011 ©
  60. 60. Example Al-Tamimi 2011 ©
  61. 61. Resources <ul><li>Chapter 4, Object-Oriented Technology: From diagram to code with Visual Paradigm for UML </li></ul><ul><li>UML 2 Certification Guide </li></ul><ul><li>http://www.informit.com/articles/article.aspx?p=360441&seqNum=5 </li></ul><ul><li>UML-2 in a nutshell, chapter 10 </li></ul><ul><li>http://www.tracemodeler.com/gallery/ </li></ul><ul><li>http://www.agilemodeling.com/artifacts/communicationDiagram.htm </li></ul>Al-Tamimi 2011 ©
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×