0% found this document useful (0 votes)
7 views51 pages

AMS2024 10c Seq Others

Uploaded by

Fragy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views51 pages

AMS2024 10c Seq Others

Uploaded by

Fragy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Behavioural Modelling

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.

▪ Sequence diagrams may refine the requirements


expressed as use cases (scenarios).

▪ Use cases are often refined into one or more sequence


diagrams, depending on complexity.
– NOTE: activity diagrams may be used as well.

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?

The reason is because it violates


the principle of modeling a
concerns that is outside to the
system (the interaction between
actors is a concern of the context
of the logical system, BUT NOT OF
THE SYSTEM!!!)

8
Sequence Diagram Notation
▪ Represent interactions between objects along time.
▪ Stress the lifetime of the objects in a specific execution context.

Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/ 9


Entities represented in sequence diagrams are instances

Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/


10
Creation and destruction

12
Synchronous, Asynchronous and Return Messages

Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/ 13


Messages and time constraints

Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/ 14


Conditional interactions

Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/ 15


Recursion

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 operators apply to combined fragments

For further reading please refer to:


http://new.fengnet.com/book/UML/umlnut2-CHP-10-SECT-8.html
17
Combined Fragments
A combined fragment (alt)

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

Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/ 20


Combined fragments: option
opt is equivalent to alt with a single condition

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

▪ strict: behaviour is sequentially executed exactly in


the specified order.
▪ par: behaviour is executed in parallel.
▪ seq: behaviour is sequentially executed in any order.

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

▪ A critical region is a region with traces that cannot be


interleaved by other occurrence specifications.
▪ The region is treated atomically by the enclosing fragment and
can not be interleaved (e.g. by a parallel operator).

27
Combined fragments: ignore
Ignore messages get() and set() if
they occur during this context

▪ Ignore fragment declares a message or messages to be of no


interest if it appears in the current context.

http://new.fengnet.com/book/UML/umlnut2-CHP-10-SECT-8.html 28
Combined fragments: consider
Consider

▪ Consider means any message not included in the fragment


must be ignored
▪ Consider is the opposite of Ignore

29
Combined fragments: negative

▪ neg encloses an invalid series of messages


▪ All interaction fragments that are different from the negative are considered
positive, meaning that they describe traces that are valid and should be possible.
▪ Negative traces are the traces that occur only when the system has failed…

30
Combined fragments: assert

▪ assert identifies an operand as the only valid continuation of


events in an interaction fragment.
▪ If any other messages occur they are considered to be invalid!

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

Note: Sequence and communication diagrams can also describe interactions


among instances of components instead of classes/blocks.
Examples from http://www.tracemodeler.com/articles/a_quick_introduction_to_uml_sequence_diagrams/ 32
Sequence Diagram: basic concepts

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.

▪ Each node is a reference to an


existing diagram.
sd - sequence diagrams
cd - communication diagrams
td - timing diagrams
iod - other interaction overview
diagrams

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.

▪ Can represent the same


information as a cd, sd, smd,
but detail temporal
constraints (e.g. delay,
duration, frequency).

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

You might also like