Sequence diagrams Karolina Muszyńska Based on S Wrycza B Marcinkowski K Wyrzykowski Język UML 20 w modelowaniu SI Dynamic view sequence diagrams role and types of sequence diagrams ID: 264192
Download Presentation The PPT/PDF document "Object-oriented modeling" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Object-oriented modelingSequence diagrams
Karolina Muszyńska
Based on
: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”Slide2
Dynamic view – sequence diagramsrole and types of sequence diagramsbasic concepts
advanced conceptsexamples2
Object ModelingSlide3
Sequence diagram is a kind of interaction diagram, describing interactions among system classifiers in the form of sequence of messages interchanged between them during a certain period of time.
Sequence diagrams are closely related to use case scenarios as they document their functionality.Interaction is shown on the sequence diagram in two dimensions:
Horizontal - static dimension
where the system classifiers taking part in the interaction are placed
Vertical – dynamic dimension
, with the time line showing chronically arranged messages
3
Sequence Diagram –roleSlide4
Depending on the degree of abstraction three types of sequence diagrams can be specified:
Conceptual sequence diagram – using only basic concepts, for quick and general overview of the system interactionsGeneric sequence diagram – is the basis for software specification and uses all available concepts; this type of diagram includes the main and all alternative scenarios of a use case and it can be used for automatic generation of program code
Instance sequence diagram
– a diagram describing one particular scenario of a use case; there may be several instance diagrams for one generic diagram
4
Sequence Diagram
s
–typesSlide5
Classifier – abstract category of system modeling in UML (e.g.
actor, object,
interface
, component, package, etc.)
Message
– describes a control flow in the system; it determines the sequence and place of execution of operations; messages are arranged according to the sequence of their appearance – the later they occur the lower they appear on the diagram
Each classifier has a
lifeline that represents its life time; the “X” mark at the end of the lifeline indicates the point at which the object ceases to exist in the system
The
execution specification
shows time period during which the classifier performs an operation (processing, calculating, communicating with other classifiers or executing complex algorithms); the execution specification is initiated with an activation and ended with deactivation.
5
Sequence Diagrams –basic conceptsSlide6
6
Sequence
Diagrams –basic concepts
Classifier
(actor, object, interface, package)
Message
LifelineSlide7
7
Sequence
Diagrams –basic concepts
Activation
Execution specification
DeactivationSlide8
Types of messages
Creating and destroying objectsGuard conditions
Combined fragments with interaction operators
Interaction occurrences
8
Sequence Diagrams –
advanced conceptsSlide9
Message types:synchronous message – passes control from the sender classifier to the receiver classifier
asynchronous message – does not pass control, does not wait for an answer from the receiver, may continue processingreturn message – indicates control return to the sender classifier after synchronous message and may also initiate a certain operation
self message
– message sent by the classifier to itself resulting in calling its own operation; self message is a certain kind of iteration, which creates a nested execution specification
9
Sequence Diagrams – advanced conceptsSlide10
10
Sequence Diagrams – advanced concepts
Asynchronous message
Synchronous messageSlide11
11
Sequence Diagrams – advanced concepts
Self message
Return
messageSlide12
Other message types:lost message – message sent from a known sender to an unknown receiver (temporary message)
found message – message whose sender is unknown (may be an external signal, stimulus)balking message – message which will not be handled by the receiver classifier if it cannot be handled immediatelytimeout message
– similar to balking message although sender classifier is willing to wait for handling the operation for a specified period of time
12
Sequence Diagrams – advanced conceptsSlide13
Creating and destroying objects:„create” stereotype message – results in creation of an object, which is situated below the primary existing classifiers, corresponding with the time of its creation
„destroy” stereotype message – results in destruction of an object
13
Sequence Diagrams – advanced conceptsSlide14
14
Sequence Diagrams – advanced concepts
<<Destroy>> message
<<Create>> messageSlide15
Guard condition – a criterion connected with the message, on fulfillment of which depends the execution of a specified operation.
If a condition referring to a certain message is not met the operation indicated by the message is not executed. Conditions are placed in square brackets before the message nameRealization of a message can be conditioned by more than one condition
15
Sequence Diagrams – advanced conceptsSlide16
16
Sequence Diagrams – advanced concepts
Guarding conditionSlide17
alt
– alternativeopt – optionbreak
– interruption
loop
– iteration
neg
– improper functionalitypar
- concurrency
critical
–
critical region
assert
– formulaconsider
– significanceignore – insignificancestricte
– strict order
seq
– weak order
17
Sequence Diagrams – advanced concepts
Combined fragment
– is a logically consistent area of interaction, a part of
a
sequence diagram characterized by specific properties defined by the interaction operator
Interaction operator
– specifies the functionality realized by the combined fragment
Interaction operators:Slide18
18
Sequence Diagrams – advanced concepts
Selected, most common operators:
alternative
(alt)
– means a possibility to choose only one of all presented interaction operands within the combined fragment, depending on the condition assigned to the operand
option
(opt ) – means that the operand within the combined fragment will occur or will be omitted, depending on the condition
interruption
(break)
–
is a abbreviated form of
alt
with only one defined operand and when the combined fragment is executed other interactions are ignorediteration (loop)
– means repeating the operand a specified number of timesSlide19
19
Sequence Diagrams – advanced conceptsSlide20
20
Sequence Diagrams – advanced conceptsSlide21
21
Sequence Diagrams – advanced conceptsSlide22
22
Sequence Diagrams – advanced conceptsSlide23
23
Sequence Diagrams – advanced conceptsInteraction occurrence
– is a reference to a linked interaction diagram, placed within the base diagram
Interaction occurrences are especially useful in case of extensive sequence diagrams, which refer to other diagrams defined earlier
Interaction occurrence can be invoked either by a message or by time factorSlide24
24
Sequence Diagrams – advanced concepts
Interaction occurrenceSlide25
25
Building a sequence diagram
Analysis of a selected use case and its scenarios
Identification of classifiers taking part in the interaction
Development of conceptual sequence diagram including (identified classifiers, messages and execution specifications)
Development of a generic sequence diagram on the basis of the conceptual diagram by adding advanced concepts like: different message types, conditions, combined fragments, interaction occurrences
Optional development of instance sequence diagrams for a selected generic diagramSlide26
26
Additional information and examplesUML
Sequence
Diagrams: Guidelines
https://
msdn.microsoft.com/en-us/library/dd409389.aspx
UML Sequence Diagrams: Referencehttps://msdn.microsoft.com/en-us/library/dd409377.aspx
Sequence Diagrams
http
://
www.uml-diagrams.org/sequence-diagrams.html
UML Sequence Diagrams Examples
http://www.uml-diagrams.org/sequence-diagrams-examples.html