lecture9 UML2

lecture9 UML2 - Unified Modeling Language II Interaction...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Unified Modeling Language II
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Interaction Diagrams Interaction diagrams model the behavior of use cases by describing the way groups of objects interact to complete the task Sequence diagrams and Collaboration diagrams When to use Interaction diagrams are used when you want to model the behavior of several objects in a use case They demonstrate how the objects collaborate for the behavior
Background image of page 2
Sequence Diagram The main purpose of a sequence diagram is to define event sequences that result in some desired outcome They demonstrate the behavior of objects in a use case by describing the objects and the messages they pass The focus is less on messages themselves and more on the order in which messages occur The diagram conveys this information along the horizontal and vertical dimensions: the vertical dimension shows, top down, the time sequence of messages/calls as they occur, and the horizontal dimension shows, left to right, the object instances that the messages are sent to
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
An Example for Sequence Diagram The example shows an object of class 1 start the behavior by sending a message to an object of class 2. Messages pass between the different objects until the object of class 1 receives the final message
Background image of page 4
Lifelines (1/2) When drawing a sequence diagram, lifeline notation elements are placed across the top of the diagram Lifelines represent either roles or object instances that participate in the sequence being modeled Lifelines are drawn as a box with a dashed line descending from the center of the bottom edge The lifeline's name is placed inside the box
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lifelines (2/2) Instance Name : Class Name
Background image of page 6
Messages (1/5) The first message of a sequence diagram always starts at the top and is typically located on the left side of the diagram for readability. Subsequent messages are then added to the diagram slightly lower then the previous message Sending a Message draw a line to the receiving object with a solid arrowhead (if a synchronous call operation) or with a stick arrowhead (if an asynchronous signal) The message/method name is placed above the arrowed line The message that is being sent to the receiving object
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Messages (2/5)
Background image of page 8
Messages (3/5) Return Message The return messages are optional A return message is drawn as a dotted line with an open arrowhead back to the originating lifeline, and above this dotted line you place the return value from the operation
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Messages (4/5)
Background image of page 10
Message (5/5) To draw an object calling itself, you draw a message as you would normally, but instead of connecting it to another object, you connect the message back to the object itself
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Guards (1/2) When modeling object interactions, there will be times when a condition must be met for a message to be sent to the object Guards are used throughout UML diagrams to control flow To draw a guard on a sequence diagram in UML, you placed the guard element above the message line being guarded and in front of the message name
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/27/2008 for the course COMS 319 taught by Professor Jiang during the Spring '08 term at Iowa State.

Page1 / 46

lecture9 UML2 - Unified Modeling Language II Interaction...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online