Modeling Systems with UML
© Copyright 1998 Popkin Software and Systems
2
Contents
INTRODUCTION................................................................................................................................................................3
WHAT IS UML?..................................................................................................................................................................4
UML Provides Standard Notation and Semantics...............................................................................................4
UML Is Not a Method................................................................................................................................................4
UML 1.1 EXTENSIONS.....................................................................................................................................................5
Stereotypes..................................................................................................................................................................4
Business Modeling Extensions................................................................................................................................5
Object Constraint Language (OCL).......................................................................................................................5
FURTHER EXTENSIONS...................................................................................................................................................6
Responsibility-Driven Analysis with CRC Cards.................................................................................................6
Relational Data Modeling.......................................................................................................................................6
AN OVERVIEW OF UML..................................................................................................................................................7
A Use Case Driven Tour............................................................................................................................................7
Use Cases and Interaction Diagrams.....................................................................................................................7
Class and Implementation Diagrams.....................................................................................................................7
CRC Cards – An Informal UML Extension............................................................................................................7
State Diagrams...........................................................................................................................................................7
Implementing the Design..........................................................................................................................................9
Testing Against Requirements.................................................................................................................................9
AN IN-DEPTH LOOK AT UML......................................................................................................................................10
ORGANIZING YOUR SYSTEM WITH PACKAGES........................................................................................................10
USE CASE MODELING...................................................................................................................................................11
Capture and/or Verify Requirements....................................................................................................................11
Organization of Use Case Diagrams....................................................................................................................11
A Use Case for Every Scenario..............................................................................................................................11
Model Alternate Sequences Through "Extends" Relationship.......................................................................12
Eliminate Redundant Modeling Through "Uses" Relationship......................................................................12
Use Cases Aid in Testing System Against Requirements...................................................................................12
SEQUENCE DIAGRAMS..................................................................................................................................................12
COLLABORATION DIAGRAMS......................................................................................................................................13
ANALYSIS AND DESIGN WITH THE CLASS DIAGRAM.............................................................................................14
Development of Class Diagram During Analysis...............................................................................................14
Design of System with Class Diagram..................................................................................................................15
MODELING CLASS BEHAVIOR WITH STATE DIAGRAM..........................................................................................17
ACTIVITY DIAGRAMS...................................................................................................................................................18
Using Activity Diagrams to Model Use Cases....................................................................................................18
Using Activity Diagrams to Model Classes.........................................................................................................18
MODELING SOFTWARE COMPONENTS.....................................................................................................................19
MODELING DISTRIBUTION AND IMPLEMENTATION .............................................................................................20
RELATIONAL DATABASE DESIGN – A UML EXTENSION ......................................................................................20
USE OF A MODELING TOOL........................................................................................................................................22
SUMMARY.........................................................................................................................................................................23
REFERENCES ....................................................................................................................................................................24
3
Introduction
This whitepaper introduces the Unified Modeling Language (UML), version 1.1. It reviews the diagrams that
comprise UML, and offers a Use-Case-driven approach on how these diagrams are used to model systems.
The paper also discusses UML's built-in extensibility mechanisms, which enable its notation and semantics to
be extended. This paper also suggests extending UML by two non-built-in techniques: CRC cards for
responsibility-driven analysis and entity relation diagrams for modeling of relational databases.
4
What Is UML?
The Unified Modeling Language prescribes a standard set of diagrams and notations for modeling object-
oriented systems, and describes the underlying semantics of what these diagrams and symbols mean.
Whereas there has been to this point many notations and methods used for object-oriented design, now there
is a single notation for modelers to learn.
UML can be used to model different kinds of systems: software systems, hardware systems, and real-world
organizations. UML offers nine diagrams in which to model systems:
• Use Case diagram for modeling the business processes
• Sequence diagram for modeling message passing between objects
• Collaboration diagram for modeling object interactions
• State diagram for modeling the behavior of objects in the system
• Activity diagram for modeling the behavior of Use Cases, objects, or operations
• Class diagram for modeling the static structure of classes in the system
• Object diagram for modeling the static structure of objects in the system
• Component diagram for modeling components
• Deployment diagram for modeling distribution of the system.
UML is a consolidation of many of the most used object-oriented notations and concepts. It began as a
consolidation of the work of Grady Booch, James Rumbaugh, and Ivar Jacobson, creators of three of the most
popular object-oriented methodologies.
In 1996, the Object Management Group (OMG), a standards body for the object-oriented community, issued a
request for proposal for a standard object-oriented analysis notation and semantic metamodel. UML, version
1.0, was proposed as an answer to this submission in January of 1997. There were five other rival submissions.
During the course of 1997, all six submitters united their work and presented to OMG a revised UML
document, called UML version 1.1. This document was approved by the OMG in November 1997. The OMG
calls this document OMG UML version 1.1. The OMG is currently in the process of performing a technical
editing of this specification, scheduled for completion by April 1, 1999.
UML Provides Standard Notation and Semantics
UML prescribes a standard notation and underlying semantics for modeling an object-oriented system.
Previously, an object-oriented design might have been modeled with any one of a half dozen popular
methodologies, causing reviewers to have to learn the notational semantics of the methodology before trying
to understand the design. Now with UML, different designers modeling different systems can readily
understand each other’s designs.
UML Is Not a Method
UML, however, does not prescribe a standard process or method for developing a system. There are a number
of popular, published methodologies; a few of the most popular of which include the following:
Catalysis: An object-oriented method that fuses much of the recent work on object-oriented
methods, and in addition provides specific techniques for modeling distributed
components.
Objectory: A Use-Case driven method for development created by Ivar Jacobson.
Shlaer/Mellor: "The" method for design of real-time systems, put forth by Sally Shlaer and Steven
Mellor in two 1991 books, Object Lifecycles, Modeling the World in States, and Object
Lifecycles, Modeling the World in Data (Prentice Hall). Shlaer/Mellor continue to
5
periodically update their method (most recent update is The OOA96 Report), and
recently published a white paper on how to use UML notation with Shlaer/Mellor.
Fusion: Developed at Hewlett Packard in the mid-nineties as the first attempt at a standard
object-oriented method. Combines OMT and Booch with CRC cards and formal
methods. (www.hpl.hp.com/fusion/file/teameps.pdf)
OMT: The Object Modeling Technique was developed by James Rumbaugh and others, and
published in the seminal OO book, Object-Oriented Modeling and Design (Prentice
Hall, 1991). A method preaching iterative analysis and design, heavy on the analysis
side.
Booch: Similar to OMT, and also very popular, Grady Booch's first and second editions of
Object-Oriented Design, With Applications (Benjamin Cummings, 1991 and 1994)
detail a method preaching iterative analysis and design, heavy on the design side.
In addition, many organizations have developed their own internal methodology, using different diagrams and
techniques from various sources. Examples are the Catalyst methodology by Computer Sciences Corporation
(CSC) or the Worldwide Solution Design and Delivery Method (WSDDM) by IBM. These methodologies
vary, but generally combine workflow analysis, requirements capture, and business modeling with data
modeling, with object modeling using various notations (OMT, Booch, etc), and sometimes include additional
object-modeling techniques such as Use Cases and CRC cards. Most of these organizations are adopting and
incorporating UML as the object-oriented notation of their methodology.
Some modelers will use a subset of UML to model what they’re after, for example just the class diagram, or just
the class and sequence diagrams with Use Cases. Others will use a fuller suite, including the state and
activity diagrams to model real-time systems and the implementation diagram to model distributed systems.
Still others will not be satisfied with the diagrams offered by UML, and will need to extend UML with other
diagrams such as relational data models and CRC cards.
UML 1.1 Extensions
Built-in extensibility mechanisms enable UML to be a somewhat open specification that can cover aspects of
modeling not specified in the 1.1 document. These mechanisms enable UML's notation and semantics to be
expanded.
Stereotypes
Stereotype is the most widely used built-in extensibility mechanism within UML. A stereotype represents a
usage distinction. It can be applied to any modeling element, including classes, packages, inheritance
relationships, etc. For example, a class with stereotype <<actor>> is a class used as an external agent in
business modeling. A template class is modeled as a class with stereotype <<parameterized>>, meaning it
contains parameters.
Business Modeling Extensions
A separate document within UML specification calls out specific class and association stereotypes that
extend UML to cover business-modeling concepts. This includes stereotyping a class as an actor, a worker
(both internal and case), or an entity, and stereotyping an association as a simple communication, or a
subscription between a source and a target.
Object Constraint Language (OCL)
A picture can only describe so many words. Similarly, a graphical model can only describe a certain amount of
behavior, after which it is necessary to fill in additional details with words. Describing something with words,
however, almost always results in ambiguities; i.e., "what did he mean when he wrote that?" The Object