1 / 18

Advanced Object-Oriented Analysis & Design

Learn about interactions, messages, and sequencing in object-oriented analysis and design. Understand how to model the flow of control in a system and the correspondence between classes and interaction diagrams.

eosburn
Télécharger la présentation

Advanced Object-Oriented Analysis & Design

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. Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad SJSU -- CmpE

  2. Lesson 26: Interactions 2 SJSU – CmpE --- M.E. Fayad

  3. Lesson Objectives • Define Interactions, Messages, Sequencing • Understand flow of control: • Flow of control by time • Flow of control by organization • Show the correspondence between classes and interaction diagrams 3 SJSU – CmpE --- M.E. Fayad

  4. In UML, you can model the dynamic aspects of a system using interactions Use interaction to model the flow of control within an operation, a class, a component, a use case, or the system as a whole Interactions (1) 4 SJSU – CmpE --- M.E. Fayad

  5. An interaction is a behavior that comprises a set of messages exchanged among a set of objects within a context to accomplish a purpose Interactions (2) 5 SJSU – CmpE --- M.E. Fayad

  6. A message is a specification of a communication between objects that conveys information with the expectation that activity will ensure Messages Can involve the invocation of an operation or the sending of a signal May also encompass the creation and destruction of other objects Messages (1) 6 SJSU – CmpE --- M.E. Fayad

  7. When you pass a message, the result is an action. An Action may result in a change of state In UML, the following actions are possible: Call – invokes an operation on an object Return – returns a value to the caller Send – Sends a signal to an object Create – Creates an object Destroy – Destroys an object Messages (2) 7 SJSU – CmpE --- M.E. Fayad

  8. Messages (3) 8 SJSU – CmpE --- M.E. Fayad

  9. When an object passes a message to another, the receiving objects might in turn send a message to another object This stream of messages form a sequence Can explicitly model the order of the messages by prefixing each message with a sequence number set apart by a colon separator Sequencing (1) 9 SJSU – CmpE --- M.E. Fayad

  10. Distinguish one flow of control from another by prefixing a message’s sequence number with the name of the process or thread E.g., D5 : ejectHatch (3) The operation ejectHatch is dispatched as the fifth message in the sequence rooted by the process or thread named D Sequencing (2) 10 SJSU – CmpE --- M.E. Fayad

  11. Specify a procedural or nested flow of control using a filled solid arrowhead E.g., Specify a flat flow of control using a stick arrowhead E.g., Flow of Control 11 SJSU – CmpE --- M.E. Fayad

  12. Procedural Sequence 12 SJSU – CmpE --- M.E. Fayad

  13. Flat Sequence 13 SJSU – CmpE --- M.E. Fayad

  14. Two types of interaction diagrams in UML Sequence diagram Collaboration diagram The two diagrams are isomorphic Can take one and transform it into the other without loss of information Interaction Diagrams 14 SJSU – CmpE --- M.E. Fayad

  15. Flow of Control by Time 15 SJSU – CmpE --- M.E. Fayad

  16. Flow of Control by Organization 16 SJSU – CmpE --- M.E. Fayad

  17. Correspondence between Class & Interaction Diagrams 17 SJSU – CmpE --- M.E. Fayad

  18. 1. Define: Interaction, messages, and sequencing. 2. Describe a flow of control by time with an illustrated example. 3. Describe a flow of control by time with an illustrated example. 4. Use stability model to model the following: a. Interactions b. Messages c. Sequencing d. Flow of control Discussion Questions 18 SJSU – CmpE --- M.E. Fayad

More Related