Software System EngineeringSlide 2Slide 3Interactions (1)Interactions (2)Messages (1)Messages (2)Messages (3)Sequencing (1)Sequencing (2)Flow of ControlProcedural SequenceFlat SequenceInteraction DiagramsFlow of Control by TimeFlow of Control by OrganizationCorrespondence between Class & Interaction DiagramsDiscussion Questions© M.E. Fayad 2000-2006SJSU -- CmpESoftware System Engineering Dr. M.E. Fayad, ProfessorComputer Engineering Department, Room #283I College of EngineeringSan José State UniversityOne Washington SquareSan José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S2 Interactions2Lesson 3-6a:Interactions© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S3 Interactions Lesson ObjectivesObjectives3 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© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S4 InteractionsIn UML, you can model the dynamic aspects of a system using interactionsUse interaction to model the flow of control within an operation, a class, a component, a use case, or the system as a whole4Interactions (1)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S5 InteractionsAn interaction is a behavior that comprises a set of messages exchanged among a set of objects within a context to accomplish a purpose5Interactions (2)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S6 InteractionsA message is a specification of a communication between objects that conveys information with the expectation that activity will ensureMessages–Can involve the invocation of an operation or the sending of a signal–May also encompass the creation and destruction of other objects6Messages (1)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S7 InteractionsWhen you pass a message, the result is an action. An Action may result in a change of stateIn 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 object7Messages (2)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S8 Interactions8Messages (3)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S9 InteractionsWhen an object passes a message to another, the receiving objects might in turn send a message to another objectThis stream of messages form a sequenceCan explicitly model the order of the messages by prefixing each message with a sequence number set apart by a colon separator9Sequencing (1)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S10 InteractionsDistinguish 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 D10Sequencing (2)© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S11 InteractionsSpecify 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., 11Flow of Control© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S12 Interactions12Procedural Sequence© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S13 Interactions13Flat Sequence© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S14 InteractionsTwo types of interaction diagrams in UML–Sequence diagram–Collaboration diagramThe two diagrams are isomorphic–Can take one and transform it into the other without loss of information14Interaction Diagrams© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S15 Interactions15Flow of Control by Time© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S16 Interactions16Flow of Control by Organization© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S17 Interactions17Correspondence between Class & Interaction Diagrams© M.E. Fayad 2000-2006SJSU – CmpE M.E. Fayad L3-6a-S18 Interactions1. 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. Interactionsb. Messagesc. Sequencingd. Flow of control18 Discussion
View Full Document