UML2 Quick Reference - dice-project/DICE-Simulation GitHub Wiki
The Unified Modeling Language (UML) is a standard which provides a language to describe different systems. UML is a domain-independent language, although its origins are in the object-oriented modeling. A UML model consists of elements such as packages, classes, and associations. The corresponding UML diagrams are graphical representations of parts of the UML model. These diagrams contain graphical elements (nodes connected by paths) that represent elements in the UML model.
UML modeling can be generally divided into two semantic categories: behavioral modeling and structural modeling. In addition to these main categories, there are some supplemental modeling constructs that have both behavioral and structural aspects (e.g., deployment diagrams, use cases) which may complement behavioral and/or structural models. This section will focus in the former category, i.e., behavioral modeling.
Specifically, we describe below the interesting parts of the activity diagrams and sequence diagrams specification which are of interest from the point of view of the DICE Simulation Tool.
Activity Diagrams
An Activity, as specified in the UML standard, is a kind of Behavior that is specified as a graph of nodes interconnected by edges. A subset of the nodes are executable nodes that embody lower-level steps in the overall Activity. Object nodes hold data that is input to and output from executable nodes, and moves across object flow edges. Control nodes specify sequencing of executable nodes via control flow edges. Activities are essentially what are commonly called control and data flow models.
The following figure shows the main concepts (i.e., metaclases) used to create activity diagrams together with their relationships.
The most relevant elements from the transformation to analysis models point of view are:
-
UML::Packages::Model
— AModel
captures a view of a physical system. It is an abstraction of the physical system, with a certain purpose. -
UML::Activities::Activity
— AnActivity
is the specification of parameterized behavior as the coordinated sequencing of subordinate units (ActivityNodes
). -
UML::Activities::ActivityNode
(abstract) —ActivityNode
is an abstract class for points in the flow of anActivity
connected byActivityEdges
. -
UML::Activities::ActivityEdge
(abstract) — AnActivityEdge
is an abstract class for directed connections (i.e., withsource
[1..1] andtarget
[1..1]) between twoActivityNodes
. -
UML::Activities::ControlFlow
— AControlFlow
is anActivityEdge
traversed by control tokens or object tokens of control type, which are used to control the execution ofExecutableNodes
. -
UML::Activities::ControlNode
(abstract) — AControlNode
is an abstractActivityNode
that coordinates flows in anActivity
. -
UML::Activities::InitialNode
— AnInitialNode
is aControlNode
that offers a single control token when initially enabled. -
UML::Activities::FinalNode
(abstract) — AFinalNode
is an abstractControlNode
at which a flow in anActivity
stops. -
UML::Activities::ActivityFinalNode
— AnActivityFinalNode
is aFinalNode
that terminates the execution of its owningActivity
. -
UML::Activities::ForkNode
— AForkNode
is aControlNode
that splits a flow into multiple concurrent flows. -
UML::Activities::JoinNode
— AJoinNode
is aControlNode
that synchronizes multiple flows. -
UML::Activities::DecisionNode
—DecisionNode
is aControlNode
that chooses between outgoingActivityEdges
for the routing of tokens. -
UML::Activities::MergeNode
— AMergeNode
is aControlNode
that brings together multiple alternate flows. It is not used to synchronize concurrent flows but to accept one among several alternate flows. -
UML::Actions::Action
(abstract) — AnAction
is the fundamental unit of executable functionality. The execution of anAction
represents some transformation or processing in the modeled system.Actions
provide theExecutableNodes
withinActivities
and may also be used withinInteractions
. -
UML::Actions::OpaqueAction
— AnOpaqueAction
is anAction
whose functionality is not specified within UML.
The figure below shows an example activity diagram using the standard notation.
It is composed by an InitialNode
(Start), an ActivityFinalNode
(End), three OpaqueActions
(A1, A2 and A3), a DecisionNode
(D) and a MergeNode
(M).
Sequence Diagrams
Interactions are presented in the UML standard as a mechanism to get a better grip of an interaction situation for an individual designer or for a group that needs to achieve a common understanding of the situation. Interactions are also used during the more detailed design phase where the precise inter-process communication must be set up according to formal protocols. The most visible aspects of an Interaction are the messages between lifelines. The sequence of the messages is considered important for the understanding of the situation. The data that the messages convey and the lifelines store may also be very important, but the Interactions do not focus on the manipulation of data even though data can be used to decorate the diagrams.
The figure below shows the UML metaclases that may be used to create activity diagrams.
The most relevant elements from the transformation to analysis models point of view are:
-
UML::Packages::Model
— As aforementioned aModel
captures a view of a system with a certain purpose. -
UML::Interactions::Interaction
—Interactions
are units of behavior, and focus on the passing of information withMessages
between theConnectableElements
.Interactions
are the top-level elements of a UML sequence diagram. -
UML::Interaction::Lifeline
— ALifeline
represents an individual participant in theInteraction
.Lifelines
represent only one interacting entity (via therepresents
association toConnectableElement
). -
UML::Interactions::InteractionFragment
(abstract) —InteractionFragment
is an abstract notion of the most general interaction unit. AnInteractionFragment
is a piece of anInteraction
. EachInteractionFragment
is conceptually like anInteraction
by itself.InteractionFragments
are the main constituent parts of anInteraction
. AnInteractionFragment
may either be contained directly in an enclosingInteraction
, or may be contained within anInteractionOperand
of aCombinedFragment
. As aCombinedFragment
is itself anInteractionFragment
, there may be multiple nesting levels ofInteractionFragments
within anInteraction
. -
UML::Interactions::CombinedFragment
— The semantics of aCombinedFragment
is dependent upon the containedInteractionOperand
. Typical operators are alt (for alternative behaviors), opt (for optional behaviors) or par (for parallel execution paths). -
UML::Interactions::InteractionOperan
— As previously introduced, anInteractionOperand
is a region within aCombinedFragment
. -
UML::Interactions::ExecutionSpecification
(abstract) — AnExecutionSpecification
is a specification of the execution of a unit ofBehavior
orAction
within theLifeline
. The duration of anExecutionSpecification
is represented by twoOccurrenceSpecifications
, thestart
OccurrenceSpecification
and thefinish
OccurrenceSpecification
. -
UML::Interactions::BehaviorExecutionSpecification
— AnExecutionSpecification
linked to aBehavior
. -
UML::Interactions::ActionExecutionSpecification
— AnExecutionSpecification
linked to anAction
. -
UML::Interactions::OccurrenceSpecification
— AnOccurrenceSpecification
is the basic semantic unit ofInteractions
. The sequences of occurrences specified by them are the meanings ofInteractions
. -
UML::Interactions::ExecutionOccurrenceSpecification
— AnExecutionOccurrenceSpecification
represents moments in time at whichActions
orBehaviors
start or finish. -
UML::Interactions::MessageOccurrenceSpecification
— AMessageOccurrenceSpecification
specifies the occurrence ofMessage
events. AMessageOccurrenceSpecification
is a kind ofMessageEnd
.Messages
are generated either by synchronousOperation
calls or asynchronousSignal
sends. -
UML::Interactions::MessageEnd
—MessageEnd
is an abstract specialization ofNamedElement
that represents what can occur at the end of aMessage
. -
UML::Interactions::Message
— AMessage
is simply the trace between a message send event and a receive event.
The figure below shows an example sequence diagram using the standard notation.
It describes the interaction of a user with a two tier application.
The figure contains three Lifelines
represented by dotted lines: one for user (which is an instance of the User classifier
), a second one for ui (which represents and instance of UI) and a third one for backend (which is an instance of the Backend classifier
).
The three white boxes drawn on top the lifelines represent ExecutionSpecifications
(either ActionExecutionSpecifications
or BehaviorExecutionSpecifications
).
The arrow labeled with displayReport(id) represents a message from user to ui requesting the operation displayReport defined by the UI classifier
.
The operation takes as an argument the id value.
Similarly, the arrow labeled with getReport represents a message from ui to backend.
Finally, the dashed arrows labeled with report, represent the reply messages from the backend to the ui, and from the ui to the user.