AMS2024 10c Seq Others
AMS2024 10c Seq Others
Message-based Behaviour
UML
Message-based
diagrams
Message-Based Behaviour
▪ Describe how instances (objects) communicate
with each other.
▪ Describe how a function is performed as a
result of a sequence of messages sent and
received between a set of objects.
▪ In UML
Interaction diagrams
Sequence diagrams, Communication diagrams, Timing diagrams, Overview diagrams
3
Sequence Diagrams
▪ A sequence diagram represent interactions between system parts, i.e. how
objects communicate with each other.
▪ A sequence diagram describes a specific execution scenario.
4
Sequence Diagrams and Use Cases
▪ A sequence diagram can realize a use case scenario(s).
▪ The sequence diagram is used primarily to show the
interactions between objects in the order that those
interactions occur.
5
Sequence Diagrams
The sequence diagram may describe the interactions
between actors and systems or between parts of a
system.
This diagram represents the sending and receiving of
messages (interactions) between the interacting entities
called lifelines, where time is represented along the
vertical axis.
The sequence diagrams can represent highly complex
interactions with special constructs to represent various
types of control logic, reference interactions on other
sequence diagrams, and decomposition of lifelines into
their constituent parts.
OMG Systems Modeling Language (OMG SysML) (Chapter 12) 6
Sequence Diagrams
(warning: this diagram is not OK! See next slide ;-)
A sequence diagram describes a specific execution context (i.e. a specific execution
scenario). Represent interactions between system parts, i.e. how objects
communicate with each other.
7
Sequence Diagrams
BTW, according to the UML
language this is syntactical correct,
BUT it is an incorrect modelling of
requirements for a logical system!
Why?
8
Sequence Diagram Notation
▪ Represent interactions between objects along time.
▪ Stress the lifetime of the objects in a specific execution context.
12
Synchronous, Asynchronous and Return Messages
16
Interaction Operators
▪ Branches and loops
– alt, opt, break, loop
▪ Concurrency and order
– seq, strict, par
▪ Filters and constraints:
– critical, neg, assert, consider, ignore
The
interaction
operator
The
operands
18
Basic Interaction Operators
▪ Branches and loops:
– alt, opt, break, loop
▪ Concurrency and order:
– seq, strict, par
▪ Filters and constraints:
– critical, neg, assert, consider, ignore
19
Combined fragments: alternative
Alternative
Option
http://www.ibm.com/developerworks/rational/library/3101.html 21
Combined fragments: loop
Loop
22
Combined fragments: break
Break
(an alternative sequence
processed instead of the
rest of the diagram…)
23
Basic Interaction Operators
▪ Branches and loops:
– alt, opt, break, loop
▪ Concurrency and order:
– seq, strict, par
▪ Filters and constraints:
– critical, neg, assert, consider, ignore
24
Strict, Parallel and Weak Sequencing
25
Basic Interaction Operators
▪ Branches and loops:
– alt, opt, break, loop
▪ Concurrency and order:
– seq, strict, par
▪ Filters and constraints:
– critical, neg, assert, consider, ignore
26
Combined fragments: critical
paralell
27
Combined fragments: ignore
Ignore messages get() and set() if
they occur during this context
http://new.fengnet.com/book/UML/umlnut2-CHP-10-SECT-8.html 28
Combined fragments: consider
Consider
29
Combined fragments: negative
30
Combined fragments: assert
http://uml-dox.net/Wiley-UML.Bible/6081/DDU0074.html
31
VERY IMPORTANT
▪ Sequence and communication diagrams define interactions based on the
METHODS OF ENTITIES. Thus, the messages must be methods that are
specified in classes or blocks (traceability).
▪ All PARAMETERS (e.g. used in combined fragments) must also be valid in a
given context.
▪ This Rigor is relevant particularly at Design phase models
33
Examples of Sequence Diagram
Sequence Diagram: Summary
Sequence Diagram: Summary
Other diagrams…
Communication Diagram Overview
Communication diagrams correspond to simple Sequence diagrams without structuring mechanisms
(such as Combined Fragments).
correspond = can be converted to/from or replaced by
https://www.uml-diagrams.org/communication-diagrams.html
38
Equivalence of
Sequence and Communication
http://www.tutorialspoint.com/uml/uml_interaction_diagram.htm 39
Interaction Overview diagram… overview
https://www.uml-diagrams.org/interaction-overview-diagrams.html 40
Interaction Overview
Interaction overview diagrams provide an overview of
the control flow where each node is an interaction
It has similarities with an activity diagram but they are
not equivalent!
41
Interaction Overview
▪ Combine elements from
activity diagrams and
sequence diagrams to show
long or complex sequences of
action.
42
Interaction Overview
43
Timing Diagram Overview
https://www.uml-diagrams.org/timing-diagrams.html
44
Timing Diagrams (UML)
▪ Describes how one or more
objects change state over
time.
45
Activity Diagrams
▪ An activity diagram describes valid sequence of activities performed by one
or more entities of the system.
▪ An activity diagram describes a workflow detailing the control flow and data
flow.
▪ Activity diagrams are useful for describing
– Algorithms
– Use case Scenarios
– High level (business) modeling to describe how work is performed.
▪ Before BPMN became popular, UML Activity Diagrams were often used to
model Business Processes, which even lead to the development of UML
profiles for that purpose… Hoeverm, those efforts were abandoned since
BPMN got general acceptance…
46
Activity Diagrams
47
Activity Elements and Connectors
48
Activity Diagrams (UML)
49
Partitions
▪ Partitions make possible to contextualize activities/ and actions
in specific scopes of execution (can be an abstract sub-domain of
the domain model, to which we simply assign a name; a
component; a class/block; …; ultimately, any entity it is found
relevant to identify or define conceptually for this purpose…)
▪ Activity partitions Customer and Order Dept as horizontal or
vertical swimlanes .
50
Activity Diagrams (UML)
51
52