Describing Software Architecture With UML
Describing Software Architecture With UML
Abstract: This paper describes our experience using UML, the Unified Modeling
Language, to describe the software architecture of a system. We found that it
works well for communicating the static structure of the architecture: the
elements of the architecture, their relations, and the variability of a structure.
These static properties are much more readily described with it than the
dynamic properties. We could easily describe a particular sequence of
activities, but not a general sequence. In addition, the ability to show peer-to-
peer communication is missing from UML.
1. INTRODUCTION
The basic elements in the conceptual view are components with ports through
which all interactions occur, and connectors with roles to define how they
can be bound to ports. The components and connectors are bound together to
form a configuration. In order to bind together a port and role in a
configuration, the port and role protocols must be compatible. Components
can be decomposed into other components and connectors. These elements,
their associated behavior, and the relations of the conceptual view are
summarized in Table 1.
lmlgePipellne
The multiplicities on the components, connectors, and bindings show the set
of allowable configurations. Each acquisition procedure has a distinct set of
processing steps, represented by the Imager component. So the diagram shows
the general structure of an image pipeline, which all acquisition procedures
adhere to.
The first stage of the pipeline is the Framer, followed by one or more
subsequent stages, represented by the Imager. Each of the stages is connected to
"A stereotype is, in effect, a new class of modeling element that is introduced at modeling
time. It represents a subclass of an existing modeling element with the same form
(attributes and relationships) but with a different intent... To permit limited graphical
extension of the UML notation as well, a graphic icon or a graphic marker (such as texture
or color) can be associated with a stereotype." (UML, 1997)
Describing Software Architectures with UML 149
..
is bound to framedOutput, it is necessarily the last stage in the pipeline .
<<protocol>>
ReQuestoataPacmt
ircomirg /reques!P<JJ:.kel
pac ket(p:j)
outgoirg
subscribe
des ubsc ri be
requestP <JJ:. ket
Table 3 shows how the image pipeline's conceptual elements are mapped to
module elements. Notice that ports, connectors, and components are sometimes
combined into one module. This information could also be shown in a UML
class diagram, with the mapping between conceptual and module elements
shown as an explicit association.
show the decomposition, and we use stereotypes for each different type of
element.
We do not use the UML "component" notation for a module, because in
the module view the modules are abstract, not the physical modules of
source code.
I
<<subsystel11>>
SPipeline
The use-dependencies among the pipeline modules are also derived from
the conceptual elements' associations. These are shown in Figure 4. The
MClient and MDataMgrAPI are not part of the SPipeline subsystem, but we
included them in order to show all use-dependencies of the SPipeline
subsystem. We use the UML "lollipop" notation to show the interface(s) of
each module, and to make it clear that the modules are dependent on the
interface of another module, not the module itself.
Figure 4 also shows some of the layers of the system. These are based on
the use-dependencies among modules and subsystems, so we often show
use-dependencies between and within layers in the same diagram, as we did
here.
For the interface definition, we use a simple list of the interface methods.
This information could be put inside the class definition in a UML diagram.
We generally prefer to list it separately, using the class diagrams to focus on
the relations among modules rather than a complete description of the
modules. In the module view, we represent modules with a stereotyped class,
and subsystems and layers with stereotyped packages. Decomposition is
shown by nesting (association), and the use-dependency is a UML
dependency.
We use:
- tables for describing the mapping between the conceptual and module
views.
152 C. Hofmeister, R. L. Nord, and D. Soni
I
<<layer>>
ApplicalionServicos
I «mcdul.,.>
Melien!
I
« layer>>
IIIIIQIIProoessirg
<<PrOCesS>> 1 <<process>>
*
ECIIenl EPipellneMgr
I «rrodU~>
MCII&nl
I ~
0.. 1 «mcdul~>
MPipellneControl
7
IPC 1 1
«rrodUe>> * / "
I MPipelneAPI·r-
<<process>> * <<shMEdda.ta>> * ~ <<process>>
Efran11r ElmgeiiUIIer E"'-r
*
IUlmgeMgrAPI
<rrodU~> 1/ 1
11 rtw 1 l
<<module>>
J
Mllnilgellltfer 1 rtw
*1 «module>>
i_ M"'-MgrAPI
J
I UllralaMgrAPI I
shared shared
«module>> memory memory <<module>>
I M.,_r
I
I «module>>
LlfntiTJlr
I
This diagram uses nesting to show the modules associated with each run-
time image. The modules have a multiplicity that is assumed to be one if
none is explicitly shown. In the configuration in Figure 5, there are multiple
modules MlmageMgrAPI, but at most one per process, and only in the
EFramer and Elmager processes. There are also multiple modules
MPipelineAPI in the configuration, but all of these reside in process EClient.
The run-time images also have multiplicity, as do communication paths,
which are labeled to show the communication mechanisms. This has the
same implications as for the conceptual configuration, namely that with
multiplicities on the run-time images, communication paths, and modules we
can show all allowable configurations in a single diagram.
154 C. Hofmeister, R. L. Nord, and D. Soni
:ECiient
(module MPipelineAPI)
create
create
create
The code architecture view contains files and directories, and like the
module view, does not have a configuration. The relations defined in the
code view apply across all products, not just to a particular product. The
code view elements and their relations are listed in Table 5. Modules and
interfaces from the module view are partitioned into source files in a
particular programming language.
Table 6 shows this mapping for the MPipelineControl module and its
interfaces: the public interfaces are each mapped to a file, and we have
created an additional file for the private interface to the module.
Describing Software Architectures with UML 155
<<cireclory>>
<<Source» PipelineControl
CPIPehneControl CPP .~ __ _
L-----------~·
~
' \ ... '
<<Source>>
CPipelineControiPvt.H
<<Source»
CstageControi.H
<<directory>>
PipelineAPI <<directory>>
lmageMgrAPI
<<Source:->
CPipeline.H <<Source>>
ClmageMgr.H
<.::Source>>
<<Source>>
CPipelinePvt.H
ClmageMgrPvt.H
The executable files are also organized into directories (Figure 8). The
relationship between executable files and source files is through intermediate
files. An executable file has link dependencies to the object files it links in,
and an object file has compile dependencies to the source files from which it
is compiled. These dependencies are also shown in Figure 8.
For the code view, we represent the source, object, and executable files
as stereotyped classes, and the directories as stereotyped packages. The
include, compile, and link relationships are shown as stereotyped
dependencies. We use:
- Tables to describe the mapping between elements in the module and
execution views and elements in the code view.
- UML Component Diagrams for showing the dependencies among source,
intermediate, and executable files.
6. DISCUSSION
Table 8 summarizes the elements of our four architecture views and their
corresponding UML Metamodel Classes and stereotype names, if any. For
relations among the architecture description elements, we use UML
associations and dependencies. We generally create a separate diagram for
each kind of relation, but sometimes we combine them (e.g. the execution
configuration diagram).
We use UML Class/Object, Package, and Component Diagrams for the
elements and their relations, sometimes including the interfaces and
Describing Software Architectures with UML 157
l
<<directory>>
~ J Exa:!&bl~~~roces~i[Q
------, <<cirectorv>>
8
<<d:rectory>>
8.
EPi~ineCortrol ~
<<drectory>>
« executable» <<executable ~ > IEFrmw
--
EPipellneMgr.exe
I EFramer.exe
:<<link>>
<<hnk>>,' : " .. «link>>
/ : <<link>> " ..
<<directory>>
1-----'.,.-------,~
REFERENCES
Bass, L., Clements, P., and Kazman, R. (1998) Software Architecture in Practice. Addison-
Wesley, Massachusetts.
Eriksson, H., and Penker, M. (1998) UML Toolkit. John Wiley and Sons, London.
Fowler, M., with Scott, K. (1997) UML Distilled. Applying the Standard Object Modeling
Language. Addison-Wesley, Massachusetts.
Hofmeister, C., Nord, R., Soni, D. (to appear) Applied Software Architecture. Addison-
Wesley, Massachusetts.
Kramer, J., and Magee, J. (1990) The Evolving Philosophers Problem: Dynamic Change
Management. ACM Transactions on Software Engineering, 16(11), 1293-1306.
Kruchten, P. (1995) The 4+ 1 View Model of Architecture, IEEE Software, 12(6).
Prieto-Diaz, R., and Neighbors, J.M. (1986) Module Interconnection Languages. The Journal
of Systems and Software, 6(4), 307-334.
Purtilo, J.M. (1994) The Polylith Software Bus. ACM Transactions on Programming
Languages and Systems, 16(1), 151-174.
Selic, B., Gullekson, G., and Ward, P.T. (1994) Real-Time Object-Oriented Modeling. John
Wiley and Sons, New York.
Selic, B., and Rumbaugh, J. (1998) Using UML for Modeling Complex Real-Time Systems.
http://www.objectime.com/uml/uml.html.
Shaw, M., and Garlan, D. (1996) Software Architecture: Perspectives on an Emerging
Discipline. Prentice Hall.
Soni, D., Nord, R.L., and Hofmeister, C. (1995) Software Architecture in Industrial
Applications, in Proceedings of the 17th International Conference on Software
Engineering, Seattle, W A.
UML (1997) UML Notation Guide, Version 1.1. http://www.rational .com/uml.