Using UML Activity Diagrams For The Process View: Ben Lieberman
Using UML Activity Diagrams For The Process View: Ben Lieberman
Using UML Activity Diagrams For The Process View: Ben Lieberman
html
The 4+1 Architecture Views1 present a set of models useful for describing
software systems. Of these, the Process View is often used for modeling
the processes and threads executing in a software system. Descriptions of
the Process View have often focused only on the static structure of
interacting processes and lightweight threads using UML stereotyped class
diagrams.2 This article presents the counterpart Dynamic View to the
static class diagram representation. As will be shown, UML Activity
Diagrams are used to capture the "roadmap" of the processing flow as a
series of steps. The astute reader will note that this technique is very
similar to flow-chart modeling familiar to experienced software developers.
The primary difference here is the level of abstraction used to focus
attention on critical processing details while hiding much of the underlying
code complexity. These diagrams quickly capture and summarize the
system dependencies at a processing level, leading to a better
architectural definition of the system.
Note, however, that this technique violates some of the defined semantics
for Activity Diagrams in the UML standard: most notably the requirement
for all activity transitions to flow from entry to exit. In the example
diagrams this requirement has been relaxed to better display the parallel
nature of threads and processes.
For new systems, system process definition (i.e., the Process View) occurs
during the Analysis and Design workflow. Following the Rational Unified
Process, the Architect and the Designer perform this activity. The usual
progression in the creation of these models is to find the core processes
(as defined by the static model), then follow with a design session to
outline the processing flows.
Also of note is the use of Swimlanes to indicate the threads and processes.
While it may seem redundant to use Swimlanes named for the process and
threads when there is a specific activity to represent them, remember that
the intent of the process/thread activity is to show when a process/thread
is created, controlled, or destroyed. The Swimlanes are intended to show
the parallel processing for each zone of control.
Figure 2: Using Swimlanes to Describe Processes and Threads
Click here for full size image
One of the most effective techniques for eliciting a model for an existing
system is to conduct a personal interview with the subject matter experts
(SMEs).3 This works best in small group settings (three people or fewer),
with a facilitator who creates the model directly into a modeling tool. This
allows for the rapid capture and direct presentation of the model to the
SMEs for feedback. In my experience, the best mechanism for this is to
attach a projector to the facilitator's computer and project the model onto
a large screen that is easily visible to all participants. Alternatively, the
group can gather around a large monitor.
Begin the interview by asking where the processing begins, then capture
the response as the entry point into the diagram. If the existing processes
and threads are known, then they can be captured as Swimlanes at this
point. Otherwise, they will be discovered as the information capture
progresses. After you locate the entry point, proceed with the interview by
asking what the steps are for the system processing. Decision points are
of particular interest, as they represent areas of the system where
branching will occur. Data important to the process flow should be
captured in notes attached to the related activities. Interrupts affecting
processing should be indicated where they occur. Figures 3, 4, and 5 show
an example of how a distributed travel reservation system can be
diagrammed for the Deployment View, static Process View, and dynamic
Process View, respectively.
Figure 5: Travel Planning System, Model of Existing System Elements for the
Dynamic Process View (Ticket Fulfillment Subsystem)
[Click here for full size image]
Technique Use and Abuse
As with any modeling method, there is a high potential for misuse that can
limit or eliminate the effectiveness of the technique. When using Activity
Diagrams for modeling system processing, it is important to capture the
initial information at a relatively high level of abstraction. This top-down
approach allows you to emphasize important details while hiding
programmatic ones. If you get trapped in the low-level processing details
(e.g., algorithmic flow-charting), then the diagram will become cluttered
with programmatic activities that obscure the model's true purpose: to
indicate key processing activities and dependencies. Low-level details that
can seriously impact the clarity and usefulness of these models include the
description of complex algorithms, specific steps in persistence operations,
system-level connection and communication details, and other such
specifics of operating system activities. For the interviewing process
described above to be successful, the facilitator should be practiced at
finding appropriate levels of abstraction and be on guard against
programmatic details entering into the model.
A High-Value Technique
The Process View, as defined in the 4+1 Architecture Views, is intended to
capture and communicate the system processes and threads. This article
presents a technique for capturing the key processing steps for system
processes/threads and shows the utility of such models during the
software development process. These models are not simple to create, but
they do represent complex system processing in a "clean," efficient way.
By using Activity Diagrams to model internal system processing steps, the
test team, architect, and system designer can achieve an identical
understanding of the key processing steps and subsystem dependencies
present in the software design. For complex systems such as embedded,
real-time, or distributed systems, this kind of understanding amongst
team members can be of immense value: It ensures that the system the
team creates can be maintained and extended, and that it meets the
needs of the customer.
This Rational RoseTM script (for version 2000 and greater) will
automatically add diagram element fill color to the Activity Views on each
Activity Diagram included in the use case model (e.g., under the Logical
View root package).
References
G. Booch, J. Rumbaugh, et al., The Unified Modeling Language, User
Guide. Reading, Massachusetts: Addison Wesley, 1999.
A. Cockburn, "Goals and Use Cases." Journal of Object Oriented Design,
September 1997: 35-40.
1See P. Kruchten, "The 4+1 View Model of Architecture," IEEE Software, 12 (6), November
1995, IEEE, pp. 42-50
2G. Booch, J. Rumbaugh, et al. The Unified Modeling Language, User Guide. Reading,
Massachusetts, Addison-Wesley,1999 and J. Rumbaugh, I. Jacobson, et al, The Unified
Modeling Language, Reference Manual. Reading, Massachusetts, Addison Wesley, 1999.
3D. Leffingwell and D, Widrig Managing Software Requirements: A Unified Approach. Boston:
Addison-Wesley, 2000 and A. Cockburn, "Goals and Use Cases." Journal of Object Oriented
Design, September 1997: 35-40.