Fundamentals of UML Diagrams

A diagram is the graphical presentation of a set of elements. UML has a lot of different diagrams. Make sure you can differentiate between different diagrams. Previous sections described UML diagrams; this section elaborates on them using examples.

Using the <> relationship

Statechart Diagrams

Statechart is a diagram that shows all possible object states. Some objects can at any particular time be in a certain state. A Statechart or simply a state diagram shows a state machine, consisting of states, transitions, events, and activities. Statechart diagrams address the dynamic view of a system. UML State charts are not normally needed. They are needed when an object has a different reaction dependent on its state; an example of a Statechart diagram is shown in Figure 2.11.


Figure 2.11: Example of a Statechart Diagram Activity Diagrams

An activity diagram is a special kind of a statechart diagram that shows the flow from activity to activity within a system. They are used to show how different workflows or processes in a system are constructed, how they start, the many decision paths that can be taken from start to finish and where parallel processing may occur during execution. Activity diagrams address the dynamic view of a system. They are especially important in modelling the function of a system and emphasize the flow of control among objects. An Activity diagram as shown in Figure 2.12 generally does not model the exact internal behaviour of a software system (like a Sequence diagram does) but rather it shows the general processes and pathways at a high level.


Figure 2.12: Example of Activity Diagram