8/26/2021
68
Notation DescriptionVisual Representation

Actor

  • a type of role played by an entity that interacts with the subject (e.g., by exchanging signals and data)
  • external to the subject (i.e., in the sense that an instance of an actor is not a part of the instance of its corresponding subject).
  • represent roles played by human users, external hardware, or other subjects.

Note that:

  • An actor does not necessarily represent a specific physical entity but merely a particular role of some entity
  • A person may play the role of several different actors and, conversely, a given actor may be played by multiple different person.

Lifeline

  • A lifeline represents an individual participant in the Interaction.

Activations

  • A thin rectangle on a lifeline) represents the period during which an element is performing an operation.
  • The top and the bottom of the of the rectangle are aligned with the initiation and the completion time respectively

Call Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Call message is a kind of message that represents an invocation of operation of target lifeline.

Return Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Return message is a kind of message that represents the pass of information back to the caller of a corresponded former message.

Self Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Self message is a kind of message that represents the invocation of message of the same lifeline.

Recursive Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Recursive message is a kind of message that represents the invocation of message of the same lifeline. It's target points to an activation on top of the activation where the message was invoked from.

Create Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Create message is a kind of message that represents the instantiation of (target) lifeline.

Destroy Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Destroy message is a kind of message that represents the request of destroying the lifecycle of target lifeline.

Duration Message

  • A message defines a particular communication between Lifelines of an Interaction.
  • Duration message shows the distance between two time instants for a message invocation.

Note

A note (comment) gives the ability to attach various remarks to elements. A comment carries no semantic force, but may contain information that is useful to a modeler.

UML provides neither notation to model exception handling in sequence diagrams nor any reasoning why it is absent. Some clumsy approaches to model try-catch blocks are by utilizing combined fragments - alt (alternatives) and breaks, while adding stereotypes for reply messages representing thrown exceptions. There are several proposed notations for exception handling. 1

Interaction Sequence Diagram Pdf

After searching for quite a while on how to model exception handling in a UML Sequence Diagram I found two ways to represent exception handling in a UML Sequence Diagram. They both use interaction operators, alt and break.

A sequence diagram is a form of interaction diagram which shows objects as lifelines running down the page, with their interactions over time represented as messages drawn as arrows from the source lifeline to the target lifeline. After searching for quite a while on how to model exception handling in a UML Sequence Diagram I found two ways to represent exception handling in a UML Sequence Diagram. They both use interaction operators, alt and break. I'll describe both methods using a classical example: withdraw money from an ATM when the balance is too low.

I'll describe both methods using a classical example: withdraw money from an ATM when the balance is too low.

Happy flow

Sequence Diagram Interaction Use

Interaction Sequence Diagram

Sequence Diagram Editor

Let's start with the happy flow. The customer enters the data, the ATM calls a service, which calls the bank's server. The server confirms the withdrawal is approved and, the service passes this on to the ATM's UI and the ATM dispenses the money.

Alt

An alternative interaction operator represents the logic equivalent of an if-then-else statement. Only one of the offered alternatives runs on any pass through the interaction. However, as for any operand, the selected operand in the alternative structure runs only if the guard condition tests true. If there is no guard, the operand always runs when it is selected. The else clause of the alternative combined fragment runs when no other option is selected. 2

Let's take a look when the situation when something happens, what causes the ATM to decline de withdrawal. Using an alt interaction operator, it would look something like this:

Sequence Interaction Diagrams

This looks nice, for a small diagram, but once the diagram starts to grow and you get a lot of nested alt interaction operations, you might start to loose the overview.

Break

InteractionInteraction Sequence Diagram

The break interaction operator is similar to the break mechanism in other programming languages. When the guard condition is true , the current interaction run is abandoned and the clause in the break interaction operand runs. 2

Let's take a look when the situation when something happens, what causes the ATM to decline de withdrawal. Using a break interaction operator, it would look something like this:

In this example the exception isn't caught until it enters the UI, in this case the ATM. What I like about this way of displaying exception handling is that it makes the diagram much less cluttered. I think it even makes things better, because you can see where a sequence stops when an exception occurs. This is ofcourse a very simple example, and you can have a lot more interaction in the breakDigital analog wall clock. interaction operator, like logging or transaction handling.

Diagram

As always, the best method depends on the scenario. But for 'simple' exception handling, I think a break is a better way to represent it, then alt.