Presentation is loading. Please wait.

Presentation is loading. Please wait.

L26-S1 Interactions 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.

Similar presentations


Presentation on theme: "L26-S1 Interactions 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I."— Presentation transcript:

1 L26-S1 Interactions 2003 SJSU -- CmpE 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

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

3 L26-S3 Interactions 2003 SJSU – CmpE --- M.E. Fayad Lesson Objectives 3 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

4 L26-S4 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 4 Interactions (1)

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

6 L26-S6 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 6 Messages (1)

7 L26-S7 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 7 Messages (2)

8 L26-S8 Interactions 2003 SJSU – CmpE --- M.E. Fayad 8 Messages (3)

9 L26-S9 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 9 Sequencing (1)

10 L26-S10 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 10 Sequencing (2)

11 L26-S11 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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., 11 Flow of Control

12 L26-S12 Interactions 2003 SJSU – CmpE --- M.E. Fayad 12 Procedural Sequence

13 L26-S13 Interactions 2003 SJSU – CmpE --- M.E. Fayad 13 Flat Sequence

14 L26-S14 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 14 Interaction Diagrams

15 L26-S15 Interactions 2003 SJSU – CmpE --- M.E. Fayad 15 Flow of Control by Time

16 L26-S16 Interactions 2003 SJSU – CmpE --- M.E. Fayad 16 Flow of Control by Organization

17 L26-S17 Interactions 2003 SJSU – CmpE --- M.E. Fayad 17 Correspondence between Class & Interaction Diagrams

18 L26-S18 Interactions 2003 SJSU – CmpE --- M.E. Fayad 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 18 Discussion Questions


Download ppt "L26-S1 Interactions 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I."

Similar presentations


Ads by Google