Activity Diagram
Activity Diagram
Diagrams
LECTURE 5
Activity Diagram
Activity diagrams describe the workflow behavior of a system.
Activity diagrams are similar to state diagrams because activities are the state of doing
something.
The diagrams describe the state of activities by showing the sequence of activities performed.
Activity diagrams can show activities that are conditional or parallel.
When to Use:
The main reason to use activity diagrams is to model the workflow behind the system being
designed.
Activity Diagrams are also useful for: analyzing a use case by describing what actions need to
take place and when they should occur;
Activity diagrams do not give detail about how objects behave or how objects collaborate.
How to Draw Activity diagrams
Activity diagrams show the flow of activities through the system.
Diagrams are read from top to bottom and have branches and forks to describe conditions and
parallel activities.
A fork is used when multiple activities are occurring at the same time.
The branch describes what activities will take place based on a set of conditions.
All branches at some point are followed by a merge to indicate the end of the conditional
behavior started by that branch.
After the merge all of the parallel activities must be combined by a join before transitioning into
the final activity state.
How to Draw Activity diagrams
Activity diagrams - Notations
Activity Activity states - Represent the performance of a step within the
workflow.
Send Receive
Messages
Objects
Collaboration diagrams
Dynamic behavior of objects can, in addition to sequence diagrams, also be represented by
collaboration diagrams.
The transformation from a sequence diagram into a collaboration diagram is a bi-directional
function.
The difference between sequence diagrams and collaboration diagrams is that collaboration
diagrams emphasize more the structure than the sequence of interactions.
Within sequence diagrams the order of interactions is established by vertical positioning
whereas in collaboration diagrams the sequence is given by numbering the interactions.
Its elements are:
– Object Links - solid lines between the objects that interact
– On the links are Messages - arrows with one or more message name that show the direction and
names of the messages sent between objects
Collaboration diagrams
Shows the relationship between objects and the order of messages passed between them.
The objects are listed as rectangles and arrows indicate the messages being passed.
The numbers next to the messages are called sequence numbers.
convey the same information as sequence diagrams, but focus on object roles instead of the
time sequence.