Sequence Diagrams Flashcards
(23 cards)
Synchronous message
Sender waits until it has received a response message before continuing (close arrowhead)
Asynchronous message
Sender continues without waiting for a response message (open arrowhead)
Response message
May be omitted if content and location are obvious
alt
alternative interaction, similar to switch statement in java, conditional branches with guards
opt
optional interaction, similar to if statement without else branch
loop
repeated interaction
break
exception interaction, simple form of exception handling
seq
weak order, interactions occur in strict sequence order
strict
strict order, interactions occur in more restrictive order without parallelism or out-of-order execution, messages must follow vertical order
par
concurrent interaction, allows parallel interactions, messages can interleave
critical
atomic interaction, ensures interaction complete without interruption, messages can’t interleave
ignore
irrelevant interaction, specifies messages that should be ignored and not shown in the diagram
consider
relevant interaction, specifies which should be considered while ignoring others
assert
asserted interaction, specifies an assertion that must always be true for sequence to proceed
neg
invalid interaction
Sequence diagram purpose
Shows interactions between objects in chronological order
Message syntax
messageName(arguments): returnValue
e.g. y(123): void (method y with argument 123, no return)
Loop fragment notation
loop(min, max) or loop(min..max)
loop(*) = indefinite loop
Time constraints notation
{0..2s} = time interval
at(12:00) = absolute time
Practice Q1: write possible traces for par fragment with messages a,b,c
a -> b -> c
c -> a -> b
a -> c -> b
Practice Q2: write trace for loop(2,2) with a,b,c
a -> b -> a -> b -> c (2 iterations)
Practice Q3: write possible traces for critical fragment with a,b,c
a -> b -> c
b -> a -> c
Practice Q4: write valid and invalid traces for par with critical fragment a,b,c
Valid: a -> b -> c, c -> a -> b
Invalid: a -> c -> b