UML Behavioural Models Flashcards
Mention the three UML behavioural models discussed in class
UML Activity Diagrams
UML State Machine Diagrams
UML Sequence Diagrams
What is the UML Activity diagram a model of and what is its purpose
Modelling of step-wise activities and actions.
Purpose is to describe the behaviour in terms of processes and workflows.
An UML Activity Diagram is principally expressive enough to specify the system behaviour for a certain process completely.
Activity diagram
Initial node
Start of execution
Exactly one
Filled out circle
Activity diagram
Action
Active step
By system or actor
Round rectangle, description of action inside i.e. boil water
High level description of an active step that can be executed by an actor or by the system.
Not specified specifically, but can be by swim lanes.
Activity diagram
Transition
Connects actions
An arrow from which to which action the transition leads.
Activity diagram
Final node
End of execution
Circle filled in the middle.
Potentially many. But does not have different semantics, cannot be a distinction where one final node means ‘success’ and another ‘failure’.
Also possible to have no final node.
Activity diagram
Decision
Empty diamond.
Control flow branch.
Similar to Java’s if or switch statements.
Activity diagram
Guard
By the decision in [ ]
Boolean expression, must be true to execute.
For decisions, must not overlap.
Activity diagram
Fork
Start of parallelism
Start of all outgoing transitions in parallel.
A fat vertical line, arrows going in and out of it.
Once the fork is hit by the execution of the activity diagram because of the incoming transition was completed, all outgoing transitions are executed in parallel, i.e., (conceptually) at the same time.
Activity diagram
Join
End of parallelism
A fat vertical line, arrows going in and out of it.
Continue when all incoming transitions were completed.
Activity diagram
Swim lanes
Attribute actions to actors.
Rectangle around activity diagram with name on top.
What does the UML State Machine diagram model and what is the purpose?
Models protocols based on discrete system states.
The purpose is to describe reaction of system to triggers for current state.
When should one use State Machine Diagrams over Activity diagrams? And the other way around
A UML state machine diagram is used when a system has many discrete states the system stays in for a relevant time.
Whereas UML activity diagram is used when states are perceived as almost transient and focus should be put on the actions leading to the change of states.
State Machine Diagram
State
Current ‘mode’ of system
i.e. waiting, order approved, etc.
Rounded rectangle, with two sections. First sections is description of state.
State Machine Diagram
Transition
Connects states.
Direction of arrow shows from which to which.