Use Case Driven Object Modeling With UML - A Practical Approach - Rosenberg, Doug PDF
Use Case Driven Object Modeling With UML - A Practical Approach - Rosenberg, Doug PDF
Object Modeling
WITH UML
A Practical Approach
DOUG ROSENBERG
WITH KENDALL SCOTT
OBJECT TECHNOLOGY
_ M
ni
https://archive.0rg/details/usecasedrivenobjOOOOrose
Use Case Driven
Object Modeling
with UML
The Addison-Wesley Object Technology Series
Grady Booch, Ivar Jacobson, and James Rumbaugh, Series Editors
For more information check out the series web site [http://www.awl.com /cseng/otseries/] as well as the pages
on each book [http://www.awl.com/cseng/I-S-B-N/] (I-S-B-N represents the actual ISBN, including dashes).
David Beilin and Susan Suchman Simone, The CRC Card Book, * Thomas Mowbray and William Ruh, Inside CORBA: Distributed
ISBN 0-201-89535-8 Object Standards and Applications, ISBN 0-201-89540-4
Grady Booch, Object Solutions: Managing the Object-Oriented Bemd Oestereich, Developing Software with UML: Object-
Project, ISBN 0-8053-0594-7 Oriented Analysis and Design in Practice, ISBN 0-201-39826-5
Grady Booch, Object-Oriented Analysis and Design with Ira Pohl, Object-Oriented Programming Using C++, Second
Applications, Second Edition, ISBN 0-8053-5340-2 Edition, ISBN 0-201-89550-1
Grady Booch, James Rumbaugh, and Ivar Jacobson, The Unified Rob Pooley and Perdita Stevens, Using UML: Software
Modeling Language User Guide, ISBN 0-201-57168-4 Engineering with Objects and Components, ISBN 0-201-36067-5
Don Box, Essential COM, ISBN 0-201-63446-5 Terry Quatrani, Visual Modeling with Rational Rose and UML,
Don Box, Keith Brown, Tim Ewald, and Chris Sells, Effective ISBN 0-201-31016-3
COM: 50 Ways to Improve Your COM and MTS-based Brent E. Rector and Chris Sells, ATL Internals,
Applications, ISBN 0-201-37968-6 ISBN 0-201-69589-8
Alistair Cockburn, Surviving Object-Oriented Projects: A Doug Rosenberg with Kendall Scott, Use Case Driven Object
Manager’s Guide, ISBN 0-201-49834-0 Modeling with UML: A Practical Approach, ISBN 0-201-43289-7
Dave Collins, Designing Object-Oriented User Interfaces, Walker Royce, Software Project Management: A Unified
ISBN 0-8053-5350-X Framework, ISBN 0-201-30958-0
Bmce Powel Douglass, Doing Hard Time: Designing and William Ruh, Thomas Herron, and Paul Klinker, HOP Complete:
Implementing Embedded Systems with UML, Middleware Interoperability and Distributed Object Standards,
ISBN 0-201-49837-5 ISBN 0-201-37925-2
Bruce Powel Douglass, Real-Time UML: Developing Efficient James Rumbaugh, Ivar Jacobson, and Grady Booch, The Unified
Objects for Embedded Systems, ISBN 0-201-32579-9 Modeling Language Reference Manual, ISBN 0-201-30998-X
Desmond F. D’Souza and Alan Cameron Wills, Objects, Geri Schneider and Jason P. Winters, Applying Use Cases:
Components, and Frameworks with UML: The Catalysis A Practical Guide, ISBN 0-201-30981-5
Approach, ISBN 0-201-31012-0 Yen-Ping Shan and Ralph H. Earle, Enterprise Computing with
Martin Fowler, Analysis Patterns: Reusable Object Models, Objects: From Client/Server Environments to the Internet,
ISBN 0-201-89542-0 ISBN 0-201-32566-7
Martin Fowler, Refactoring: Improving the Design of Existing David N. Smith, IBM Smalltalk: The Language,
Code, ISBN 0-201-48567-2 ISBN 0-8053-0908-X
Martin Fowler with Kendall Scott, UML Distilled: Applying the Daniel Tkach, Walter Fang, and Andrew So, Visual Modeling
Standard Object Modeling Language, ISBN 0-201-32563-2 Technique: Object Technology Using Visual Programming,
Peter Heinckiens, Building Scalable Database Applications: ISBN 0-8053-2574-3
Object-Oriented Design, Architectures, and Implementations, Daniel Tkach and Richard Puttick, Object Technology in
ISBN 0-201-31013-9 Application Development, Second Edition, ISBN 0-201-49833-2
Ivar Jacobson, Grady Booch, and James Rumbaugh, The Unified Jos Warmer and Anneke Kleppe, The Object Constraint
Software Development Process, ISBN 0-201-57169-2 Language: Precise Modeling with UML, ISBN 0-201-37940-6
Ivar Jacobson, Magnus Christerson, Patrik Jonsson, and Gunnar
Overgaard, Object-Oriented Software Engineering: A Use Case
Driven Approach, ISBN 0-201-54435-0
Ivar Jacobson, Maria Ericsson, and Agneta Jacobson, The Object
Advantage: Business Process Reengineering with Object
Technology, ISBN 0-201-42289-1
Ivar Jacobson, Martin Griss, and Patrik Jonsson, Software Reuse:
Architecture, Process and Organization for Business Success,
ISBN 0-201-92476-5
David Jordan, C++ Object Databases: Programming with the
ODMG Standard, ISBN 0-201-63488-0
Philippe Kruchten, The Rational Unified Process: An
Introduction, ISBN 0-201-60459-0
Wilf LaLonde, Discovering Smalltalk, ISBN 0-8053-2720-7
Lockheed Martin Advanced Concepts Center and Rational
Software Corporation, Succeeding with the Booch and OMT
Methods: A Practical Approach, ISBN 0-8053-2279-5
Use Case Driven
Object Modeling
with UML
A Practical Approach
Doug Rosenberg
with
Kendall Scott
A
▼▼
ADDISON-WESLEY
An imprint of Addison Wesley Longman, Inc.
Reading, Massachusetts • Harlow, England • Menlo Park, California
Berkeley, California • Don Mills, Ontario • Sydney
Bonn • Amsterdam • Tokyo • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and Addison Wesley
Longman, Inc., was aware of a trademark claim, the designations have been printed in initial cap¬
ital letters or all capital letters.
The authors and publisher have taken care in preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of
the information or programs contained herein.
The publisher offers discoimts on this book when ordered in quantity for special sales. For more
information, please contact:
Rosenberg, Doug.
Use case driven object modeling with UML : a practical approach /
Doug Rosenberg with Kendall Scott.
p. cm. — (Addison-Wesley object technology series)
Includes bibliographical references and index.
ISBN 0-201-43289-7 (alk. paper)
1. Object-oriented methods (Computer science) 2. UML (Computer
science) 3. Use cases (Systems engineering) 1. Scott, KendaU.
11. Title III. Series
QA76.9.035R66 1999
005.ri7—dc21 99-12043
CIP
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,
or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior written consent of the publisher. Printed in the United States of
America. Published simultaneously in Canada.
ISBN 0-201-43289-7
Text printed on recycled and acid-free paper
123456789 lO-CRS-03 02 01 00 99
First printing, March 1999
Contents
Figures.ix
Top 10 Lists.xiii
Preface.xv
Chapter 8: Implementation.135
Project Staffing Issues.136
Project Management.137
Revisiting the Static Model.138
Allocating Classes to Components.139
Code Headers.139
Testing.142
Metrics.143
Tracking Use Case Driven Development.146
Wrapping Up.147
Bibliography.157
Index.159
-VVij. II ,
Ml . . r ^ '■.' /I .»:.
lii_ .'‘.•I-♦■'
r 7'
iM' i" -.V'^ w'i .-mKijtiii'l
i^ii' I 'Jv' I'^A
''■ti'Wfn wjm^
ftl
• ' « _ , ^
'i-iit I « ' 'ft ' k. A
r ■ ■ • t-, ’'.it AfiJn!
,, ■ ^iiiiiM««lii^... -• '*•*',
, .'■' : HVi’
■«,■ ..ir''’*-' .»''>■ il.J. iJ l-ii
f.Cf . . V'l,'. ■■■■‘-
- "mi-if"
iF-' -"■'.
^liiUrc*; -» ■ IMII' v lKlo-^- ' ' 'I :• >>|I
i-ni—
'. 1 ''.II. ^I* ’'I .'•.*••,
»^f
v-.‘- ■ I.- ""' ■' " • ’ *' ■ :
1^'—’♦ ’ ■•■ifl;»*ij’^Mil'* ‘ ■' r ‘ ' ^
o , ■ ‘IP ’ .«■&••'
v.\ — . -t - . . ■ . iKi'uw!*-
r^i
• O'v'' ''v<W''
*iv ' * ■iV}ti).'^t4' X;^i.lUfr«_. i/i
••«./»,. vLW.‘I ‘ uiitVw . , . > , , r.
'‘itf .. :■ . r-i.. ^ ^
; L( .4 *■
@ A
/'I','. :. J J viovi.T(i iftH ^
. I.. t' 7. --. ••
I )
• .1 .'"I * '■ ‘
- i ■^impkF- »j f
•>
A, ”»i
^ ivrj
*. >«
Figures
ALERT! Don't try to write use cases until you know what
the users will actually be doing.46
’ r'i n; H
t >4* * •A
I . -,:«tr 4'**:"-■*.'
f -
*5-^'
** r, j'■••»* ^ i - .. - i r. ■ ^ * r
».* ' -M ' '<
I
'!ckA V . AAfv ... ^ V—•-
^ i.
* • -
^ Ittt**-yt^' w, 4 ‘TT--^;
.i* .'
,,■ »ir.> CTiSil ,iV},;j}v i,Ty/7 I;
rrii*-*
Hk » ip SSLt^ ..• ' S*''
;/Ve- ' ? Jt'J .f^
w^'W
.. . f>.^
•^4
• K‘ ■
« • I « •.
. >r. » yu 1 im,
ii*
Top 10 Lists
■ .: P • .v_? ' .V •
* ■.."
. I . i...v,)«Ji»ar?iu»'<A3uiJ*“v/ l,!
. jlK-‘
fi Ml . ik>i>D Jjrtmn ititq«^ ¥? < 4 Ui k^-v '• W q|*)1
, ‘V:*
V
•>
«
*♦
*
■ ■ ' I'l
*4
*•
h- ■
ff
Preface
We've written this book with the following presumptions about you,
the reader:
• You'd like to write some code, eventually, but you've decided that
first you're going to do good, thorough OO analysis and design,
expressed in the UML.
• You'd like to write this code during the useful life of your project.
• You'd like this code to meet the requirements of your users (in
other words, you'd like to be use case driven in your modeling
efforts).
• You'd like a solid, maintainable, resilient OO architecture within
which to organize your code.
This book is designed to help you get from point A (use cases) to point
B (code) in the most efficient manner possible, using an approach
that's been proven to work on a wide variety of projects. In short. I'm
aiming to answer the following question:
Use Case
Model
Allow me to explain.
In a couple of cases, where they make the job easier, I use extensions to
standard UML. I make no apologies for doing this: the UML was
designed to be extensible, and rightly so. The extensions that I advo¬
cate in this book work—they save time and money, and yield good
results as well. The positive results associated with my years of teach¬
ing experience, in connection with dozens of projects in a wide range
of industries, support that last statement.
Before we can write use case text, we need to identify the main
abstractions present in the problem domain. In other words, we need a
domain model. Thus, Chapter 2: Domain Modeling.
We'd like to highlight two features that we think help make this book
unique in the world of OO.
• "Top 10" lists appear at the end of each chapter after Chapter 1.
These summarize the points I make within the preceding text in
ways that I hope you will find handy for repeated reference.
Preface
I should also point out that this book is considerably more fun, not to
mention funnier, than most OO books.
Acknowledgments
Although this book is written in my voice, it was actually written, for
the most part, by Kendall Scott. This, of course, makes him completely
responsible for anything you may not like about it, while I am com¬
pletely responsible for everything else (that is, all of the good stuff).
If you've never had a book written for you in your voice (and you
probably haven't), it's actually quite an interesting process, involving
a lot of mumbling "Did I actually say that?" to yourself. My advice to
you is, don't attempt it unless you happen to be working with a hel¬
luva good writer, like Kendall. (Hold your calls to Kendall, though—
we had so much fun writing this book that we're now threatening to
do another one.)
Most of this book was written by E-mail. A very fortunate thing hap¬
pened early on in this process: we each discovered that the other guy
had a similarly twisted sense of humor. Luckily, no other human will
ever see the very long chain of mail messages that led up to the cre¬
ation of this epic. (We learned one thing from the big Microsoft anti¬
trust litigation, anyway.)
At any rate, we hope that whatever kind of bizarre and unique chem¬
istry came about from this unholy alliance has resulted in a book that
you will actually enjoy reading and find useful, all at the same time.
This book would, of course, never have happened had it not been for
the work of the three amigos, and particularly for the work that Ivar
Jacobson et al. did several years ago in Sweden, where they actually
figured out this step-by-step approach to OOA&D. I sincerely hope
that work doesn't get lost in the shuffle of "the new and improved way
of doing business."
Preface
I'd also like to express my appreciation for the folks (you know who
you are) who critiqued our work in progress during training work¬
shops that I held around the country during the past year.
And, thanks to Lucy Guerrero, Alex Polack, and Cliff Sadler of Doc-
Express, who were kind enough to help out with some of the diagrams
on short notice.
Doug Rosenberg
Santa Monica, California
February 1999
[email protected]
http://www.iconixsw.com/Doug
)»m ,'i:^-‘'‘tf|g||i,i»
'-1 '■■tl i ■ . ,
iV
t ■»»T
^ '-* '<’11-,, -i, *;, •• '■■ Svfc' ., V - *
• ‘H' " ■' ‘v '■ ^ i ■> V<r#-
I #K,» ^
•tr •
's
Chapter 1
Figure 1-1 is the "big picture" that shows the key elements of the
ICONIX approach. It appears, in various forms, throughout the book.
This book details the ICONIX Unified Object Modeling approach. The
approach evolved from my company's practical application of theory
presented by the "three amigos"—Grady Booch, Jim Rumbaugh, and
Dynamic n
'''CD
GUI Prototype
Use Case O-O-O
Sequence
Diagram
C ^ Robustness
Diagram ^
i
V V
Static
n
1 1 Code
Domain Class
Model Diagram
The motivation for this book is easy to explain. Benefits of a use case
driven approach are so great that they have become obvious to a wide
range of people. Yet over the past five years, it has become clear to me
that an enormous amount of confusion exists about the practical
details of how to drive object models from use cases. This book
attempts to resolve that confusion.
The key difference between this book and the amigos' forthcoming
book about the Rational Unified Process (RUP) involves "altitude." I
see the brilliant methodologists who created the UML as operating at,
say, 30,000 feet above the earth, while I'm more like 1,000 feet off the
ground, helping people take the great OO ideas and use them every
day to build great software systems.
As I write this, the RUP is still very new. I'm sure it will be well
received, but there won't be much empirical data available for a while.
V
countries have purchased CD-ROM tutorials about the ICONIX
approach, I think it's safe to say that there are few, if any, people whose
unified modeling approaches have been introduced to more projects in
the field. Visit http://www.iconixsw.com/CDcourses.html for more
information about these tutorials.
Background
The landscape was littered with object-oriented (OO) methods books
between 1991 and 1993. One could just about join the Method of the
Month Club. At that time, I was the creator of a multi-method object-
oriented analysis and design (OOA&D) visual modeling tool trying to:
• Determine which methods my company should incorporate into
the tool (no available method seemed sufficient on its own).
• Teach our clients how to succeed with the various methods we
were already supporting.
• Explain to the public why we thought multiple methods made
more sense than any single method.
Sitting at this vantage point forced us to evaluate all the viable OO
methods that were out there, and to identify the strengths and weak¬
nesses of each. When we did this, some clear synergies between
approaches became obvious.
At the beginning of 1993, it became clear to us at ICONIX that there
were three major schools of thought emerging in the object-oriented
methods community.
We called these schools data-centered (derived largely from entity-rela¬
tionship modeling), scenario-based, and structural (focused on the struc¬
ture of the code).
Data-centered methods build on techniques familiar to people who
have experience doing structured analysis and design. This category
includes Shlaer/Mellor, Martin/Odell, and Rumbaugh's OMT. These
methods include the likes of entity-relationship diagrams (ERDs),
data-flow diagrams (DFDs), and state-transition diagrams. A data-cen¬
tered method decomposes a system along data boundaries.
Structural methods start with an OO programming perspective and
work from the ground up. The methods developed by Grady Booch
Chapter 1 T The ICONIX Unieied Object Modeling Approach
Around 1993, the "best of breed" within each category seemed to be,
respectively, Rumbaugh's Object Modeling Technique (OMT), Jacob¬
son's Object-Oriented Software Engineering (OOSE), and Booch's
methodology (usually referred to as the Booch method). We looked
hard at the strengths and weaknesses of each and published a series of
articles in OBJECT magazine, which focused on the best ways to use
the three together. The articles include:
1. Who are the users of the system (the actors), and what are they try¬
ing to do?
2. What are the "real world" (problem domain) objects and the asso¬
ciations among them?
3. What objects are needed for each use case?
4. How do the objects collaborating within each use case interact?
5. How will we handle real-time control issues?
6. How are we really going to build this system on a nuts-and-bolts
level?
Chapter 1 T The ICONIX Unified Object Modeling Approach
I have yet to come across a system that doesn't need to have these
basic questions answered, or one that couldn't use the techniques
described in this book to help answer them using an iterative, incre¬
mental, opportunistic (when you see the answer, capture it) approach.
Until recently, one had to piece techniques together from the individ¬
ual methodologies. What's nice about the UML is that now, the tech¬
niques are conveniently collected together in the context of one
notation.
Table 1-1 shows which methodology provided us with the best answer
to each question, along with the corresponding UML tool or technique.
Although the full approach does present the steps in a specific order,
it's not crucial that you follow the steps in that order. Many a project
has died a horrible death because of a heavy, restrictive, overly pre¬
scriptive "cement collar" process, and I am by no means a proponent
of this approach. What I am saying is that missing answers to any of
these questions will add a significant amount of risk to a development
effort.
Let's look again at the top-level view of the ICONIX Unified Object
Modeling approach that evolved from our efforts at method synthesis.
(See Figure 1-2.)
As you can see, integrating the best elements of the Booch, Rumbaugh,
and Jacobson approaches provides a very complete picture for object-
oriented software development.
In fact, 1 haven't met many people (or teams) who are immune to the
same error. It's a very comforting feeling, for both your team and your
prospective users (not to mention your clients), to know that you have
actually worked through all the use cases.
In keeping with the last item in the previous list, a recurring theme of
this book is analysis paralysis—specifically, how to avoid it. I've used
the following icon throughout the text in connection with this phe¬
nomenon:
Thoughts on Methodology
In developing the ICONIX Unified approach, we had to violate, to
some extent, the rules and semantics of all three approaches that
Process Fundamentals
This book does not suggest that you should abandon all guidelines
and rules of methodology. However, projects run into problems when
methodology becomes dogma.
Process Fundamentals
1 believe the best way to make process more attractive is to educate as
many people as possible about the benefits of answering the questions
I raised earlier, along with similar questions, and to the risks of failing
%-
The people who have to use the process, and management, are both
customers of a software development process. I think of a process as a
road map for a team to follow, a map that identifies a set of landmarks,
or milestones, along the way to producing a quality product.
There are various paths a team can travel, depending on the capabili¬
ties and preferences of its members. But no matter which path they go
down, at some point, they must reach the milestones. It is at these
points in the process that their work becomes visible to manage¬
ment—during reviews of intermediate results. Passing the milestones
does not guarantee a quality product, but it should greatly improve
the chances.
• The team has identified and described all the usage scenarios for
the system it's about to build.
• The team has taken a hard look for reusable abstractions (classes)
that participate in multiple scenarios.
• The team has thought about the problem domain and has identi¬
fied classes that belong to that domain—in other words, the team
has thought about reusability beyond just this system.
• The team has verified that all functional requirements of the sys¬
tem are accounted for in the design.
• The team has thought carefully about how the required system
behavior gets allocated to the identified abstractions, taking into
consideration good design principles such as minimizing cou¬
pling, maximizing cohesion, generality, sufficiency, and so forth.
'no
system a system b
V
2. Work outward from the data requirements.
\
system c system d
Code
• Perform unit and integration testing.
Milestone 4: Delivery
'♦V' ytvr y.
y.. ».,i
m
M 1 I «
5-
.
• ^i, * I ' tiiiA. * ‘ »»»■ ,ri
■?:’ .1
wTj^ ■'
r '* ‘ K’
..tj> i
i ^ f ;
I'^r * -r'»“'"*ifJ^
■^( ■ .(U''.'i»*'' . j '•-.rn/
'i>
Chapter 2
Domain Modeling
The term problem domain refers to the area that encompasses real-
world things and concepts related to the problem that the system is
being designed to solve. Domain modeling is the task of discovering
"objects" (classes, actually) that represent those things and concepts.
Code
▼ Chapter 2 T Domain Modeling
system a system b
\_/
system c system d
Chapter 4 describes how the domain modeling and use case develop¬
ment paths merge. In combination with later chapters, the text in
Chapter 4 reinforces the principle, central to the approach, that the
dynamic model drives the static model. The domain model thus serves
as a glossary of terms that writers of use cases can use in the early
stages of that effort. (This is the main reason why I talk about domain
modeling before use cases.)
Please note that I am not interested in adding more fuel to the static¬
modeling fire. Plenty of books are devoted to this subject, and this
book isn't intended to be one more.
Discover Classes
Jim Rumbaugh defines a class as "a description of a group of objects
with similar properties, common behavior, common relationships, and
common semantics." The first thing you need to do in building a static
model of your system is to find appropriate classes that accurately rep¬
resent the real abstractions the problem domain presents. If you exe¬
cute this activity well, you will have not only a solid foundation on
which to build the system, but also excellent prospects for reuse by sys¬
tems that will be designed and built down the line. (Other systems
that you build can share these domain classes.)
To get started on the road to discovery, lay out as many relevant state¬
ments from these areas (and even others such as marketing literature)
as you can find, and then circle, or highlight, all the nouns and noun
phrases. Chances are good that you will find a large majority of the
important domain objects (classes) this way.
The next step is to sift through your list of candidate classes and elimi¬
nate the items that are unnecessary (because they're redundant or
irrelevant) or incorrect (because they're too vague, or they represent
things or concepts outside the scope of the model, or they represent
actions even though they're phrased as nouns).
%
The entry of a trade shall generate forecasted cashflows associated with the
given trade lot.
The system shall allow an Assistant Trader to modify trade data and
propagate the results appropriately.
Here's how the thought process might go with regard to our list.
1. Assistant Trader, Portfolio Manager, and Trader are actors, and thus
should be placed on use case diagrams.
2. The word entry implies action, so it's not a class. (It may turn out
later to be an operation.)
3. General Ledger is an entity that lies outside the scope of the project;
the users have yet to define much in the way of accounting fea¬
tures they want to see. Because we have posting already, which we
know will be within the scope, let's take General Ledger out of our
list.
4. Looking at the first requirement again, we see that the word level is
closely tied to the verb phrase roll portfolios up, so we should make
a note and set level aside for now.
5. The word results and the phrase trade data are too vague to be of
particular use.
6. We have both order and sell order. Because we don't know much
about the nature of an order yet, except that given the presence of a
sell order, there's probably a need for a buy order, as well, let's
focus on order for now and address "buy" and "sell" later. Note,
though, that buy and sell are "kinds of" orders.
7. The word system is too vague to be the name of an object.
Just as the initial list looked rather too large, this list appears to be a lit¬
tle thin. At this point, we need to go back and discover more classes by
reading between the lines of the problem statement and requirements,
and by exploring the available domain expertise further. Within our
example system, we uncover six more classes by writing out the fol¬
lowing statements.
Figure 2-6 illustrates two notations you can use to represent a class on
a class diagram. The one on the left shows the full form. Because we're
▼
Trade
attributes Trade
operations
trying to show the "big picture" of our domain model for now, how¬
ever, I also provide a more compact notation, on the right, which you
can use before you know the other elements of a given class. I use this
simpler notation in the rest of this chapter, for the most part, and then
switch to full class boxes throughout the rest of the book.
The subclass inherits the attributes and methods defined for the super¬
class, and also the associations in which the superclass is involved.
The subclass can use these features of its superclass as is, or it can
modify them for more-specialized purposes. You can also add
attributes and methods to the subclass that aren't available to the
superclass.
Within our example system. Trade and Investment are good candidates
for subtyping.
As we've delved more deeply into the user's needs for the new sys¬
tem, we've discovered that there are indeed aspects of buy and sell
V
However, we know that an Order generates a Trade. It's also the case
that the differences between buying and selling seem to relate more to
the nature of a Trade than to that of an Order. So let's attach the con¬
cepts of buy and sell to Trade and focus on how Trade lends itself to
generalizations.
Two new classes, named Buy and Sell, inherit the attributes and meth¬
ods we've defined for Trade. We'll add one new attribute called
assumedPrice to Buy. And we'll note that Buy will now be the class
that sends "create" messages to TradeLot, and Sell will send messages
to TradeLot about that class's disposeQuantity method.
If you need to, and you're comfortable doing so at this stage of the pro¬
cess, you can generalize to more than one level of subclass. Remember
to look for kind-of statements that are true in the "real world."
Build your list of candidate associations from your list of verbs and
verb phrases and also from your knowledge of the problem domain,
requirements, and so forth. Refine the list by removing anything that
clearly states an action rather than a dependency or that's specifically
related to implementation or is otherwise not relevant during this
phase of the process.
Figure 2-9 contains a first cut at a list of associations for the currently
known classes within our example system.
Chapter 2 T Domain Modeling
You don't need to worry at this stage about being more spe¬
cific about the numbers on the many side of one-to-many
associations. These are details you will address later in the
project. Actually, you can avoid dealing with multiplicity
altogether during domain modeling—it chews up time and can be a
major cause of analysis paralysis.
Order Trade
1 *
attributes attributes Portfolio Position
generates holds
operations operations
You can see that some verbs in the associations in our example system
(for instance, generates) are action verbs. WeTl look at these more closely
during sequence diagramming, in Chapter 5. Meanwhile, we can make
further refinements involving two special types of associations.
Most domain models I've seen over the years have at least one or two
link classes. However, you need to be careful not to overuse this con¬
struct.
Figure 2-13 shows a class that would make it into our sample system's
static model if we were to bring it over intact from the associated RDB
table in the original system.
Trade
«
1 Acctg Appr ID
Ledger Date
Post Date
Settlement Type
Collateral Flag L
Instructions
Adjusted Quantity Insured Flag
Amounts Average Life PSA
Factor
1
Rebook Flag
Orig Book Value r
Adjusted Price
Orig Face Value
Decimal Price
Orig Norn. Amount
Market Price
Par Amount Prices and
Market Price Source
Quantity Yields
Modified Duration
Confirm Number Price
Covered Flag Price Yield
Currency Rate Spread
Date Spread Basis
Cash Amount Trade Yield
Commission Trader Yield
Commission Rate Trading Fraction
Commission Type Underlying Price
L
Fees
Repay End Date
Foreign Tax
Repay Start Date
Funds Type
Soft Commission
Settlement Fee
Tax BV Method
Discount Percent Ticket Number
DTC Eligible Acquire or Dispose
Foreign Source Type
Figure 2-14 shows the helper classes we created for Trade based on
these attribute groupings, along with helpers for other big classes.
Figure 2-15 shows the original contents of what will become our
Investment class. Figure 2-16 shows the associated helper classes.
Investment
Affiliate Code
Convertible Flag
Country Code
Date Added
Dated Date
Paydown Days Delay
Days Delay Method
Paydown Date
Paydown FirstDay
PaydownSecondDay
Prev Paydown Date
Description
Description 1
Description 2
DTC Eligible
Fixed Rate
Income Producing
Interest Only
Issue Date
Maturity Date Payment
Orig Issue Amount
Par Value per Share
Payment Date
Payment Detail Ind.
Payment First Day
Payment Second Day
Perpetual Flag
Prev Payment Date
Sinking Fund Flag
Trade Yield Comp Freq
Funds Type
Liquidity Flag
Number
Owned Indicator
Private Placement
Short Description
State Code
Total Voting Shares
Type of Investment
Figure 2-14 and Figure 2-16 show chunks of the full static model at this
stage of our example system project. Figure 2-17 shows the rest of this
model—the relationships among all the main classes we've identified
to date.
However, this does not mean that you should keep grinding nouns
and verbs (which, in my experience, can happen without warning if
you follow Derr's approach [see page 17] too vigilantly) until you turn
perfectly good steak into hamburger (and half your team quits as a
result), nor should you threaten your analysts with burnout. The goal
is to htiild a glossary of class names that will serve as the nouns, as
appropriate, within your use case text.
I also recommend that you establish a time budget for building your
initial domain model. You should be vigilant about making necessary
adjustments to your analysis-level class model in response to occur¬
rences during robustness analysis and throughout the project.
Please note that the diagram you draw during domain modeling,
however detailed, is still just a skeleton of your object model. Now it's
time to add meat to those bones and develop the dynamic model by
generating use cases, discussed in Chapter 3; refining the static and
dynamic models with robustness analysis, discussed in Chapter 4; and
entering detailed design based on the dynamic model with interaction
modeling, the subject of Chapter 5. If you're smart, you'll update your
static model as you go.
9. Do noun and verb analysis so exhaustive that you pass out along the way.
*wi
»
.1 t‘^
yM
yi’ ‘f’ fi^\M.»it4j^»iT> nAv'x^i •>
KJ ’i.i'jfin ^i':#'.-..* mH !l?!;’^-,.v*.
'• •• ' ^ -
Within the Unified Object Modeling approach, one of the early steps
involves building a use case model. The essence of this model is to
capture user requirements of a new system, whether it's being devel¬
oped from scratch or based on an existing system, by detailing all the
scenarios that users will be performing.
V V
Code
Chapter 3 ▼ Use Case Modeling
The use case model is at the conceptual center of the approach because
it drives everything that follows, as you can see in the following list of
the other key elements of the approach.
The dynamic model gets started with use case analysis. This effort
involves working inward from the user requirements, as shown in
Figure 3-1.
As you'll see from this point forward, use cases do more than get the
dynamic model started—rather, they drive the dynamic model and, by
extension, the entire development effort.
A use case is most effectively stated from the perspective of the user as
a present-tense verb phrase in active voice. For instance, one use case
within a hospital system might be called Admit Patient, while a port¬
folio system is likely to contain use cases named Do Trade Entry,
Update Portfolio Information, and Generate Reports.
A user can serve as more than one type of actor. For instance, a Nurse
might perform administrative duties. Similarly, more than one user
can appear as a particular actor (for instance, multiple Trading Assis¬
tants interacting with a portfolio system).
We show use cases and actors on a use case diagram. Within a use case
diagram, use cases appear as ovals, generally in the middle of the dia¬
gram; actors appear as stick figures to the left and right.
We'll focus our efforts on design-level use cases, which some people
call scenarios. You should be able to write a solid paragraph or two
about a design-level use case. If you find yourself able to capture the
essence of a proposed use case in, say, one sentence, it's likely you're
breaking your system usage down too finely.
You should keep one overriding principle in mind at all times in your
effort to identify use cases: They should have strong correlations with
material in the user manual for the system. It should be obvious what
the connection is between each use case and a distinct section of your
user guide. This reinforces the fundamental notion that you are con¬
forming the design of your system to the viewpoints of the users. It
also provides a convenient summary of what "use case driven" means:
Write the user manual, then write the code.
Tve found over the years that the best way to identify chunks of use
cases in connection with a prototype is to write a rough user manual,
as if the prototype were an actual fully working system. The manual
certainly doesn't have to be polished; the idea is to describe the pri¬
mary functions that users of the "system" perform, in language that's
clear and unambiguous.
You will retrieve mostly basic courses of action from a prototype user
guide, because by definition, "rapid" prototyping generally involves
ignoring alternative courses (that is, exceptions). Be careful about this,
though. After all, if all you had to build was a system that addressed
basic courses, you'd probably finish ahead of schedule! (I'll reinforce
this idea to a healthy extent later in the chapter.)
Taking this idea one step further. I've found that exploring the graphical
user interface (GUI) design in parallel with the required system behav¬
ior is generally an excellent approach. This involves iterating, with the
users, the presentation aspects of the system, and after achieving closure
on a couple of screens, writing the associated use cases. This bouncing
back and forth can be very effective in the right environment.
O Buy
O Sell
Ticket Number
O Short
O Cover
Proceed^ Cancel ^
◄-—► -►
Return required Return not required
window where she can start a new list; selecting Open from that menu
will take her to a window where she can retrieve an existing list.
Regardless of which path she takes, she must return to the main win¬
dow, where she can press the Details button to bring up a "modify
price details" window.
The coupling between the screen and the text is obvious, as is the
similarity between this text and the use case text we've been presenting.
It's also true, though, that each piece can stand on its own. Just as a
technical writer might choose to import that screen shot "by reference"
instead of copying it directly into the manual, one might think of the use
case model as incorporating the user interface model by reference.
I need to point out here that not only shouldn't your use case text
include too many presentation details, but it should be relatively free
of details about the fields on your screens, as well. Field names often
match up directly with the names of attributes on your domain
classes, which I talk about in the next chapter. The narrative of a use
case should be event-response oriented, as in, "The system does this
when the user does that."
ALERT! Don’t try to write use cases until you know what the
users will actually be doing.
%
This captures the basic points, but it's rather terse. When it comes to
writing text for use cases, expansive is much preferable to terse. Let's
see how we can improve and build upon this text.
Once you have some text in place for a use case, it's time to refine it by
making sure the sentences are clear and discrete, the verbs are strong,
and the actors and potential domain objects are easily identifiable.
(Later in this chapter, I will talk about updating your static model with
the results of your use case analysis. This is another recurring theme
within the ICONIX approach: The static model isn't really static until
the system works.) You are also likely to be in continuous learning
mode as work progresses with your users, so you'll have a chance to
add new knowledge to your text along the way.
As we walk through this use case, we can quickly classify the various
parts of speech in modeling terms. There is a human actor named
Assistant Trader. We can recognize objects named Trade and Investment
that are already part of our domain model. And there will also be
some kind of Trade Entry Window.
Chapter 4 describes the process by which you classify the objects you
identify via use case analysis as boundary objects, entity objects, and
control objects. Sometimes, it's actually easier to draw a robustness
diagram before writing use case text. Regardless of which comes first,
though, you need to keep in mind that you're not finished with a use
case until the text and the robustness diagram match.
We'll deal with the first question when we come back to this use case
in Chapter 5. The next section addresses the second question.
The basic course of action of a use case is the main start-to-finish path
the user will follow, under normal circumstances (the "sunny day"
scenario, in other words). For instance, within the Perform Trade Entry
use case, all the text we have at this point is for the basic course, such
as, "The system validates certain entries (for example, it makes sure
the settlement date does not precede the trade date) and then pro¬
cesses the trade appropriately." There is an implicit assumption that
the Assistant Trader has entered all the data for the given trade cor¬
rectly—the date doesn't precede the current date, the price is
expressed appropriately, and so forth.
Chapter 3 T Use Case Modeling
Basic courses of action are generally easier to identify and write text
for. That doesn't mean, however, you should put off dealing with
alternate courses until, say, detailed design. Far from it. In fact, all too
often I've seen nasty errors of omission cause serious problems at that
point in a project, when taking the time to write out alternate courses
up front would have saved the team considerable grief.
1. Create a use case template that has areas labeled Basic Course and
Alternate Courses. Don't put anything else in there; it'll just dis¬
tract you.
2. Ask "What happens?" This will get the basic course of action started.
3. Ask "And then what happens?" Keep asking that question until
you have all the details of your basic course on paper.
4. Be relentless. "What else can happen? Are there any other things
that can happen? Are you sure?" Keep asking those questions until
you have a rich set of alternate courses written down. Trust me:
Grief at this point is much easier to take than grief during, say,
integration testing.
The goal is not to construct an elegant use case model; the goal is to
account for everything the user might do.
You'll review this material before you finish use case modeling; you'll
review it again during robustness analysis (discussed in the next chapter);
and you'll review it once more during interaction modeling (see Chapter
5). This may seem excessive, but keep this in mind: The more well-
defined the system behavior, the easier it's going to be to build the system.
Factoring Out Commonality in Usage
1. Generalization works the same way with use cases as it does with
regular classes: The child use case inherits the behavior and mean¬
ing of the parent use case, and so forth. The notation is the same,
too. (See "Build Generalization Relationships" on page 21.)
2. The includes relationship (previously known as uses) involves
one use case making full use of another use case. This goes to the
issue of reuse, which is a prime objective of use case modeling,
since it helps us factor out commonality. This construct is pre¬
defined as a stereotype that you can add to a use case diagram;
you can also do what I do, and put "includes" as the label on the
arrow.
3. The extends relationship allows the modeler to insert one use case
into another use case, thus "extending" the second use case. The
main idea behind this construct is that you can use it to show
optional system behavior, or behavior that's executed only under
certain conditions. This is also predefined as a stereotype.
Because the UML defines a use case as one form of a class, use case
generalization is certainly a technically viable concept. However, I
don't generalize use cases, because generalization is most useful for
building elaborate structures dominated by abstract use cases.
The idea behind invokes is that one use case invokes another one in the
same basic marmer that a function invokes a peer function. You use
precedes to indicate that one use case needs to precede another within a
logical sequence.
One reason I like to see precedes on a use case diagram is that it helps
keep the focus on what's inside the given use case. It's all too easy to
get distracted by how you get there (that is, the precondition) and/or
by what happens once you leave (the postcondition).
Pick one of the nrechanisms I've described here, or another one that
V
you know about, and use it consistently. Nor should you insist on
using long and complex use case templates just because they appeared
in a book or article.
ALERT! Don’t waste time with long and involved use case tem¬
plates.
Consider the statements I just made as warnings about ways you
might build up resistance to doing use cases, which offers an excuse to
ditch modeling altogether—and we all know what happens then.
(Hint: "The code's written, so I guess we're done!")
The current text for the basic course of action of our Perform Trade
Entry use case, which appears at the bottom of page 46, is reasonable,
but it's still pretty generic, and it also lends itself to factoring. Let's see
how we can work with this text to create additional use cases, each of
which is more specific—and thus more useful—for our example sys¬
tem. This is all part of our ongoing exploration of how the users will
use the new system.
For starters, it turns out that buy trades and sell trades have certain
features in common, as well as some different characteristics.
1. Create new use cases called Enter Buy Trade and Enter Sell Trade.
These will capture the unique characteristics of the different types
of trades.
2. Create a use case called Perform Order Entry that precedes either of
the other new use cases. This will include the user behavior associ¬
ated with the order entry task we originally decided to lump in
with the trade entry task.
Eigure 3-7 shows the results of performing these steps, in a use case
diagram.
We can write the following text for the basic course of action of Per¬
form Order Entry.
The Assistant Trader (AT) uses an order entry window to
enter the data for an order that involves a buy or sell trade.
First, the AT specifies the trade type. Then the AT selects the
Chapter 3 T Use Case Modeling
We can use the preceding text as the basic course for Define Invest¬
ment. For our alternate course, we can lift the text from our now-obso-
lete Perform Trade Entry use case:
If the validation fails, notify the user, highlight the erroneous
values, and get new values from the user.
With this new use case in place, the second alternate course for Per¬
form Order Entry then becomes:
If the investment associated with the order has not yet been
defined, the system invokes the Define Investment use case.
In keeping with the idea of continuous improvement, the text for the
basic course of action for Perform Order Entry enables us to compress
the basic course of action for our new Enter Buy Trade use case. If we
assume that the user wants to enter a trade that involves a purchase of
bonds, the text might read:
The Assistant Trader (AT) uses a Bond Trade Entry window
to enter the primary values for the trade. The system
validates both general trade values and bond-specific values
(for instance, it makes sure the coupon rate is "reasonable")
before processing the trade.
And we can reuse the alternate course for Define Investment as the
alternative course for Enter Buy Trade:
If the validation fails, notify the user, highlight the erroneous
values, and get new values from the user.
At this point, we could define another new use case for error handling.
Given the different sorts of business rules associated with Trades and
Investments, which weTl have to address somewhere down the line
(during design), we won't go that route. Note, though, that it's always
a good idea to keep your eye open for opportunities to simplify and
clarify.
Before we proceed with the last two use cases that comprise our exam¬
ple system's use case model, notice that all the use case text in this sec¬
tion is in present tense and active voice, and that the sentences are
precise and clear.
This is the kind of text you would expect to see in a user manual. In
fact, it's often a good idea to bring a technical writer into the process at
▼ Chapter 3 T Use Case Modeling
this stage for that very reason. A seasoned tech writer has a good feel
for how to capture the essence of what a user wants to do. (Also, tech
writers are not likely to be in a hurry to cut code.)
The text for the basic course of action for our new Enter Sell Trade use
case, which is also preceded by Perform Order Entry, comprises the
basic course text for Enter Buy Trade with an extra sentence in the
middle to account for a key difference between buy and sell trades:
The Assistant Trader (AT) uses a Bond Trade Entry window
to enter the primary values for the trade. As part of this task,
the system brings up a pairoff window, which the AT uses to
select one or more buy trades to "pair off" with the new sell
trade.
I mentioned earlier that buys and sells have some common features.
Therefore, we can use Enter Buy Trade's alternate course for Enter Sell
Trade:
If the validation fails, notify the user, highlight the erroneous
values, and get new values from the user.
The last use case in our model has its roots in the following sentence
from our original attempt at writing text for Perform Trade Entry:
"The AT has the option of making changes to trade data later." (That
one almost slipped through the cracks! Attention to detail is crucial!)
Figure 3-8 shows the full use case diagram for our example system as
it now stands.
Figure 3-9 is a package diagram that shows two packages for our
example system: one that contains the use cases we've been looking at,
and another that holds use cases that might appear in another part of
the system. Note that you can put a class diagram in a package, too; a
Chapter 3 T Use Case Modeling
Enter
Sell
Trade
Perform
Order Enter
Entry Buy
Trade
Define
Investment
package can contain any other element of the UML (including another
package).
Note my use of the words may and functional. A system will have its
share of functional requirements, but it will also have other types of
requirements, such as those involving performance and maintainabil-
ity, that won't map well to use cases. I explore different types of
requirements and talk about the importance of traceability in connec¬
tion with those requirements in Chapter 7.
1. You've built use cases that together account for all of the desired
functionality of the system.
2. You've produced clear and concise written descriptions of the
basic course of action, along with appropriate alternate courses of
action, for each use case.
3. You've factored out scenarios common to more than one use case,
using the precedes and invokes constructs (or whichever constructs
you're most comfortable using).
Figure 3-10 and Figure 3-11 show the tasks I discussed in this chapter.
you have about the legacy system you are reengineering. I—n
>
Milestone 1: Requirements Review
Robustness Analysis
GUI Prototype
Code
Chapter 4 T Robustness Analysis
The amigos continue to point out the rather large analysis/design gap,
as evidenced by this passage from The Unified Modeling Language User
Guide (Addison-Wesley, 1998):
In software, the Achilles heel of structured analysis
techniques is the fact that there is a basic disconnect between
its analysis model and the system's design model. Failing to
bridge this chasm causes the system as conceived and the system as
built to diverge over time. [Emphasis added.] In object-oriented
systems, it is possible to cormect all the nearly independent
views of a system into one semantic whole.
Much to my dismay, the trend continues with the Rational Unified Pro¬
cess (RUP), into which robustness analysis seems to be disappearing.
/
Pm not sure why the amigos chose to skip preliminary design, but
regardless, I will explain why robustness analysis is so critical and
how to do it the way Jacobson intended.
Sanity Check
The diagrams you draw during this phase graphically depict the flow
within your use cases. In fact, as we'll see later in the chapter, you
should replace the generic nouns in your use case text with the proper
names of objects that appear in your robustness diagrams. In so
doing, you're forced to review the use case text. In most cases, you'll
want to refine it further before you move on to the next use case.
This refinement changes the nature of the use case text from a pure
user manual perspective to a usage description in the context of the
object model. As we'll see, this is the magic formula you need to build
useful sequence diagrams.
Completeness Check
Since robustness diagrams carry certain conventions—for instance,
actors should be connected only to boundary objects (see Figure 4-3 on
page 69 for the full set of rules)—iterating through your use cases in
this context will help you produce use case text that adheres to some
well-defined guidelines.
Because so much depends on the use cases, it's worth the effort to
make sure they're complete and written in an appropriate style. A
more or less uniform text style is critical to reviewability and also in
terms of heading off potential problems later in a project, when no one
wants to try to figure out what this or that writer meant.
I recommend you use sequence diagrams as the next design step (see
Chapter 5). If you do a proper robustness analysis, you'll find it much
easier to address the sequence diagrams. From a mechanical stand¬
point, this is because you can copy the names of boundary objects and
entity objects directly to get your sequence diagrams started. From a
productivity standpoint, if you skip robustness analysis, you run a risk
of not discovering all the objects you may need, and that risk is associ¬
ated with some potentially serious consequences.
Object Identification
Because this is the stage of the process in which you refine the proper
names you started assigning your objects during domain modeling,
you can also address naming discrepancies and conflicts before they
cause serious problems. For instance, one team may call something a
Cash Drawer) another team will refer to the same thing as a Cash Dis¬
penser. The resulting mess is not much fun to clean up as the teams
compare notes. A good rule to follow is: Use the names from the
domain model for your entity objects.
Preliminary Design
If you have a prototype in place, you can see what many of your pri¬
mary boundary objects will be. You can also easily pick boundary
objects out of your use case text. The window navigation diagram I
discussed in Chapter 3 can also be a useful source of boundary objects.
Looking ahead, you should associate what one might call local valida¬
tion logic with boundary objects. This includes any kind of error
checking that doesn't require an object to interact with other objects in
the system. For instance, in the context of a Trade Entry window, the
system will need to make sure the trade settlement date follows the
trade execution date, that neither date has a 13 in the month portion,
and so forth. For now, these should take the form of control objects
associated with your boundary objects; we'll defer the decision about
how to assign the logic until we do our sequence diagrams.
Entity objects often map to the database tables and files that hold the
information that needs to "outlive" use case execution. Many of your
entity objects will come from your domain model, which I discussed
in Chapter 2.
Unlike boundary objects and entity objects, controllers are not neces¬
sarily meant to endure as stand-alone classes as you proceed with
design. You're likely to find yourself converting many controllers into
methods associated with interface objects and entity objects. Control
objects serve as placeholders to make sure you don't forget any func¬
tionality and system behavior required by your use cases.
Before we go back to the example system again. I'd like to offer two
guiding principles.
1. I like to see a small number (say, between two and five) of control¬
lers per average use case. If you have only one controller per use
case, you're likely to have a lot of very small use cases.
A number between five and 10 is generally workable. But if you
have more than 10 control objects in a given use case, you should
consider splitting it.
2. Arrows can go in one or both directions between different types of
objects. An arrow pointing from a boundary object to a control
object indicates that the former is signalling the latter to perform.
Or there might be a two-headed arrow between a control object
and an entity object, signifying that they read from each other and
write to each other.
Note, however, that you need to use only one type of arrowhead,
which is not the case on several types of UML diagrams.
Unlike arrows on sequence diagrams, arrows on robustness dia¬
grams don't represent software messages; rather, they simply indi¬
cate logical associations. Because you won't code from these
diagrams, focus on the logical flow of your use case and worry
about the directions of arrows later, in your sequence diagrams.
Figure 4-3 shows what you can and cannot do on a robustness dia¬
gram.
Performing Robustness Analysis
Figure 4-4 contains the basic and alternate courses of action for two of
the use cases we wrote in Chapter 3.
These use cases will be our primary source for boundary objects in the
robustness diagrams we'll see shortly. The text is also a rich source of
entity objects, because we made a point of connecting it with our
domain model while we were writing it. We'll also be able to identify
some controllers we need.
Chapter 4 T Robustness Analysis
Once all of the necessary data is in place, the AT presses a button to tell the
system to process the order and bring up the appropriate type of trade
entry window. The AT will use that window to enter the primary data
for the trade connected with the new order.
Alternate Course: If the ticket number already exists, the system prompts
the AT to enter a new ticket number.
Alternate Course: If the investment associated with the given order has
not yet been defined, the system invokes the Define Investment use case.
Alternate Course: If the validation fails, notify the user, highlight the
erroneous values, and get new values from the user.
Let's analyze the Perform Order Entry use case and come up with
details we'll need for our robustness diagram.
• Because the value the AT specifies for the trade type will lead to
the system invoking either of two other use cases (Enter Buy Trade
or Enter Sell Trade), let's show this sub-task as the last one the AT
performs on the Order Entry window.
• That window has a list box that shows the available investments.
Underneath that, we'll need the actual list, as well as some kind of
control object that sits in the middle.
• The first alternate course of action says that the system needs to
check for a duplicate ticket number. So we've discovered our first
new object: a trade list. We also need controllers that get the num-
Performing Robustness Analysis
ber the AT enters and check that number against the list. If the
▼
number is a duplicate, the system will bring up a prompt for the
AT to enter a different number. If it's not a duplicate, the system
will go ahead and create a new Order object.
• The second alternate course tells us that Perform Order Entry
might invoke Define Investment. This calls for a boundary object
via which this will happen. We also need another new entity
object: an investment list.
Figure 4-5 shows a robustness diagram that might result from this
analysis. Pay particular attention to the middle note. This diagram has
a fundamental flaw related to one of the bullet points above, which
we'll talk about in the next chapter.
• We need to show that the Order object that Perform Order Entry
created before invoking Enter Buy Trade is what creates the Bond
Trade Entry window and the new Trade object in its initial form.
(We'll have a control object that retrieves the AT's entries and puts
them into Trade.)
• The use case calls for a feedback loop, which involves the window
and a "validate" control object, to address the alternate course.
• It's time to be more specific about what "processing a trade" means,
so let's bring in a trade queue (this is our second new object) and an
actor that represents the back office system.
Figure 4-6 shows a (correct) robustness diagram for Enter Buy Trade.
Now, let's rewrite the text for the two use cases we're highlighting in
this chapter to reflect our newly captured details.
Here is the new basic course of action for Perform Order Entry:
The system displays an Order Entry window. The AT first
selects the investment involved in the order from a list of
available investments. The AT then enters the ticket number
that appears on the paper ticket for the order, and also
specifies whether the trade is a buy or a sell. The system
verifies that the ticket number is not a duplicate; if the
number is unique, the system creates a new order. When the
AT chooses to proceed, the system brings up the appropriate
trade entry window, which the AT uses to enter the primary
data for the trade.
Q
0)
%
Get Trade
Trade
Submit
oTrade
-^5
Back Office
Assistant Trade Queue System
Values
Trader
Highlight
Errors
Validate
Submit Trade Data
Button
Compare this with the intermediate text on page 51, and then ask
yourself which text would be easier to design from!
Let's do the same exercise for Enter Buy Trade. This is the new basic
course:
The system creates a new trade with the ticket number
attached to the order. It also brings up a Bond Trade Entry
window. The AT uses this window to enter the appropriate
values for the trade. When the AT chooses to submit the
trade, the system validates both general trade values and
bond-specific values (for instance, it makes sure the coupon
rate is "reasonable") before processing the trade. If the trade
passes all validation tests, the system submits it to the Trade
Queue, from which the trade is later sent to the Back Office
System to be cleared and processed further.
%
Because we didn't learn anything new about Enter Buy Trade's alter¬
nate course, we can leave that one intact:
If the validation fails, notify the user, highlight the erroneous
values, and get new values from the user.
I strongly recommend that you have peer review of all of your use case
text and robustness diagrams. Each reviewer should be able to do the
following for each use case.
You're not done writing a use case until you can pass this simple test.
When you've reached that point for your entire set of use cases, the
next step—drawing sequence diagrams—will be easier for you to per¬
form than if you were starting from your use case text alone.
In fact, the best thing you can do is continuously refine your static model
while you work through your use cases during robustness analysis.
The new objects you discovered while you were drawing all those
robustness diagrams and talking about them with your customers
need to go onto your class diagrams now, not later. This is also the right
time to add some key attributes to your more significant classes.
Figure 4-8 shows an expanded view of the feedback path between the
robustness model and the static model.
• As we put our use case in the context of a use case diagram, and
we write and refine our text for its basic and alternate courses, we
discover new entity objects. (We've found three so far in our example
Updating Your Domain (Static) Model
▼
GUI Prototype
Code
■ ■
Complete?
Correct?
All alternate courses covered?
All functions identified?
Where does the data come from?
Figure 4-9 and Figure 4-10 together reflect the results of robustness
analysis on the key elements of our example's static model.
Updating Your Domain (Static) Model
Investment
ID
description
Portfolio shortDescription
isDTCEIigible
ID
isLiquid
active Date
isOwned
deactive Date
isPrivatePlacement
countryCode
isConvertible
globalCode
dateAdded
incorporationState
datedDate
investDiscretion Position
fundsType
lendingFlag
stateCode
name dateOriginated
countryCode
pairoffMethod netBookValue
affiliateCode
shortName lendingLimitPercent
totalVotingShares
typeOfPortfolio qualifiedQuantity
investmentType
votingAuthority reinvest
1
_,
SECyield
setCostCollateral
involves
setCurrentCost
generates
setQuantityCommited
setQuantityLong
/
Trade
setQuantityShort
\
Order
tradeCostCollateral
tradeCurrentCost
tradeQuantityCommited
tradeQuantityLong
tradeQuantityShort
trade Date
accruedinterest
isClaimSubmitted
isCollateral
confirmNumber
assumedPrice isCovered
complyOrDecide currency Rate
matched Flag discountPercent
priceMethod isDTCEIigible
generates
purpose settleType
requestedQuantity isforeignSource
status taxBVMethod
ticketNumber isHedge
toPortfolio instructions
transferType PSA
name historicalPSA
isRebook
softCommision
ticketNumber
settleStatus
Trade
tradeDate
accruQdInterest
isClaimSubmitted Trade Adjustment
Forecast
isCollateral
isAdjusted amount
confirmNumber
cashAmount date
isCovered
cashPrincipal postDate
currencyRate
cashflowType adjusts type
discountPercent
hasClaimBeenSubmitled adjustmentReason
isDTCEIigible
generates corporateAction
date settleType
description isForeignSource
disposedTicket taxBVMethod DisposedTradeLot
generates
forecastAmount isHedge
commission
forecastPrincipal instructions
fees
openQuantity isinsured
quantity
paidOrReceived PSA
term
PostData historicalPSA
status isRebook
transactionCode softCommission
ticketNumber
Actual Cashflow
has settleStatus
accountingApprovalDate
Posting accountingApprovallD
generates
accountingDate cashAmount
amount cashPrincipal
datePosted Trade Lot currencyRate
debitOrCredit date date
groupID historicalPSA description
relates to
groupSequence lastTransDate ID
isPostedToGL status Trade Lot Cashflow postDate
postingSource term status
datePaired
isRecurringT ransaction ticketNumber isTiedToForecast
timePosted transactionCode
involves
postingType
userlD
GL Account
accountType
accountNumber
balanceCode
description
detailAccount
financialindicator
10. It forces you to write your use cases using a consistent style.
7. It allows you apply syntax rules (for instance, "Actors talk only to
boundary objects") to your use cases.
3. It allows a reuse pass across all your use cases before you begin design.
2. It provides traceability betiveen what the system does (use cases) and
hozv the system zvorks (sequence diagrams), using a
conceptual object viezv.
C5i»-*#«*3t \yjr •
< ■ r'J'T^-inpi
«:i • .>•»; 'Ot iflQ -, tm.
t,:>^
V,
-iJfc
*-
,
f '•,r
ttfr V .> Vlt -3
•„.»i . .• mf-
Ji *♦->*</♦ I ,«a
i
vVf "■
*_"
-i ... ,
Interaction Modeling
When you finish with domain modeling and robustness analysis, you
have uncovered most of your problem space objects and assigned
some attributes to them. You have defined static relationships among
the objects on your high-level class diagram, and a few dynamic rela¬
tionships on your robustness diagrams. These represent fairly broad
brush strokes. Now it's time to design how your software will really
work (in other words, to define the solution to your problem). Interac¬
tion modeling is the phase in which you build the threads that weave
your objects together and enable you to start seeing how your new
system will perform useful behavior.
Domain
Model
%
Don't be surprised if all the material in this chapter does not register
with you the first time you go through it. We had been supporting
Jacobson's object interaction diagram in our CASE tools for about a year
before I figured out what it was all about. As I recall, it was during a
conversation with an Objectory mentor (Doug Bennett, of Syrinx) that
the light bulb lit for me. It's not surprising that many newcomers to the
UML, and to visual modeling in general, don't pick this up immediately.
The phrase behavior allocation, about which I go into detail later in this
chapter, was the one that helped me to understand the topic.
This is also the time to get more specific about how you will imple¬
ment fimctionality such as error handling and business rule pro¬
cessing. As I discussed in the previous chapter, it's likely that
many of your control objects (controllers) will turn into operations
on boundary and/or entity objects during interaction modeling.
(In some cases, they will stay as control objects—for example, use
case controllers.)
2. Show the detailed interactions that occur over time among the objects
associated with each of your use cases. Objects interact by sending
messages to each other. These messages serve as what Jacobson
calls stimuli—that is, a message stimulates an object to perform
some desired action. For each unit of behavior within a use case,
you must identify the necessary messages/methods.
Sequence Diagrams
The UML's sequence diagram evolved from Jacobson's object interac¬
tion diagram and the event trace diagram from OMT.
1. The text for the course of action of the use case appears down the left-
hand side. As you'll see in the examples that appear later in the
chapter, it's a good idea to break up the text with white space so
that it's easy to see which sentence corresponds with each set of
elements to the right.
2. Objects, which you bring over directly from your robustness dia¬
grams, are represented with two components. The name of an
object and (optionally) the class to which that object belongs
appear in a box at the top of the page, in the form object::class. A
dotted line runs from that box down the length of the page. You
can show the robustness diagram icons above the object boxes.
Getting Started
As I mentioned in the previous chapter, sequence diagrams are fairly
involved and tedious to draw because they are densely packed with
information. This also makes them hard to read unless we take special
care to make them readable.
If I have a pet peeve about the UML, it's that it deemphasizes robust¬
ness analysis—that is, preliminary design—the result of which is that
it implicitly encourages people to skip from analysis to detailed
design. In that circumstance, a designer must address several types of
questions at once—in the process of trying simultaneously to figure
out what is supposed to happen from the user's standpoint, and how to
build something in response to that. And that's where critical mistakes
occur.
Separating the what from the how (see page 62) is a critical aspect of
this approach, as is having a clear transition between them.
If you follow the ICONIX approach, the first three steps involved in
drawing sequence diagrams are completely mechanical in nature. That
can be very useful in achieving momentum as you get serious about
your design.
It's been my experience that many people get stuck at this point in a
development project. (This is especially likely if they've skipped pre¬
liminary design.) The technique I describe below evolved from help¬
ing students get "unstuck" during dozens of training workshops over
the past five years.
Figure 5-2 shows the four steps you should perform when drawing
sequence diagrams.
1. Copy the text for the given use case from the use case specification.
Paste it onto the left margin of the page.
The project team will have put a lot of effort into writing the use
case text, and the user community should have signed off on the
results. Also, the robustness models will have demonstrated feasi¬
bility in the context of the object model—in other words, we've
found some objects that we think can work together to provide the
required behavior.
Basic:
Alt;
Basic and
Alternate
Courses
of Action
Sequence
Diagram
We've also made sure that we haven't violated any of the top 10
principles.
It's time, then, to take a deep breath and plunge forward into design.
We can assume that the text of each use case represents a contrac¬
tual agreement about how the associated piece of the system will
behave. Copying use case text to begin the corresponding
sequence diagram enables that text to serve as an ongoing
reminder of what you're trying to accomplish. The result of this is
Chapter 5 ▼ Interaction Modeling
that when you're doing the design, the required system behavior is
always staring you in the face.
Figure 5-3 shows the text for the basic course of action and the
alternate course of action for the Enter Buy Trade use case, which
will serve as the focus of this section.
Note that each sentence and sentence fragment has some white
space around it. As you build your diagram, you should line up
the message(s) associated with each piece of text as closely as pos¬
sible. This will enable people reading the diagram to easily see
how the system will accomplish the specified behavior.
Basic Course
Alternate Course
Note: If you do not have all the relevant alternate courses of action
written out for each of your use cases, do not proceed with your
sequence diagram until those courses are in place. The diagrams
will not cover all special cases, and you will not uncover all the
behavior of the use case. This means that you won't discover all of
the necessary methods for your objects. Check again. Go back to
Chapters 3 (use cases) and 4 (robustness analysis) as necessary.
3. Add the boundary objects from the robustness diagram. (See Figure
5-5. Note that Tm showing these separately for space reasons.)
BASIC COURSE:
ALTERNATE COURSE:
BASIC COURSE:
ALTERNATE COURSE:
We can also show actors on the left side of a sequence diagram. (In
fact, because the UML doesn't contain Jacobson's "system bound¬
ary" symbol, it's often necessary to do this.) So, from left to right,
we have use case text, actors, boundary objects, and entity objects.
Note that these three steps are easy to automate. If you have good
robustness diagrams that you created with a visual modeling tool such
as Rose, you can write scripts to tell the tool to generate skeleton
sequence diagrams. That saves you time for the next step. Having
your tool put the use case text, actors, entity objects, and boundary
objects in place will save you effort and ensure precision, as well, as
you will be able to select your objects in the order in which you want
them to appear on your diagrams.
Sub Main
Dim theModel As Model
Dim thePackage As Category
Dim myDiagram As ScenarioDiagram
Dim anObject As Objectinstance
Dim theClasses As ClassCollection
Dim theAssoc As Association
Dim theAssociations As AssociationCol1ection
Dim theRole As Role
Dim aClass As Class
Viewport.Open
For i = 1 To theClasses.Count
Print theC1asses.GetAt(i).name
Set aClass = theClasses.GetAt(i)
result = myDiagram.AddInstance
(“object”.aClass.name)
Next i
myDiag ram.Layout
End Sub
Once you're done with these steps, you're over the hump of getting
your design started, and it's time to move on to the real work.
Unfortunately, it's also pretty hard, compared with the relatively easy
tasks we've talked about so far in this book. That's because you really
have to think through every decision, large or small. Experience and
talent are required here. This is why I advised you, in Chapter 3, to
make use of mechanisms for factoring out commonality (such as
invokes). Repeating the same hard work many times in-line on your
sequence diagrams is counterproductive.
So, where do we start? As you may have guessed, we can get a head
start by working from our robustness diagrams.
%
Along these lines, 1 suggest that you use your robustness diagram as a
checklist to make sure you have all the required system behavior
accounted for on your sequence diagrams. You simply check off each
control object as you draw the corresponding message(s) on the
sequence diagrams. This will help you eliminate the "oops, 1 forgot
about that function" error—which, as you might guess, is an insidious
one. (Note that one controller on a robustness diagram can translate to
several methods on a sequence diagram.)
You've already checked the robustness diagrams against your use case
text. By checking your sequence diagrams against your robustness dia¬
grams, you add a measure of assurance that you're designing in response
to what the user needs (in other words, meeting your requirements).
This step in the ICONIX approach represents your entry into what we
might think of as the second half of the fundamental object-oriented
development theme. In the first half, you focused on identifying the
objects. Now, you will figure out how to assign behavior to those objects.
Our approach identifies behavior in use case analysis, nails the behav¬
ior down and "quantizes" it during robustness analysis, and allocates
that behavior to objects on the sequence diagrams.
While we're talking about messages, I suggest that you keep your dia¬
grams free of clutter. In particular, I recommend that you don't show
message parameters on your sequence diagrams.
While you are making behavior allocation decisions, you are making
decisions that affect the quality of the classes in your design. I learned
about the following criteria from Grady Booch's Object-Oriented Analy¬
sis and Design with Applications (Addison-Wesley, 1994).
I keep these criteria in mind at all times when I'm deciding which
methods belong with which objects on my sequence diagrams.
• Reusability. The more general your objects and classes, the higher
the probability that you'll be able to reuse those objects and classes
for other projects. Ask yourself whether assigning a method to a
class makes that class more or less reusable.
• Applicability. The concept of applicability is basically the same in
the context of interaction modeling as it is for domain modeling
and use case modeling. When you assign methods to the objects on
your sequence diagrams, always ask yourself whether there seems
to be a good fit between method and object, and also whether the
task the method performs is obviously relevant to the object.
• Complexity. Our first two criteria, reusability and applicability, are
still somewhat theoretical. The subject of complexity is an indica¬
tion that we're about to get serious about implementation issues.
In essence, the issue here is whether it's easier to build a method in
one or another object.
• Implementation Knowledge. This criterion involves asking whether
the implementation of the behavior depends on details internal to
the associated method.
Examples
Figure 5-7 shows the sequence diagram we started building in the "Get¬
ting Started" section of this chapter for the Enter Buy Trade use case.
«
e
•o
V)
CJ
<3:
s
CQ
K
W
D
O
K
OJ
3
<5-
«U
CD
I
ID
<U
bi
3
60
b
Chapters T Interaction Modeling
Before we examine the use case text, look at the note that sits under the
first two objects from the left. This sequence diagram reflects a design
strategy that involves putting .various aspects of the control logic on
the boundary objects. The example that appears later in this section
involves leaving most of that logic within a control object. Tm not
going to recommend one strategy over the other here; these are two
possible strategies (out of many) that you can follow to good effect.
The beginning of the first sentence of the use case text implicitly refers
to the Perform Order Entry use case, which precedes Enter Buy Trade
(see Figure 3-8). This is why the first two messages to other objects
(getTicketNumber and create) come from the Bond Trade Entry win¬
dow, even though the Assistant Trader (AT) actor is the first element in
the body of the sequence diagram. The latter part of the first sentence
forms the true beginning of this use case from the AT's standpoint.
When the AT presses the Submit pushbutton on the Bond Trade Entry
window, the system will call two "validate" methods. As indicated by
the note above the validateGenericTradeInfo message. I've deferred
showing full detail about which validation occurs on which helper
class. Supplementary sequence diagrams would show, for instance, a
validateDates method on the Trade class that checks to see that the
repayment start date precedes the repayment end date.
The third note on the diagram says that I could show more detail here
or on a collaboration diagram. In fact, I decided to use a collaboration
diagram in the next chapter (see Figure 6-1).
Note that there's not as much white space between the sentences of the
use case text as there was on the previous sequence diagram. This is
because, as you can see, this diagram is an unfinished piece of work.
We'd normally be adding more space between the sentences as we cre¬
ate the associated messages.
4T
Chapters T Interaction Modeling
We can tie the second sentence back to the option buttons that appeared
in Figure 3-3. Once the AT clicks one of those buttons, the system will
try to establish the corresponding value within an Order object. How¬
ever, there's a problem: Order doesn't have an appropriate attribute.
As I've shown in the note next to Order, this calls for a visit to the static
model so that we can create a tradeType attribute. Note, though, that
we should have foreseen this on the robustness diagram for this use
case (see Figure 4-5), when we forgot to cormect the Specify TradeType
controller to the Order object.
As you can see from these examples, designing classes and drawing
sequence diagrams is real work, no question about it. However, if you
keep in mind the principles I just discussed, and you approach the
task in the same incremental and iterative manner that I've suggested
throughout this book, you'll have an excellent chance to get it right.
Please remember, however, that there is no single right answer; there
are many ways to create a design and end up with working code.
GUI Prototype
Code
m ■
A ^ Note, however, that you should not spend lots of time adding
get and set methods to your model. You should take advan-
-r > tage of the principle of encapsulation: Only allow access to
attributes via "getters" and "setters." But, you can readily
generate get and set methods for each relevant class by using a script
such as the one I talk about next.
The following excerpts are from a script that loops through the classes
you select, including all attributes and associations, and creates the get
and set methods that each class will need, if they don't already exist. It
was written by Robert Zembowicz (see http://www.robertz.com).
Ensuring Quality
Now is a good time to think about your classes and ask yourself if they
satisfy the following quality criteria.
Adding Infrastructure
As you come up with scaffolding and other types of infrastructure,
such as "helper" classes, put them on the static class diagram, as well.
This is where you shift your focus from the problem space to the solu¬
tion space. It's best to use localized class diagrams—say, one per use
case package—because, by this time, your static model is probably too
expansive to be captured within one readable diagram. Doing this also
allows work to be split across teams.
The static model should evolve continuously, from the initial "archi¬
tect's rendering" of the domain model through to the point at which it
becomes the "software blueprint" from which you'll code the new sys¬
tem. This evolutionary process is driven by the use cases through the
sequence diagrams, and even beyond.
»
Chapter 5 T Interaction Modeling
You shouldn't consider this part of the project done until all the methods
from your sequence diagrams are assigned to classes within your static
model, and you've factored in "Booch stuff" such as abstract and
parameterized classes, friend relationships, and composition. (Booch
stuff is especially important if you're going to code in C++.)
The idea is that the team members who are responsible for the dia¬
grams should establish, early in this task, some design standards that
can be used across all your use cases.
You might choose to use the Factory Method pattern, which lets a class
defer instantiation to subclasses, or Iterator, which lets a client traverse
a list in various ways, without needing to know how that list has been
implemented. (See Gamma, Helm, Johnson, and Vlissides, Design Pat¬
terns, Addison-Wesley, 1995.) Or perhaps you might develop new pat¬
terns in order to establish a standardized approach to design problems
that appear across multiple use cases.
Figure 5-10 shows excerpts of the updated static model for our exam¬
ple system, with attributes suppressed on the display.
We're not going to try to repeat all the good stuff from Design Patterns
or the Booch book here; note that this is the time in your project at
which you can benefit from the strategies presented in those books.
Completing Interaction Modeling
This is likely to be your last stop before code, so please note that criti¬
cal design review (CDR) is essential before you go on. I'll also remind
you of the critical importance of OO experience as you proceed.
10. You need to do one sequence diagram for each use case.
9. The diagram should match the narrative flow of the associated use case.
8. Whenever possible, do a single sequence diagram for the entire use case,
including all alternative courses of action. Split the diagram
only when a single diagram for the use case gets too difficult to manage.
5. By exploring the dynamic behavior of the system, you learn which attributes
and operations are needed in the classes contained within your static model.
4. Remember that the sequence diagram is the primary vehicle for making
behavior allocation decisions. You're really using your sequence diagrams
to assign operations to your classes as you go.
3. You are adding solution space objects to the problem domain objects
as you explore system usage at a detailed level. Solution space objects
include boundary (interface) objects from the robustness diagrams.
'•m
1^ *^‘^ 'i
I y"fi ‘-’<T t'‘ .fftfrthi ■». '
—' 1.1 ;Vi.'\.'S\^-=>'it u rtja* m
,^ ^./*>.'«*^ .», • . I
I Uf»>'v:’j
•t $% MM. »'-tUdV, Vaf.-»i Vr»3V*>-.v , /i^ii . <.i?v\i t fraWfii j
‘*f-vrrv»'i
,. / y.»*^ - *-f
'T;;:'^ ■ -— "-'V
Hi
■'' ,. v
v-> i:~
•i
Chapter 6
Collaboration
and State Modeling
You can use the UML's collaboration diagram and state diagram in
conjunction with your sequence diagrams to model additional aspects
of the dynamic behavior of the system you are designing. Typically,
collaboration diagrams and state diagrams are most useful in the
design of real-time systems, or when you need to explain the real-time
aspects of client/server or other distributed systems.
GUI Prototype
Chapter 6 ▼ Collaboration and State Modeling
This means that collaboration diagrams should come into play when
you need to show additional detail about timing for the key transac¬
tions within your scenario. The corollary is that we usually don't need
them the rest of the time.
1. You can use integers to show only the basic sequence. Consecu¬
tive numbers indicate a specific order of message passing; you can
also use duplicate numbers to show messages that can be sent in
parallel.
2. You can use decimal numbers to show which objects invoke which
other objects. For instance, if one object calls another object (by
sending a message), which turns around and calls a third object,
you might number the associated messages 1, 1.1, and 1.1.1,
respectively.
3. You can skip numbering altogether, as I do.
State Diagrams
A state diagram captures the lifecycle of one or more objects. This
cycle is expressed in terms of the different states that the objects can
assume and the events that cause changes in state.
Events can come from external sources, such as other objects (for
example, a message), a clock (the passing of a specified period of
time), or internal sources (such as a condition becoming true).
tells us that each object in a system has its own state machine, which
describes how the object is instantiated (created), how it sends mes¬
sages to and receives messages from other objects, and how it is
destroyed at the end of its useful life. While this is true, the reality is
that many objects have boring state machines, and time spent dia¬
gramming these is not productive time.
The UML allows you to build hierarchies of state diagrams. This is fine
in theory, and it may actually have practical application in such areas
as avionics. However, in most cases, I strongly suggest that you avoid
the temptation to nest several state diagrams on one (perhaps over¬
sized) piece of paper. Instead, stick to drawing one state diagram per
page, using child diagrams to show substates, as needed.
How Many State Diagrams Do We Need?
so you should definitely look into it if you feel the need to go in that
direction.
Activity Diagrams
The UML activity diagram captures actions and the results of those
actions. (You might say that activity diagram is UML-speak for flow¬
chart. Actually, that's what the UML User Guide says, too.)
While we're on the subject of data flow diagrams. I'd like to make a
point about what seems to be a never-ending debate.
4. Draw one huge multilevel hierarchical state diagram for the entire system.
Show at least five levels of substates.
3. Jump directly from requirements-level use case views into detailed design
with sequence diagrams. Do not pass go; do not collect $200; do not
bother with preliminary design. (Do not call me to ask why you're stuck.)
•kk
lSll4t'j«,«-< 1 If ,.1 '..'w' i''*-nW>w^* v»fl
«!•«!; ttil
^ " . • r.\ \tiflik
ul MHiilHiMMlBkwp* ■''* Tt
^ 1-
■ ■■■■'" . ■ * i i
rjjI'-.A.i
W'*; -.'1
ltl>
(•♦►■-’Mr ■.*" il., ■ <Tf >* ■.'(?l •<'x« ■ Tji -J—'T** y, .
_. nk', '"ii A'f f^u >•:’■. V,t^- k'rt K' ' 'y.HLi .C
! i -* :V-iu-‘''’v '1
iif(r.'.-4f;ir^V'fiVi U Mrjffri --u* >0
Aiy;( < v,''*liJf.iWnVil- Vik*i<v.&0
jll<kiah(l <^r>.
n y i^ *• nsrrtS
^ ^ - .* * ^
*.tf.. «,yiki4r’« . >»»v V .ftoV*»'litv*. 1 ,i
_. t ^
^ y
*r:-
-*• '
r V’ v
• 'P
'■yt
^ t
I
- >
Chapter 7
Addressing
Requirements
What Is a Requirement?
Simply stated, a requirement is a user-specified criterion that a system
must satisfy. Taken together, the requirements associated with a pro¬
posed system define the behavior and functionality required by the
users of that system.
I like to treat requirements as entities that have names just as use cases
and classes have. In other words, requirements are first-class citizens
within the modeling process. This way, we avoid getting our terms
mixed up and end up saying things like "use cases are requirements."
The Nature of Requirements, Use Cases, and Functions
For instance, I keep pointers (name references) from each use case to
each requirement satisfied by that use case, and from each class to each
requirement satisfied by that class. Within that scheme, requirements
can also reference lists of test cases, bug reports, and change requests,
which appear during implementation and maintenance.
You will certainly have user requirements in mind when you write
your use cases, but there's no reason why a use case can't address
more than one requirement. It's also perfectly acceptable to have a
situation in which a combination of use cases satisfies only one
requirement.
Chapter 5 talked about how you evolve your functionality and capture
it in sequence diagrams from the results of robustness analysis. Func¬
tions are the vehicle you use to answer the questions posed to your
project team by the requirements.
%
Figure 7-1 is a use case diagram that shows the use cases we can iden¬
tify from that last sentence, as well as the declarations we can make
about how these use cases are related.
The requirements—in this case, the laws that should govern Billy
Bob's behavior, in the event he's stopped by a cop—are:
We can define five functions based on the use cases and requirements
just identified:
It should be fairly obvious how these relate to the use cases and
requirements. These units of behavior are on a lower level than the
ones our cowboy friend was thinking of in the first place. Even though
he might do some of these activities "automatically," without thinking,
these smaller units of behavior comprise the functionality of the use
«
Chapter 7 T Addressing Requirements
Inputs
can of beer
Outputs
empty beer can
Function: consume can of beer
BEGIN
Retrieve can from 6-pack
Open can
REPEAT
Swallow beer
UNTIL no more beer in can
END
This "mini-spec" explains how the outputs are generated from the
inputs. (See Tom DeMarco's Structured Analysis and System Specification
[Prentice Hall, 1985] to learn more about this kind of process specifica¬
tion.) That's because on a data-flow diagram (DFD), we match input
and output data flows from parent to child. Note that we don't iden¬
tify many objects from it. (That's what domain modeling, use case
analysis, and robustness analysis are for!)
Requirements Traceability
Thanks to Jeff Kantor of ICONIX for the bulk of the following
discussion.
phase of the project, the term traceability comes into play. The two
terms are different perspectives on the same relationship, but you
traverse the relationship from each perspective under different cir¬
cumstances.
Data analysis and reduction encompasses ensuring that all the trace/
allocation pointers are valid, that all requirements are allocated, and
that all requirements trace. This aspect also presents management
questions as iterative and incremental development occurs. In addi¬
tion, you need to be aware of the impacts that changes have on ele¬
ments throughout the system, and work to ensure that the results
leave your design consistent with the users' needs.
The following are pieces of a property file that you can use in automat¬
ing the linking of named requirements with use cases and classes.
(This file is available on my Rose 98 CD.)
(object Attribute
tool “Requirements”
name “default Class”
value (list Attribute_Set
(object Attribute
tool “Requirements”
name “REQl”
value “”)
(object Attribute
tool “Requirements”
name “default UseCase”
value (list Attribute_Set
(object Attribute
tool “Requirements”
name “REQl”
value “”)
Figure 7-3 shows a Requirements tab that will appear on your use case
and class specifications within Rose using this property file (also avail¬
able on the CD-ROM).
Requirements and the ICONIX Approach
You may wonder whether this is overkill or whether only, say, big
aerospace companies need to trace requirements, especially to this
level of detail. I can see how you might think that.
Let me shed some light by telling you a true story about a training
workshop that found me with a small team (about five developers)
and a tight deadline.
This diagram shows that each work product of the dynamic model is a
direct and immediate consequence of the step that precedes it. There
are no leaps of faith between analysis and design. I believe this idea is
Jacobson's most significant contribution to OO theory and practice. My
fear that it is getting lost in the midst of the UML and the RUP is a key
reason I decided to write this book.
■ I—I
system. Or gather whatever substantive information '
I—I
you have about the legacy system you are reengineering. HI—I
10. The project team shall make as complete a list of requirements as possible,
as early in the project as it can, rather than start off with code.
9. REPEAT AFTER ME: Requirements are requirements; use cases are use
cases. Requirements are not use cases; use cases are not requirements.
7. The project team should demonstrate connection of at least one use case
directly with each requirement during requirements review.
4. The team shall trace the allocation of requirements to use cases and
domain classes as part of the requirements review.
3. The text of each use case "contract" must appear on a sequence diagram
so that the development team is constantly reminded of the "contractual
requirements" they’re working against as they do the design.
1. There shall be at least one test case in place to verify each requirement.
' |r ‘
. jfelilVI ' \r4\ Vi v^ 4t /.;. , *t‘-1 • \|'\- ’■ 1,* \,-.ftA ',t:t.* V, . U,4'^ *ai*, t I
I tv'ii.i,-**
V . >,
■tsi'J
* *■
-.4*. ^
' * V' ' -: ■ '-:? s
I
' ' r‘. ■
Chapter 8
Implementation
Implementation is not the major focus of this book, for three reasons.
1. If you've done a good job with your analysis and design, coding
should be straightforward, as long as you continue to keep a close
eye on your users' requirements. (In other words, the die is cast,
for the most part, by the time you get here.)
2. There are enough available object-oriented programming books to
last several lifetimes, and I see no reason to add to the mix.
3. Coding issues tend to be language-specific, even compiler-specific.
GUI Prototype
Chapter 8 T Implementation
I'm not generally in the business of defining specific roles that team
members should play, but I have noticed a few tendencies in my years
of consulting and teaching.
• Database folks are usually more oriented toward static class mod¬
eling. Make sure they don't just replicate the database schema and
pass it off as a class diagram, as they occasionally tend to want to
do. (Refer back to Chapter 2, as necessary. Have them read the
Wirfs-Brock book, too [Prentice Hall, 1990].)
• GUI programmers usually relate better to use cases. However, you
need to make sure they don't get lost in GUI design along the way.
Also, technical writers with user guide experience can be valuable
for writing use cases, because they are accustomed to describing
system usage.
• System programmers should focus on such things as performance
issues and state and collaboration diagrams.
• Senior OOA&D people should do the sequence diagrams, if possi¬
ble. If junior folks do them, the senior people must review them
(and vice versa, interestingly enough).
To maximize your resources, have your senior people review the work
that the more inexperienced people have done, while the latter get
started on another part of the system. And, if you can manage to have
domain expertise represented on each subteam or enlist the services of
Project Management
Project Management
There aren't quite as many books about software project management
as there are about object-oriented programming (OOP), but there are
still more than enough. In the face of that. I've reduced my advice on
this matter to the following.
• Hire smart people, then stay out of their way. The number-one cause
of project failure is managerial interference, primarily political. If
you've put together strong subteams, let them perform. (In other
words, don't act like the pointy-haired boss in Dilbert.)
• Don't lose your focus on the process. It will probably be tempting to
ignore class diagrams instead of updating them to reflect new
knowledge gleaned from coding, or to jump into integration test¬
ing without doing rigorous unit testing first. This would not be
wise; it may cost you dearly later in the project.
• Don't expect a visual modeling tool to generate foolproof code.
The code you get out of a tool is meant as a starting point for real
programmers—programmers who have reasonable experience
working with the language the code is written in, that is. In most
cases, you will get only class headers. Unrealistic expectations of
automagic code generation are responsible for a depressingly large
percentage of visual-modeling-tool sales—and an even more
depressing shelfware-to-sales ratio. (In other words, if it sounds
too good to be true, it probably is.)
• Don't mistake quantity of generated code for quality. The following is
a small part of the get/set code I generated from our example sys¬
tem. (Rose generated about 15 pages of this stuff for two or three
classes.)
y* *
/**
Get operation for the discountPercent attribute
(generated).
©roseuid 362CF94502C6
*/
public void getdiscountPercent() {
}
Before you move ahead, you need to do two more tasks that involve
the static model.
If you don't mind. I'll leave these as exercises for the reader.
Code Headers
GLAccount object
] Back_
TradeLotCashflow object
] Office
Back Office System actor
Trade object
] Trades_and
Order object
] Orders
validateBondInfo method
Figure 8-1 shows the key components of our example system, along
with some elements that belong to each component.
Code Headers
A tool like Rational Rose can generate large volumes of code in many
languages. But none of this code will be algorithmic in nature. Because
I'm a strong advocate of visual modeling tools (including Rose), and
because the algorithmic code is generally the most interesting, and
because this book isn't about OOP, I won't show you any real code. I
Chapter 8 T Implementation
Order
Trade %
assumedPrice
complyOrDecide
trade Date
matchedFlag
accruedinterest
priceMethod
isClaimSubmitted
purpose
isCollateral
requestedQuantity
confirmNumber
generates status
isCovered
ticketNumber
currencyRate
toPortfolio
discountPercent
transferType
isDTCEIigible
name
settleType
isForeignSource
createO
taxBVMethod
getTicketNumberO
isHedge
setTradeTypeO
instructions
isinsured
PSA
historicalPSA
isRebook
softCommision
ticketNumber
settleStatus Trade Queue
belongs to
head
createO
length
validateGenericTradeInfoO
tail
validateBondInfoO
createO
insert()
will, however, show you some material to help you trace our gener¬
ated code back through the example model.
Figure 8-2 shows those elements of the fully updated static class model
that are relevant to the Enter Buy Trade use case.
Figure 8-3 shows the sequence diagram we drew for that use case and
excerpts from the associated headers of the classes corresponding to
the objects on this diagram.
Figure 8-3 Enter Buy Trade Sequence Diagram with Headers
%
Chapter 8 T Implementation
Testing
You should look at testing as a full member of the iterative and incre¬
mental development lifecycle, not just as something you occasionally
do after you've cranked out a bunch of code. Begin testing on a piece
of your new system as soon as you've built a reasonable implementa¬
tion of the detailed design of that piece. As pieces evolve, you can test
on a larger scale while continuing to operate iteratively on each piece.
Because use cases have driven everything else we've discussed to this
point, it only makes sense that I recommend that you drive a healthy
portion of testing with your use cases. In particular, I suggest you treat
each use case as a unit within black-box testing, which involves bas¬
ing test cases on the externally visible behavior of the unit.
This is, in fact, user-acceptance testing within our approach. The use
case is what we said the system would do; if the system passes the test
that uses the use case as its scenario, then we can say that the system
actually does what we said it would do.
With this approach, you'll have at least one test for the basic course of
action and at least one test for each alternative course. Every test will
have a unique identifier so that you can keep track of it in the larger
scheme of things, just as you do for a use case or a class. You also tie
these test cases into your requirements as you go. (Refer to Chapter 7
to reinforce this principle.)
If you have a real-time system (see Chapter 6), you should add state-
based testing to the project. During this kind of testing, you monitor
changes that take place in an object's attributes in order to test the
interactions among that object's methods. You can use the elements on
state diagrams as the basis for test cases.
Metrics
In his 1994 book, Booch discusses several metrics that can be used for
object-oriented systems. I talked about two concepts related to metrics,
cohesion and coupling, in Chapter 5. I think they're the most impor¬
tant ones. The other four can be revealing, however, in that they can
expose potential weaknesses in your design, and likely spots for
groups of errors. Chris Kemerer and his colleagues at MIT are the orig¬
inators of these (read Kemerer's Software Project Management: Readings
and Cases [Richard D. Irwin, 1996]).
The following are excerpts from a metrics script available on the Rose
98 CD.
Figure 8-4 shows some of the results of running that metrics script on
our example system. (Brooks Van Horn of TRW wrote this script. Like
the other scripts in this book, it's available on my Rose 98 CD.)
As you can see from the numbers—in particular, the 0.2 operations per
class—our example is clearly a long way from a finished product (after
Metrics
all, we've only worked through two use cases), but at least you get the
idea of what kind of metrics are useful.
Of course, it's always a good idea to track the rate at which bugs are
exposed. If you were reasonably rigorous in your analysis and design,
you shouldn't have large numbers of bugs, even at the beginning of
each increment of your unit testing. But you should expect to see more
bugs up front within each test cycle than later on in the cycle. It's also
worth noting that the chances of finding bugs in a piece of code are
significantly higher than normal if you've already found lots of bugs
in that code. (Maurice Howard Halstead had some enlightening things
to say about this in his 1977 book Elements of Software Science; unfortu¬
nately, it's out of print.) Along those lines, you should make sure you
know who's writing what code.
%
Chapter 8 T Implementation
Sub MainO
Dim theCat As Category
Dim theModel As Model
Dim allUseCases As UseCaseCol1ection
Dim the UseCase as UseCase
Worksheet.Name = “Excel”
Worksheet.Cells(l,l).Value = “Use Case”
Worksheet.Cel1s(l,2).Value = “has Robustness Diagram”
Worksheet.Cel 1s(l,3).Value = “has Sequence Diagram”
row = 2
Set theModel = RoseApp.CurrentModel
For i = 1 To theModel.CetAllUseCases.Count
row = row + 1
Set theUseCase = theModel.CetAllUseCases.GetAt(i)
Worksheet.Cells(row,l).Value = theUseCase.name
If theUseCase.ClassDiagrams.Count > 0
Then Worksheet.Cells(row,2).Value = “YES”
If theUseCase.ScenarioDiagrams.Count > 0
Then Worksheet.Cells(row,3).Value = “YES”
Next i
End Sub
Figure 8-5 shows what happened when I ran this script for our example
system.
Wrapping Up
Wrapping Up
Figure 8-6 shows where we are. (Delivery is such a satisfying word!)
Code
Perform unit and integration testing.
Milestone 4: Delivery
Chapter 8 T Implementation
10. Bet the farm hy doing your most critical project as your first effort that
involves object-oriented development.
9. Make sure there's nobody with any 00 experience on your project team.
5. Keep your design model completely segregated from your use case model;
we all know that use cases don't affect code.
4. Implement the easy parts of your system first. Leave the critical items
for the end, near the deadline. (You can earn lots of overtime pay this wayl)
2. Ignore the analysis and design models you've produced, write the code,
and reverse-engineer all the code you've written into an as-built
object model. Your clients will never know the difference, right?
1. Assume your visual modeling tool will generate great code for you,
and hire a bunch of junior college students (none CS majors) to
handle coding.
Appendix
Others, however, took entirely different views on the subject, such as:
The choice between uses and extends has little to do with
how many other use cases are involved. Rather, it has to do
with which use case knows about which other. In the uses
case, the using use case knows about the used use case. This
is very much like a function call; many "using" use cases can
"use" a used use case. [Try saying that fast three times in a
row.] In the extends case, however, the extended use case
contains the primary course of events, but has no idea of the
existence of the extending use case.
This kind of reasoning is just too complicated for most people to fol¬
low, let alone do anything constructive with. And then we have:
If you look at this from the perspective of "usage instance,"
then an instance that follows the flow of the initial use case
and the extending use case is really a member of the subset of
all instances that follow the flow of the initial use case only.
We've informally started calling the initial use case in this
example the "covering use case."
The likes of those last two posts went a long way toward helping me
decide to try to shift the focus of the (by now, really big) thread to pre¬
cedes and invokes. This next text is from one of my posts; it sums up
my thoughts about uses and extends—and, come to think of it, about
use case driven modeling in general.
Invokes is not defined in the UML specs, but, along with its
partner precedes, comes from the OML. Some of us prefer this
set of relationships to uses/extends for the following reasons:
Somewhere along the line, however, some people got the idea that I
was (a) a UML heretic (I talked about this in Chapter 1, remember?)
and (b) ignorant about how extends works. Consider this:
Folks, just because everybody's doing it doesn't mean it's
right. Invokes is, and maybe rightly so, a shortcut in the good
old American tradition that led to rusting gas-guzzlers that ran
"OK" back in the '70s...until Japanese imports came along.
Well, I'm glad that at least one person thinks the definitions of uses
and extends are "very clear."
Alas, there are among us those who insist on continuing to muddy the
waters.
Now, these are wonderful principles to work with, and goals to strive
for, when we're designing code. Generally speaking, reading code isn't
much fun (except to a certain technical writer, who shall remain name¬
less); I'd go so far as to say that it's something that most developers
will go to great lengths to avoid doing. Ripping up code that's already
been built and debugged is even less fun. However—repeat after me,
please—use cases are not code.
Use cases are much closer, conceptually, to user manuals than they are
to code. When we're doing a development project using the approach I
describe within these covers, we're not trying to minimize rework of
already built stuff—we're trying to build a system that the client
wants us to build. That means that trying to design use cases so they
don't ever need to be read is simply wrong.
Use cases have to be designed so they can be easily read and under¬
stood by non-technical users and marketing folks who have never
come near a UML book. And the designs that we come up with
(which, repeat after me again, if you'd be so kind, are not the use cases)
need to be verified against those use cases in order for us to make sure
that we've met our users' requirements.
What's more, in order to build use case models that serve the purposes
I describe in this book, a single method of factoring out commonality
"Uses" vs. "Extends"
(using invokes, for example) is sufficient. The way I see it, you need
extends if you are organizing your use cases the same way you orga¬
nize code—but unfortimately, this is simply the wrong way to orga¬
nize use cases.
Back to OTUG
After reading about the open-closed principle on OTUG, I subse¬
quently demonstrated (not for the first time) that I could express use
case factoring with uses (or invokes) alone, and that I could live with¬
out extends very nicely. Then this appeared:
The proponents of dropping extends are really asking you to
drop software engineering principles and nothing more—all
under the fallacious guise that it is somehow easier for a user
to filter through a bunch of "if" statements and make
urmecessary changes to use cases that would never be
necessary had these proponents learned how to use extends
and teach their customers the same (which can be done in a
matter of minutes).
This, ladies and gentlemen, is what's known in the world of the Inter¬
net as a flame. If this were the 1860s, I would say something like,
"Them's fightin' words, mister."
The following was my response to all posts along the same lines.
I use invokes and precedes because in my experience, they
make more sense, are less confusing, and are more effective.
The resulting use case models are better structured, and
easier to understand, in my opinion. I am not stupid; I
understand the semantics of extends and uses. I am not an
agent of the OML. I have no political agenda. My opinion on
the subject is a reasonably informed one, based on an
acceptable level of experience. The only reason I use these
constructs is that they work better, in my experience.
The moral of the story: Use what works for you and don't be intimidated
by "true believers."
,,, - ,i*"i
1■
«ilStH
, >u
i}, * •' 1
n> i.Vy l/U-*-» 'U'»' • r I*'•‘’ ^'' *■ .
tyiSr ■ *V .-'.•ij'X
!>^ir .■ ■
Picw. n .. ,••• M ..... /. ... »lc!.>._.;.W=OW Aili^n . A,V':
oi’Ar R A i
\.
Grady Booch, James Rumbaugh, and Ivar Jacobson: The Unified Model¬
ing Language User Guide. Addison Wesley Longman, 1999.
Peter DeGrace and Leslie Hulet Stahl: The Olduvai Imperative. Prentice
Hall, 1993.
Ivar Jacobson, Maria Ericsson, and Agneta Jacobson: The Object Advan¬
tage: Business Process Reengineering with Object Technology. Addison-
Wesley, 1995.
%
Bibliography
associations
A and verbs 16
activity diagram building 23
and state diagram 116 defined 23
defined 116 notation 24
actor asynchronous message type 111
adding to sequence diagram 91, 92 attributes
defined 39 adding to domain model 75
notation 39 and nouns 16
robustness diagram rules 69 and possessive phrases 16
aggregation finalizing on classes 101
and helper classes 27 automagic 85, 92, 137
defined 25 autopilot 9
examples 26
Alger/Goldstein method 4
alternate course of action
B
and testing 142 balking message type 111
capturing 48 basic course of action
defined 48 and testing 142
excunples 52, 53, 54 defined 47
analysis paralysis examples 47, 51, 53, 54
alerts 20,24,25,45,49, 50, 66,76, 82, getting started 48
85, 102, 110, 114 behavior allocation
introduction 8 and CRC cards 95
top 10 list 119 and quality of classes 96
analysis-level use case critical nature 95
defined 40 initial definition 82
examples 54 what not to do 82
applicability 96 Bennett, Doug 82
architect's rendering 103 best of breed 4, 5
association class Billy Bob 124
defined 26 black-box testing 142
developing 26 Booch, Grady xvi, 1, 3, 4, 5, 6, 7, 25, 83,
notation 27 96, 104, 110, 111, 143, 157
Index
E G
Enter Buy Trade use case Gamma, Erich 104, 157
alternate course of action 70, 74 Gang of Four 157
basic course of action 53, 70, 73 generalization
class diagram 140 and use cases 49
introduction 51 defined 21
robustness analysis 71 examples 22, 23
robustness diagram 73 notation 22
sequence diagram 88, 90, 91, 97, 141 grammatical inspection 16, 20
Enter Sell Trade use case graphical user interface (GUI)
alternate course of action 54 See GUI
basic course of action 54 guard 113
introduction 51 GUI
entity objects and system behavior 41
adding to sequence diagram 89, 90 design without the GUI 43
defined 67 personnel 136
discovering 75 GUI-Repository-Logic 66
finding 67
introduction 61
naming 65
H
notation 68 Halstead, Maurice Howard 145, 157
robustness diagram rules 69 hamburger 33
entity-relationship diagram (ERD) 3, 23 Helm, Richard 104, 157
entry event 113 helper classes 27, 31
%
Index
I messages
numbering on collaboration
implementation knowledge 96 diagram 112
includes relationship 49 • on sequence diagram 84, 97, 99
integration testing 143 parameters 96
interaction diagrams 82 Method of the Month Club 3
interaction modeling method types
defined 81 data-centered 3
finishing 105 scenario-based 3, 4
goals 82 structural 3
invokes relationship 50, 57, 93, 150, Methodology 9
151, 152, 155 methods
is-a relationship 21 assigning to classes 93
iterate and refine 33 finalizing on classes 101
iterative and incremental 6, 7, 10, 40, on sequence diagram 84, 97,
127 99
Iterator pattern 104 milestones
Critical Design Review (CDR) 13
J Delivery 13
introduction 10
Jacobson, Ivar xvi, xviii, 2, 4, 5, 6, 7,16, Preliminary Design Review 12
40, 61, 62, 63, 64, 68, 82, 83, 84, 92, Requirements Review 11
no, 130, 157 minimalist approach 7
Johnson, Ralph 104, 157 mining 27, 45
mini-spec 126
K Model-View-Controller 66
much heat, little light 151
Kantor, Jeff 126 multiplicity 24, 26
Kemerer, Chris 143, 158
kind-of relationship 21
Kitchen Sink 27
N
negative value added 151
P R
package 55, 136 rapid prototyping 41
package diagram 55, 56 Rational Rose
Page-Jones, Meilir 43 adding operations 101
parent 21 and code 139
part-of relationship 25 equivalence of methods and
patterns 104 messages 96
peer review 74 example model xvii
Perform Order Entry use case excerpts from sample scripts 92, 102,
alternate courses of action 52, 53, 70, 144, 146
73 linking files to use cases 44
basic course of action 52, 70, 71 property file excerpt 128
introduction 51 Requirements tab 128
robustness analysis 70 starting sequence diagram 85
robustness diagram 72 writing scripts for sequence
sequence diagram 99 diagrams 92
Perform Trade Adjustment use case 54 Rational Unified Process (RUP) 2, 63,
Perform Trade Entry use case 46,47, 48, 130
51, 53 Rawsthome, Dan 94
performance requirements 122 reengineering 27, 40, 45
personality 94, 103 requirement
piece-part relationship 25 allocating to use cases 129
postcondition 50 allocation 126
precedes relationship 50, 57, 150, 155 and classes 17
precondition 50 as named entity 123
preliminary design 63, 86 defined 57, 122
%
Index
S stimuli 83
structural methods 3
scenario 40 structured analysis and design 3, 116
scenario-based methods 3, 4 subclass 21
schizophrenic objects 94 sufficiency 103
science fiction 41 sunny day scenario 47
scripts 92, 102, 144, 146 superclass 21
self-aggregation 26 swimlanes 116
sequence diagram synchronous message type 111
and detailed design 64 system boundary 92
and requirements 129 system boundary symbol 92
and robustness analysis 65
building 85
defined 84
T
elements 84, 85 technical writers 45, 53, 136
examples 141 test requirements 122
Index
Analysis Patterns
Reusable Object Models
DIALYSIS Martin Fowler
PATTERNS
Addison-Wesley Object Technology Series
REUSABLE T
OBJECTMODELS
Martin Fowler shares with you his wealth of object modeling experience and
MAR TIN k>\vi>:r
his keen eye for solving repeating problems and transforming the solutions
into reusable models. Analysis Patterns provides a catalog of patterns that
oRavr Jatn<dn
have emerged in a wide range of domains, including trading, measurement,
accounting, and organizational relationships.
0-201-89542-0 • Hardcover • 384 pages • ©1997
UML Distilled
Applying the Standard Object Modeling Language
Martin Fowler with Kendall Scott
Foreword by Grady Booch, Ivar Jacobson, and James Rumbaugh
Addison-Wesley Object Technology Series
andUML Terry Quatrani, the Rose Evangelist for Rational Software Corporation, teaches
you visual modeling and the UML, enabling you to apply an iterative and
TKKRV QUATRAM incremental process to analysis and design. With the practical direction
»oH—i»iiv CrMy Oooch
offered in this book, you will be able to specify, visualize, document, and
create software solutions. Highlights of this book include an examination of
system behavior from a use case approach; a discussion of the concepts and
notations used for finding objects and classes; an introduction to the notation
needed to create and document a system's architecture; and a review of the
iteration planning process.
0-201-31016-3 • Paperback • 240 pages • ©1998
James Rumbaugh, Ivar Jacobson, and Grady Booch have created the definitive
reference to the UML. This two-color book covers every aspect and detail of
the UML and presents the modeling language in a useful reference format that
serious software architects or programmers should have on their bookshelf.
The book is organized by topic and designed for quick access. The authors
also provide the necessary information to enable existing OMT, Booch, and
OOSE notation users to make the transition to UML. The book provides an
overview of the semantic foundation of the UML through a concise appendix.
0-201-30998-X • Hardcover with CD-ROM • 576 pages • ©1999
Applying Use Cases
A Practical Guide
Geri Schneider and Jason P. Winters
Addison-Wesiey Object Technology Series
*
Howto
InteraiCt 7. Visit our Web site
http://www.awl.com/cseng
When you think you've read enough, there's always more content for you at
with Us Addison-Wesley's web site. Our web site contains a directory of complete
product information including:
• Chapters
• Exclusive author interviews
• Links to authors'pages
• Tables of contents
• Source code
You can also discover what tradeshows and conferences Addison-Wesley will
be attending, read what others are saying about our titles, and find out where
and when you can meet our authors and have them sign your book.
[email protected]
Request a current Innovations Newsletter.
[email protected]
Send comments about our web site.
[email protected]
Submit a book proposal.
Send errata for an Addison-Wesley book.
We encourage you to patronize the many fine retailers
[email protected]
who stock Addison-Wesley titles. Visit our online directory
Request a review copy for a member of the media
to find stores near you or visit our online store:
interested in reviewing new Addison-Wesley titles.
http://store.awl.com/ or call 800-824-7799.
The most important parts of a The tutorial includes 20 narrated example movies
case driven UML/Rose Model
of Rose 98, including:
• Installing the Objectory Add-In
• Packages • Linking Screen Pictures to Use Case Specifications
• Class Diagrams • A script that automatically starts a Sequence Diagram
• Use Case Diagrams • Custom Properties to support Requirements Traceability
• Robustness Analysis diagrams
• Allocating Classes to Components for Code Generation
• Automatically export models from Rose into MS Word
• Sequence Diagrams
• Using OLE Automation to export from Rose to MS Excel
• Other UML diagram types
• Guided tour of the Rose Extensibility Interface (REI)
A collection of useful scripts is included, along with the Objectory add-in and a 30-day evaluation copy of Rose 98.
Available at an easily affordable price of only $99, or included at no extra charge as part of the
ICONIX Unified Object Modeling CD-ROM tutorial set, "Rose 98 for Power Users" is guaranteed
to improve your productivity when doing use case driven UML modeling with Rational Rose.
SPECIAL OFFER!!! Mention “Use Case Driven Object Modeling with UML’ " ^ t y\
when ordering online, and take 10% off the price of any ICONIX multimedia tutorial I httpyA/vww.icxinixsw.cxim
Software Engineering/Object Technology/UML
Today, software practitioners are faced with the frustrating reality that there is seldom
enough time to properly model an impending project. Even with the widespread accep¬
tance of the Unified Modeling Language (UML), proper modeling is often not completed
because aggressive schedules make this practice difficult. This book presents a stream¬
lined approach to UML modeling that includes a minimal but sufficient set of diagrams
and techniques you can use to get from use cases to code quickly and efficiently.
Use Case Driven Object Modeling with UML provides practical guidance that shows
developers how to produce UML models with minimal startup time, while maintaining
traceability from user requirements through detailed design and coding. The authors draw
upon their extensive industry experience to present proven methods for driving the object
modeling process forward from use cases in a simple and straightforward manner.
Highlights include:
• A clear and comprehensive integrated example that evolves throughout the book
•“Top 10” lists summarizing each chapter’s most important points
•“Analysis Paralysis Alerts” to help you steer clear of the common pitfalls in UML modeling
• Extensive discussion of requirements and how to design in a traceable manner
• Omission of all extraneous theory that will not immediately help you get your modeling done
• Practical tips for extending visual modeling tools to make the process work efficiently
Doug Rosenberg, founder and president of ICONIX, has been teaching use case
driven object modeling using a Unified Jacobson/Booch/Rumbaugh approach since
1992, several years before the advent of UML. His acclaimed CD-ROM tutorials, includ¬
ing “Complete CORBA,” “Mastering UML with Rational Rose,” and “A Unified Object
Modeling Approach” are in widespread use in more than 40 countries. He has taught
object modeling using UML at dozens of companies including Boeing, Duke Power,
Hughes, JC Penney, Lockheed-Martin, Lucent, Motorola, NASA, and Philip Morris.
He has also written numerous articles for a variety of publications, including Object
Magazine, Software Deveiopment, and Rose Architect. Ol-t^V0V-698
□Kan
about financial and accounting applications. He is the p Documen-
tation Wizards.
I
A ADDISON-WESLEY 9780201432893
Addison-Wesley is an imprint of
10/04/2019 14:30-2
Addison Wesley Longman, Inc.