UML (Unified Modeling Language)
UML (Unified Modeling Language)
Language)
If a use case
gets too
complex, we
use activity
diagrams to
clarify things
Activity diagram
• Activity diagrams describe how activities are coordinated.
4
Activity diagram
– you want to model what the essential dependencies
between them are, before you decide in what order to
do them
• Activity diagrams are much better at showing this clearly
than interaction diagrams.
– Activity diagrams model the workflow of a business
process and the sequence of activities in a process.
5
Activity diagrams
– These diagrams are very similar to a flowchart because
you can model a workflow from activity to activity or
from activity to state.
– It is often beneficial to create an activity diagram early
in the modeling of a process to help you understand the
overall process.
– Activity diagrams are also useful when you want to
describe parallel behavior or illustrate how behaviors in
several use cases interact.
6
Activities are rectangles
with rounded corners
Transitions are
shown by arrows
Sometimes the transition may have text to
explain what is happening
Start and Finish
12
13
Fork and Join Nodes
• Forks and joins have the same notation: either a horizontal
or vertical bar (the orientation is dependent on whether the
control flow is running left to right or top to bottom).
• They indicate the start and end of concurrent threads of
control.
• The following diagram shows an example of their use.
17
Fork and Join Nodes (cont)
• A join is different from a merge in that the join
synchronizes two inflows and produces a single outflow.
• The outflow from a join cannot execute until all inflows
have been received.
• A merge passes any control flows straight through it.
18
• At the UML semantics level, activity diagrams are state
diagrams extended for convenience with some extra
notation
• Elements of activity diagrams
– Activity
– Transition
– Synchronization bar
– Decision diamond
19
Swim Lanes
• There is one other big notational element to activity
diagrams, Swim Lanes.
• Swim Lanes are used to illustrate which portions of a
system are responsible for particular elements of your
diagram.
• Here's an example:
• This diagram illustrates a User and a Website. The user is
attempting to log on to the website. As you can see, the
User is responsible for providing login credentials, while
the Website is responsible for authenticating the user.
21
Example of activity diagram with swim lanes:
22
Example
of swim
lanes
activity
diagram:
23
Business level activity diagram of the
library
24
Example:
25
Example:
26
Activity Diagram –
Example 1
Solution
Activity Diagram –
Example 2