Sequence Diagrams PDF
Sequence Diagrams PDF
Massimo Felici
Massimo Felici
Sequence Diagrams
c 20042011
Massimo Felici
Sequence Diagrams
c 20042011
Massimo Felici
Sequence Diagrams
c 20042011
Massimo Felici
Sequence Diagrams
c 20042011
Notations
Sequence Diagrams
Frames Lifelines Messages and Focus Control Combined Fragments Interaction Occurrences States Continuations Textual Annotation Tabular Notation
Massimo Felici
Sequence Diagrams
c 20042011
Frames
Massimo Felici
Sequence Diagrams
c 20042011
Lifelines
Sequence diagrams are organised according to time Each participant has a corresponding lifeline Each vertical dotted line is a lifeline, representing the time that an object exists Lifeline name:
[connectable-element-name][[selector]][:class-name][decomposition]
Massimo Felici
Sequence Diagrams
c 20042011
Examples
Lifelines Names
Syntax seoclecturer seoclecturer:Lecturer :Lecturer lecturer[i] s ref sd3 Explanation An object named secolecturer An object named seoclecturer of class Lectuer An anonymous object of class Lecturer The object lecturer that is selected by the index value i A subsystem s whose internal interaction is shown in sequence diagram sd3 (decomposition) The connectable element that owns the interaction shown in the sequence diagram
self
Massimo Felici
Sequence Diagrams
c 20042011
Massimo Felici
Sequence Diagrams
c 20042011
Messages
Messages (or signals) on a sequence diagram are specied using an arrow from the participant (message caller) that wants to pass the message to the participant (message receiver) that is to receive the message A Message (or stimulus) is represented as an arrow going from the sender to the top of the focus of control (i.e., execution occurrence) of the message on the receivers lifeline
Massimo Felici
Sequence Diagrams
c 20042011
10
Massimo Felici
Sequence Diagrams
c 20042011
11
Massimo Felici
Sequence Diagrams
c 20042011
Argument syntax
[parameter-name=] argument-value| attribute=out-parameter-name [:argument-value] | -
Example
12
Massimo Felici
Sequence Diagrams
c 20042011
13
Sequence Fragments
UML 2.0 introduces sequence (or interaction) fragments Sequence fragments make it easier to create and maintain accurate sequence diagrams A sequence fragment is represented as a box, called a combined fragment, which encloses a portion of the interactions within a sequence diagram The fragment operator (in the top left cornet) indicates the type of fragment Fragment types: ref, assert, loop, break, alt, opt, neg
Massimo Felici
Sequence Diagrams
c 20042011
Notation
14
Sequence Fragments
Massimo Felici
Sequence Diagrams
c 20042011
15
sd
Massimo Felici
Sequence Diagrams
c 20042011
Example
16
Interaction Frames
Massimo Felici
Sequence Diagrams
c 20042011
17
Other Notations
States - it is possible to place states on lifelines (e.g., pre and post conditions) Textual notations (e.g., comments, time constraints, duration constraints) Tabular notation
Massimo Felici
Sequence Diagrams
c 20042011
18
Timing
Constraints are usually used to show timing constraints on messages. They can apply to the timing of one message or intervals between messages. Durations The duration of activations or the time between messages can be show with construction marks.
Massimo Felici
Sequence Diagrams
c 20042011
Example
19
Timing
Massimo Felici
Sequence Diagrams
c 20042011
20
Massimo Felici
Sequence Diagrams
c 20042011
21
Massimo Felici
Sequence Diagrams
c 20042011
22
Massimo Felici
Sequence Diagrams
c 20042011
23
Required Readings
UML course textbook, Chapter 9 on Interaction Sequence Diagrams
Massimo Felici
Sequence Diagrams
c 20042011
24
Summary
Sequence Diagrams capture some elements of the dynamics of systems support a number of dierent activities describe interaction in some detail, including timing Dimensions Objects and Time Basics Objects, Lifelines, Activations, Messages, etc. Timing
Massimo Felici
Sequence Diagrams
c 20042011