Académique Documents
Professionnel Documents
Culture Documents
Product Training
DEV475 Mastering
Object-Oriented Analysis
and Design with UML
Student Manual
Version 2003.06.00
Volume 1
Part# 800-026320-000
Rational University
DEV475 Mastering Object-Oriented Analysis and Design with UML
Student Manual
Version 2003.06.00
Volume 1
February, 2003
Copyright 2002, 2003 Rational Software Corporation. All rights reserved.
The contents of this manual and the associated software are the property of
Rational Software and/or its licensors, and are protected by United States copyright laws,
patent laws, and various international treaties. Any reproduction in whole or in part
is strictly prohibited. For additional copies of this manual or software, please contact
Rational Software.
Rational, the Rational logo, ClearQuest, ClearCase, Purify, PureCoverage, Rational Unified
Process, ClearDDTS, and Quantify are trademarks or registered trademarks of Rational
Software Corporation in the United States and in other countries. All names are used for
identification purposes only and are trademarks of their respective companies.
Microsoft Visual Basic, Windows NT, Windows 2000, and Visual SourceSafe are trademarks
or registered trademarks of Microsoft Corporation.
Java and all Java-based marks, among others, are trademarks or registered trademarks of Sun
Microsystems in the United States and/or other countries. All other names are used for
identification purposes only and are trademarks of their respective companies.
Web: http://www.rational.com
Contents
Module 0 About This Course
0-1
1-1
2-1
3-1
4-1
5-1
6-1
Acknowledgments
The development of this course was made possible with the help of many individuals, but I would
particularly like to thank the following for their exceptional participation:
Alex Kutsick of Rational University for his course development standards, instructional design
expertise, attention to detail, and correcting my misuse of the English language. Alex is
personally responsible for ensuring that there is a high-level of consistency throughout this
course.
Dan Machado of Rational University for his graphics support.
Kelli Houston of Rational University for her incredible work on OOADv4.0 and OOADv4.2;
all I had to do was carry on what she had started.
The OOAD Steering Committee: Eric Aker, Sinan Alhir, Alex Barclay, Francesco Bonfiglio,
Jerome Desquilbet, Fredrik Ferm, Yves Holvoet, Sean Kelley, Pan Wei Ng, Davyd Norris, Jim
Ruehlin, Jean-Pierre Schoch and Mike Tudball.
Paul Dreyfus and his team of editors for assisting in reviewing the material.
Last but certainly not least, DeAnna Roberts of the Rational University production team for her
fulfillment and logistical support.
January, 2003
Lee Ackerman
Rational University Sr. Product Manager/ OO Curriculum
lackerman@rational.com
Works Cited
The following sources were used to develop this courseware. When quoted directly, we cite the source
after the quoted passage. For all other uses, we respectfully acknowledge below the authors
contributions in the development of this courseware.
The Deadline: A Novel About Project Management, Tom DeMarco, Dorset House Publishing,
1997.
Dictionary of Object Technology: The Definitive Desk Reference, Donald G. Firesmith and Edward
M. Eykholt, Prentice Hall, 1995.
Meta Fax, 09/15/97.
news@sei, Vol. 1, No. 2.
Object Technology: A Managers Guide, David A. Taylor, Addison-Wesley, 1999.
Pattern-Oriented Software Architecture: A System of Patterns, Frank Buschman et al., John Wiley &
Sons, 1996.
The Rational Unified Process, An Introduction, Phillippe Kruchten, Addison-Wesley, 1999.
UML Distilled, Martin Fowler and Kendall Scott, Addison-Wesley, 1997.
UML Toolkit, Hans-Erik Eriksson and Magnus Penker, John Wiley & Sons, 1997.
The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar Jacobson,
Addison-Wesley, 1999.
Visual Modeling with Rational Rose and UML, Terry Quatrani, Addison-Wesley, 1998.
Module 0
About This Course
Topics
Course Objectives ................................................................................................ 0-3
Prerequisites......................................................................................................... 0-6
Rational University Curriculum ............................................................................. 0-7
0-1
Introductions
Introductions
Your organization
Your role
Your background, experience
Object technology experience
Software development experience
Implementation language experience
0-2
Course Objectives
Course Objectives
Upon completion of the course, participants
will be able to:
Apply an iterative, use case-driven,
architecture-centric process to the development
of a robust design model
Use the Unified Modeling Language (UML) to
represent the design model
Apply Object-Oriented (OO) concepts:
abstraction, encapsulation, inheritance,
hierarchy, modularity, and polymorphism to the
development of a robust design model
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
During this course, you will be introduced to the concepts, process, and notation for
developing a design model. You will be using the Rational Unified Process Analysis
and Design workflow as your framework. These concepts can also be applied within
any software development process.
0-3
The concentration will be on those activities that are performed by the objectoriented designer. Architectural concepts will be introduced and discussed, as they
drive the design, but this is not an architecture course.
0-4
Intended Audience
Intended Audience
Intended Audience
Practitioners who want a basic explanation of
Object-Oriented Analysis and Design (OOAD)
concepts, as well as hands-on practical
experience in applying the techniques
Analysts, designers, software developers
0-5
Prerequisites
Prerequisites
Some experience applying the following
techniques in a software development
environment
0-6
Instructor-led
Web-based
Optional
Path 1
DEV110
Principles of
Modeling
DEV111
Principles of
UC Modeling
with UML
DEV112
Principles of
Analysis I
DEV113
Principles of
Analysis II
DEV305
Essentials of
Rational
Rose
2 hours
2 hours
2 hours
2 hours
5 hours
OR
OR
Path 2
DEV275
Essentials
of Visual
Modeling
with UML
1 day
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
DEV475
Mastering Object
Oriented
Analysis &
Design with UML
4 days
Fund. of
Rational
Rose
1 day
The Rational University curriculum offers the courses shown here and on the next
two slides. As you can see, for each major software development team role, Rational
University offers a professional development course.
The Requirements Management with Use Cases may be particularly interesting to you,
as it is where you will learn to develop use cases, the artifacts that drive much of what
you do in Analysis and Design.
0-7
Instructor-led
Web-based
Optional
Path 1
PRJ110
Principles of
Rational
Unified
Process
3 hours
DEV275
Essentials
of Visual
Modeling
with UML
DEV111
Principles of
UC Modeling
with UML
DEV112
Principles of
Analysis I
DEV113
Principles of
Analysis II
1 day
2 hours
2 hours
2 hours
OR
Path 2
DEV475
Mastering Object
Oriented
Analysis &
Design with UML
4 days
DEV110
Principles of
Modeling
2 hours
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
0-8
Principles of
Architecting
Software
Systems
3 days
Req.
Management
with Use
Cases
3 days
Instructor-led
Web-based
Optional
REQ310
Essentials of
Rational
RequisitePro
DEV110
Principles of
Modeling
DEV305
Essentials of
Rational
Rose
5 hours
2 hours
2 hours
OR
OR
Fund. Of
Rational
RequisitePro
DEV275
Essentials
of Visual
Modeling
with UML
Fund. of
Rational
Rose
1 day
1 day
1 day
OR
0-9
Course Materials
Course Materials
Student Manual, Books 1, 2, and 3
Additional Information Appendix
Course Registration Requirements
Document
Payroll Requirements Document
Payroll Architecture Handbook
Payroll Solution Appendix
Course Registration Models and Payroll
Solutions Models CD
UML Users Guide by Grady Booch
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
10
The Student Manual contains copies of the slides, as well as detailed Student Notes.
The Student Manual is comprised of two books.
The Additional Information Appendix contains a collection of additional topics that
are not general enough to be included in the base course, or may be considered too
advanced for the introductory audience. These topics may or may not be covered by
the instructor. This appendix contains the UML-To-Language Maps that show the
map from the UML to implementation language constructs for the following
languages: C++, Java, PowerBuilder, and Visual Basic. It also contains information
on several additional Architectural Mechanisms.
The requirements that drive the development of the example and exercise design
models are documented in the Course Registration Requirements Document and
the Payroll Requirements Document, respectively.
The architectural givens that guide the students in the development of the exercise
design model are documented in the Payroll Architecture Handbook.
The Payroll Solution Appendix contains the hard-copy of the course exercise
solutions. The Rose models for the course example and course solutions are provided
on the Course Registration Models and Payroll Solutions Models CD.
0 - 10
11
0 - 11
Logistics
Logistics
Morning
2-Fifteen-minute breaks
Lunch
1 Hour
Afternoon
2-Fifteen-minute breaks
0 - 12
12
Module 1
Best Practices of Software Engineering
Topics
Practice 1: Develop Iteratively .............................................................................. 1-7
Practice 2: Manage Requirements ...................................................................... 1-11
Practice 3: Use Component Architectures........................................................... 1-15
Practice 4: Model Visually (UML)........................................................................ 1-18
Practice 5: Continuously Verify Quality............................................................... 1-22
Practice 6: Manage Change ................................................................................ 1-27
1-1
Objectives
Objectives
Identify activities for understanding and
solving software engineering problems.
Explain the Six Best Practices.
Present the Rational Unified Process (RUP)
within the context of the Six Best Practices.
In this module, you learn about recommended software development Best Practices
and the reasons for these recommendations. Then you see how the Rational Unified
Process (RUP) is designed to help you implement the Six Best Practices.
1-2
1-3
1-4
Root Causes
Insufficient requirements
Requirements churn
Ambiguous communications
Modules do
notfitfit
dont
Brittle architectures
Hard to maintain
Overwhelming complexity
Late discovery
Undetected inconsistencies
Poor quality
Poor testing
Poor performance
Subjective assessment
Colliding developers
Waterfall development
Build-and-release
Uncontrolled change
Insufficient automation
Best Practices
Develop Iteratively
Manage Requirements
Use Component Architectures
Model Visually
Visually (UML)
(UML)
Model
Continuously Verify
Verify Quality
Quality
Continuously
Manage Change
Treat these root causes, and you will eliminate the symptoms. Eliminate the
symptoms, and youll be in a much better position to develop quality software in a
repeatable and predictable fashion.
Best practices are a set of commercially proven approaches to software development,
which, when used in combination, strike at the root causes of software development
problems. These are called Best Practices, not because we can precisely quantify
their value, but because they are observed to be commonly used in the industry by
successful organizations. The Best Practices are harvested from thousands of
customers on thousands of projects and from industry experts.
1-5
1-6
Develop Iteratively
Manage Requirements
Use Component
Architectures
Model Visually (UML)
Continuously Verify Quality
Manage Change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
1-7
Waterfall Process
Requirements
analysis
Design
Code and unit test
Subsystem integration
System test
1-8
Initial
Planning
Management
Environment
Test
Evaluation
Deployment
Each iteration
results in an
executable release
The earliest iterations address the greatest risks. Each iteration includes integration
and testing and produces an executable release. Iterations help:
1-9
Risk Profiles
Risk Profiles
Risk
Waterfall Risk
Risk Reduction
Iterative Risk
Time
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
10
1 - 10
Develop Iteratively
Manage Requirements
Use Component
Architectures
Model Visually (UML)
Continuously Verify Quality
Manage Change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
11
A report from the Standish Group confirms that a distinct minority of software
development projects is completed on-time and on-budget. In their report, the
success rate was only 16.2%, while challenged projects (operational, but late and
over-budget) accounted for 52.7%. Impaired (canceled) projects accounted for
31.1%. These failures are attributed to incorrect requirements definition from the start
of the project to poor requirements management throughout the development
lifecycle. (Source: Chaos Report, http://www.standishgroup.com)
1 - 11
Requirements Management
Requirements Management
Making sure you
solve the right problem
build the right system
by taking a systematic approach to
eliciting
organizing
documenting
managing
the changing requirements of a
software application.
1 - 12
12
13
1 - 13
Problem
Needs
Solution
Space
Tr
bil
ea
ac
Features
it y
The
Product
to Be
Built
Software
Requirements
Test Scripts
Design
User
Docs
14
1 - 14
Assess the impact of a failure of a test on requirements (that is, if the test fails, the
requirement may not be satisfied).
Verify that all requirements of the system are fulfilled by the implementation.
Manage change.
Develop Iteratively
Manage Requirements
Use Component
Architectures
Model Visually (UML)
Continuously Verify Quality
Manage Change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
15
Software architecture is the development product that gives the highest return on
investment with respect to quality, schedule, and cost, according to the authors of
Software Architecture in Practice (Len Bass, Paul Clements and Rick Kazman [1998]
Addison-Wesley). The Software Engineering Institute (SEI) has an effort underway
called the Architecture Tradeoff Analysis (ATA) Initiative that focuses on software
architecture, a discipline much misunderstood in the software industry. The SEI has
been evaluating software architectures for some time and would like to see
architecture evaluation in wider use. As a result of performing architecture
evaluations, AT&T reported a 10 percent productivity increase (from news@sei, Vol.
1, No. 2).
1 - 15
Component-based
Reuse or customize components
Select from commercially available components
Evolve existing software incrementally
16
Architecture is a part of Design. It is about making decisions on how the system will
be built. But it is not all of the design. It stops at the major abstractions, or, in other
words, the elements that have some pervasive and long-lasting effect on system
performance and ability to evolve.
A software systems architecture is perhaps the most important aspect that can be
used to control the iterative and incremental development of a system throughout its
lifecycle.
The most important property of an architecture is resilience flexibility in the face of
change. To achieve it, architects must anticipate evolution in both the problem
domain and the implementation technologies to produce a design that can gracefully
accommodate such changes. Key techniques are abstraction, encapsulation, and
object-oriented Analysis and Design. The result is that applications are fundamentally
more maintainable and extensible.
1 - 16
Applicationspecific
Businessspecific
Intellectual control
Middleware
Manage complexity
Maintain integrity
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Component-based
architecture with
layers
Systemsoftware
17
1 - 17
Develop Iteratively
Manage Requirements
Use Component
Architectures
Model Visually (UML)
Continuously Verify Quality
Manage Change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
18
1 - 18
19
1 - 19
Collaboration
Diagrams
Dynamic
Diagrams
Static
Diagrams
Class
Diagrams
Use-Case
Diagrams
Object
Diagrams
Component
Diagrams
Models
Statechart
Diagrams
Activity
Diagrams
Deployment
Diagrams
20
1 - 20
Class Diagram
Statechart
Diagram
add file
Docu me ntList
Use Case 1
FileMgr
Actor A
Actor B
Document
ad d( )
del ete( )
fetchD oc( )
sortB yName( )
name : i nt
doci d : int
numFiel d : int
get( )
open( )
close( )
read( )
sortFileList( )
create( )
fillDocu me nt( )
Use Case 2
FileList
fList
add( )
del ete( )
Writing
Openning
close file
Use Case 3
close file
Closing
Reading
rep
Rep ositor y
(from Persiste nce)
File
read( )
GrpFile
na me : c har * = 0
readD oc( )
readFil e( )
Collaboration
Diagram
9: sortByN ame ( )
Repository
mainWnd : MainWnd
1: Doc vi ew request ( )
read( )
op en( )
create( )
fillFile( )
DocumentList
Deployment
Diagram
Windows95
Window95
FileManager
W indow s95
2: fetc hDoc( )
-
.EXE
Document
gFile : GrpFile
4: create ( )
8: fillFile ( )
W indow s
NT
user : Clerk
S olaris
fileMgr : FileMgr
- .EXE
GraphicFile
3: create ( )
Alpha
UN IX
-.EXE
6: fillDoc ument ( )
File
FileList
Windows
NT
IBM
Mainfra me
7: readFile ( )
5: readDoc ( )
document : Document
repository : Repository
mainWnd
user
-
.
fileMgr :
FileMgr
document :
Document
gFile
repository
2: fetchDoc ( )
Component
Diagram
Target
System
3: create ( )
4: create ( )
5: readDoc ( )
-
- .
6: fill Document ( )
7: readFile ( )
8: fillFile ( )
-
-
Forward and
Reverse
Engineering
9: sortByName ( )
Sequence
Diagram
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
21
Visual modeling with the UML makes application architecture tangible, permitting us
to assess it in multiple dimensions. How portable is it? Can it exploit expected
advances in parallel processing? How can you modify it to support a family of
applications?
We have discussed the importance of architectural resilience and quality. The UML
enables us to evaluate these key characteristics during early iterations at a point
when design defects can be corrected before threatening project success.
Advances in forward and reverse engineering techniques permit changes to an
applications model to be reflected automatically in its source code, and changes to
its source code to be automatically reflected in its model. This is critical when using
an iterative process, in which we expect such changes with each iteration.
1 - 21
Develop Iteratively
Manage Requirements
Use Component
Architectures
Model Visually (UML)
Continuously
Verify Quality
Manage Change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
22
1 - 22
Inception
Elaboration
Construction
Transition
23
Tests for key scenarios ensure that all requirements are properly implemented.
1 - 23
Functionality
Reliability
Supportability
Performance
24
Functional testing verifies that a system executes the required use-case scenarios as
intended. Functional tests may include the testing of features, usage scenarios, and
security.
Usability testing evaluates the application from the users perspective. Usability tests
focus on human factors, aesthetics, consistency in the user interface, online and
context-sensitive Help, wizards and agents, user documentation, and training
materials.
Reliability testing verifies that the application performs reliably and is not prone to
failures during execution (crashes, hangs, and memory leaks). Effective reliability
testing requires specialized tools. Reliability tests include tests of integrity, structure,
stress, contention, and volume.
Performance testing checks that the target system works functionally and reliably
under production load. Performance tests include benchmark tests, load tests, and
performance profile tests.
Supportability testing verifies that the application can be deployed as intended.
Supportability tests include installation and configuration tests.
1 - 24
Iteration 2
Iteration 3
Iteration 4
Test Suite 1
Test Suite 2
Test Suite 3
Test Suite 4
UML Model
and
Implementation
Tests
25
In each iteration, automated tests are created that test the requirements addressed in
that iteration. As new requirements are added in subsequent iterations, new tests are
generated and run. At times, a requirement may be changed in a later iteration. In
that case, the tests associated with the changed requirement may be modified or
simply regenerated by an automated tool.
1 - 25
Iteration
X+1
Iteration
X+2
Requirements Capture
Analysis and Design
Project
Planning
Define
Mission
Implementation
Build
Validate
Build
Test and
Evaluate
Achieve
Mission
Improve
Assets
Verify Approach
Time
26
The testing lifecycle is a part of the software lifecycle; both should start in an
equivalent time frame. The design and development process for tests can be as
complex and arduous as the process for developing the software product itself. If tests
do not start in line with the first executable software releases, the test effort will back
load the discovery of potentially important problems until late in the development
cycle.
1 - 26
Develop Iteratively
Manage Requirements
Use Component
Architectures
Model Visually (UML)
Continuously Verify Quality
Manage Change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
27
You cannot stop change from being introduced into a project. However, you must
control how and when changes are introduced into project artifacts, and who
introduces those changes.
You must also synchronize changes across development teams and locations.
Unified Change Management (UCM) is the Rational Software approach to managing
change in software system development, from requirements to release.
1 - 27
Configuration
Management is
more than just
check-in and
check-out
Parallel
Development
REPORT
Process
Integration
ALERT
Build
Management
28
Establishing a secure workspace for each developer provides isolation from changes
made in other workspaces and control of all software artifacts models, code,
documents and so forth.
A key challenge to developing software-intensive systems is the need to cope with
multiple developers, organized into different teams, possibly at different sites, all
working together on multiple iterations, releases, products, and platforms. In the
absence of disciplined control, the development process rapidly degrades into chaos.
Progress can come to a stop.
Three common problems that result are:
1 - 28
Simultaneous update: When two or more roles separately modify the same
artifact, the last one to make changes destroys the work of the former.
Aspects of a CM System
Aspects of a CM System
Change Request Management (CRM)
Configuration Status Reporting
Configuration Management (CM)
Change Tracking
Version Selection
Software Manufacture
29
1 - 29
Activity-Based Management
Tasks
Defects
Enhancements
Progress Tracking
Charts
Reports
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
30
1 - 30
Manage Requirements
Use Component Architectures
Validates architectural
decisions early on
Addresses complexity of
design/implementation incrementally
Manage Change
31
In the case of our Six Best Practices, the whole is much greater than the sum of the
parts. Each of the Best Practices reinforces and, in some cases, enables the others.
This slide shows just one example: how iterative development leverages the other five
Best Practices. However, each of the other five practices also enhances iterative
development. For example, iterative development done without adequate
requirements management can easily fail to converge on a solution. Requirements
can change at will, users cannot agree, and the iterations go on forever.
When requirements are managed, this is less likely to happen. Changes to
requirements are visible, and the impact on the development process is assessed
before the changes are accepted. Convergence on a stable set of requirements is
ensured. Similarly, each pair of Best Practices provides mutual support. Hence,
although it is possible to use one Best Practice without the others, it is not
recommended, since the resulting benefits will be significantly decreased.
1 - 31
1 - 32
32
Best Practices
33
The Rational Unified Process (RUP) is a generic business process for object-oriented
software engineering. It describes a family of related software-engineering processes
sharing a common structure and a common process architecture. It provides a
disciplined approach to assigning tasks and responsibilities within a development
organization. Its goal is to ensure the production of high-quality software that meets
the needs of its end users within a predictable schedule and budget. The RUP
captures the Best Practices in modern software development in a form that can be
adapted for a wide range of projects and organizations.
The UML provides a standard for the artifacts of development (semantic models,
syntactic notation, and diagrams): the things that must be controlled and exchanged.
But the UML is not a standard for the development process. Despite all of the value
that a common modeling language brings, you cannot achieve successful
development of todays complex systems solely by the use of the UML. Successful
development also requires employing an equally robust development process, which
is where the RUP comes in.
1 - 33
34
Examples:
1 - 34
The dynamic structure (phases and iterations) of the Rational Unified Process
creates the basis of iterative development.
The Use-Case Model of the Requirements discipline and the risk list determine
what functionality you implement in an iteration.
The Workflow Details of the Requirements discipline show the activities and
artifacts that make requirements management possible.
The Unified Modeling Language (UML) used in the process represents the basis
of visual modeling and has become the de facto modeling language standard.
The focus on software architecture allows you to articulate the structure: the
components, the ways in which they integrate, and the fundamental mechanisms
and patterns by which they interact.
New or changed
requirements
Software Engineering
Process
New or changed
system
35
1 - 35
Elaboration
Construction
Transition
time
36
During Inception, we define the scope of the project: what is included and what is
not. We do this by identifying all the actors and use cases, and by drafting the most
essential use cases (typically 20% of the complete model). A business plan is
developed to determine whether resources should be committed to the project.
During Elaboration, we focus on two things: getting a good grasp of the requirements
(80% complete) and establishing an architectural baseline. If we have a good grasp of
the requirements and the architecture, we can eliminate a lot of the risks, and we will
have a good idea of how much work remains to be done. We can make detailed
cost/resource estimations at the end of Elaboration.
During Construction, we build the product in several iterations up to a beta release.
During Transition, we move the product to the end user and focus on end-user
training, installation, and support.
The amount of time spent in each phase varies. For a complex project with many
technical unknowns and unclear requirements, Elaboration may include three-to-five
iterations. For a simple project, where requirements are known and the architecture
is simple, Elaboration may include only a single iteration.
1 - 36
Inception
Elaboration
Construction
Transition
time
Lifecycle
Objective
Milestone
(LCO)
Lifecycle
Architecture
Milestone
(LCA)
Initial Operational
Capability
Milestone
(IOC)
Product
Release
37
At each of the major milestones, we review the project and decide whether to
proceed with it as planned, to cancel the it, or to revise it. The criteria used to make
these decisions vary by phase.
LCO: scope is agreed upon and risks are understood and reasonable
LCA: high risks are addressed and architecture is stable
IOC: product is complete and quality is acceptable
The evaluation criteria for the Inception phase (LCO) include: stakeholder
concurrence on scope definition and cost/schedule estimates; requirements
understanding as evidenced by the fidelity of the primary use cases; credibility of
cost/schedule estimates, priorities, risks, and development process; depth and
breadth of any architectural prototype; actual expenditures versus planned
expenditures.
The evaluation criteria for the Elaboration phase (LCA) include: stability of the
product vision and architecture; resolution of major risk elements; adequate planning
and reasonable estimates for project completion; stakeholder acceptance of the
product vision and project plan; and acceptable expenditure level.
The evaluation criteria for the Construction phase (IOC) include: stability and
maturity of the product release (that is, is it ready to be deployed?); readiness of the
stakeholders for the transition; and acceptable expenditure level.
At the end of the Transition phase, we decide whether to release the product. We
base this primarily on the level of user satisfaction achieved during the Transition
phase. Often this milestone coincides with the initiation of another development
cycle to improve or enhance the product. In many cases, this new development cycle
may already be underway.
1 - 37
Elaboration
Construction
Devel.
Iteration
Transition
38
Within each phase, there is a series of iterations. The number of iterations per phase
will vary. Each iteration results in an executable release encompassing larger and
larger subsets of the final application.
An internal release is kept within the development environment and (optionally)
demonstrated to the stakeholder community. We provide stakeholders (usually users)
with an external release for installation in their environment. External releases are
much more expensive because they require user documentation and technical
support because of this, they normally occur only during the Transition phase.
The end of an iteration marks a minor milestone. At this point, we assess technical
results and revise future plans as necessary.
1 - 38
Disciplines
group
activities
logically.
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
39
This slide illustrates how phases and iterations (the time dimension) relate to the
development activities (the discipline dimension). The relative size of each color area
in the graph indicates how much of the activity is performed in each phase or
iteratino.
Each iteration involves activities from all disciplines. The relative amount of work
related to the disciplines changes between iterations. For instance, during late
Construction, the main work is related to Implementation and Test and very little
work on Requirements is done.
Note that requirements are not necessarily complete by the end of Elaboration. It is
acceptable to delay the analysis and design of well-understood portions of the system
until Construction because they are low in risk.
1 - 39
Business
Modeling
Disciplines
Requirements
Analysis &
Design
Implementation
Use-Case
Model
Realized By
Implemented
By
Models
Realized
By
Business
Object Model
Automated
By
40
The RUP takes a model-driven approach. Several models are needed to fully describe
the evolving system. Each major discipline produces one of those models. The models
are developed incrementally across iterations.
The Business Model is a model of what the business processes are and of the
business environment. It can be used to generate requirements of supporting
information systems.
The Use-Case Model is a model of what the system is supposed to do and of the
system environment.
The Design Model is an object model describing the realization of use cases. It
serves as an abstraction of the implementation model and its source code.
1 - 40
Requirements:
Workflow
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
41
Within a discipline, workflows group activities that are done together. Discipline
workflows will be present in varying degrees, depending on the phase.
1 - 41
Phase
Considers
Described by
Iteration
Workflow
Detail
Discipline
Participates in
References
Role
Activity
Responsible for
Document
Modifies
Model
Model
Element
Artifact
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
42
1 - 42
Review
Review
Best Practices guide software engineering
by addressing root causes.
Best Practices reinforce each other.
Process guides a team on who does what,
when, and how.
The Rational Unified Process is a means of
achieving Best Practices.
43
1 - 43
1 - 44
Module 2
Concepts of Object Orientation
Topics
What Is Object Technology?................................................................................. 2-4
Basic Principles of Object Orientation................................................................. 2-15
Representing Classes in the UML ........................................................................ 2-24
Review............................................................................................................... 2-51
2-1
2-2
2-3
2-4
Object technology is used for creating models that reflect a specific domain using
the terminology of the domain.
Models created using object technology are easy to create, change, expand,
validate, and verify.
Systems built using object technology are flexible to change, have well-defined
architectures, and allow reusable components to be created and implemented.
Provides stability
A small change in requirements does not mean massive
changes in the system under development
Is adaptive to change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
The UML represents a convergence of Best Practices throughout the objecttechnology industry. It provides a consistent language that can be applied to both
system and business engineering.
Object technology can help a company change its systems almost as fast as the
company itself changes.
2-5
What Is a Model?
What Is a Model?
A model is a simplification of reality.
2-6
Why Do We Model?
Why Do We Model?
We build models to better understand the system
we are developing.
Modeling achieves four aims. It:
Helps us to visualize a system as we want it to be.
Permits us to specify the structure or behavior of a
system.
Gives us a template that guides us in constructing a
system.
Documents the decisions we have made.
According to The Unified Modeling Language Use Guide (Booch, Rumbaugh, and
Jacobson, 1998), modeling achieves four aims:
Models document the decisions that have been made. Models are valuable tools
in the long term because they give hard information on design decisions. You
dont need to rely on someones memory.
2-7
What Is an Object?
What Is an Object?
Informally, an object represents an entity,
either physical, conceptual, or software.
Physical entity
Truck
Conceptual entity
Chemical Process
Software entity
Linked List
2-8
Attributes
State is represented by
attributes and
relationships.
Behavior is represented
by operations, methods,
and state machines.
Object
Operations
An object is an entity that has a well-defined boundary. That is, the purpose of
the object should be clear.
Object state and behavior are discussed on the next few slides.
2-9
Name: J Clark
Employee ID: 567138
HireDate: 07/25/1991
Status: Tenured
Discipline: Finance
MaxLoad: 3
Name: J Clark
Employee ID: 567138
Date Hired: July 25, 1991
Status: Tenured
Discipline: Finance
Maximum Course Load: 3 classes
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
2 - 10
Professor Clark
10
The state of an object is one of the possible conditions that an object may exist
in, and it normally changes over time.
Ac
ce
pt
C
ou
rs
eO
Su
bm
itF
in
al
G
ra
de
s(
Se
tM
ax
Lo
ad
()
ffe
ri n
g(
TakeSabbatical()
Professor Clark
11
Behavior determines how an object acts and reacts to requests from other
objects.
Object behavior is represented by the operations that the object can perform.
For example, Professor Clark can choose to take a sabbatical once every five
years. The Professor Clark object represents this behavior through the
TakeSabbatical() operation.
2 - 11
Professor J Clark
teaches Biology
Professor J Clark
teaches Biology
12
In the real world, two people can share the same characteristics: name, birth date,
job description. Yet, there is no doubt that they are two individuals with their own
unique identities.
The same concept holds true for objects. Although two objects may share the same
state (attributes and relationships), they are separate, independent objects with their
own unique identity.
2 - 12
Named Object
: Professor
Professor J Clark
Unnamed Object
13
Within the rectangle, underlined, is the name of the class. To name an object,
add its name before the colon.
2 - 13
<<stereotype>>
Stereotype
Class
14
2 - 14
The new element may contain additional semantics but still applies in all cases
where the original element is used. In this way, the number of unique UML
symbols is reduced, simplifying the overall notation.
A unique icon may be defined for the stereotype, and the new element may be
modeled using the defined icon or the original icon with the stereotype name
displayed, or both.
Hierarchy
Modularity
Encapsulation
Abstraction
Object Orientation
15
Abstraction
Encapsulation
Modularity
Hierarchy
2 - 15
What Is Abstraction?
What Is Abstraction?
The essential characteristics
of an entity that distinguish it
from all other kinds of entities
Defines a boundary relative to
the perspective of the viewer
Is not a concrete manifestation,
denotes the ideal essence of
something
16
2 - 16
OO allows us to model our system using abstractions from the problem domain
(for example, classes and objects).
Example: Abstraction
Example: Abstraction
Student
Professor
A course offering is a specific offering for a course, including days of the week
and times.
2 - 17
What Is Encapsulation?
What Is Encapsulation?
Hide implementation from clients.
Clients depend on interface.
Improves Resiliency
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
18
2 - 18
Encapsulation Illustrated
Encapsulation Illustrated
SetMaxLoad(4)
i tF
in
al
G
ra
de
s
()
Professor Clark
Su
bm
Professor Clark
needs to be able
to teach four
classes in the
next semester.
Se
tM
Ac
ce
pt
Co
ur
se
O
Name: J Clark
Employee ID: 567138
HireDate: 07/25/1991
Status: Tenured
Discipline: Finance
MaxLoad:4
ff e
ri n
g(
ax
Lo
ad
()
TakeSabbatical()
19
For example, Professor Clark needs to have her maximum course load increased
from three classes to four classes per semester. Another object will make a
request to Professor Clark to set the maximum course load to four.The attribute,
MaxLoad, is then changed by the SetMaxLoad() operation.
2 - 19
What Is Modularity?
What Is Modularity?
Modularity is the breaking
up of something complex into
manageable pieces.
Modularity helps people to
understand complex systems.
20
2 - 20
Example: Modularity
Example: Modularity
For example, break
complex systems into
smaller modules.
Billing
System
Course
Catalog
System
Course Registration
System
Student
Management
System
21
2 - 21
What Is Hierarchy?
What Is Hierarchy?
Asset
Increasing
abstraction
BankAccount
Savings
Decreasing
abstraction
Security
Checking
Stock
RealEstate
Bond
22
2 - 22
In any one system, there may be multiple abstraction hierarchies (for example, a
financial application may have different types of customers and accounts).
What Is a Class?
What Is a Class?
A class is a description of a set of objects that
share the same attributes, operations,
relationships, and semantics.
An object is an instance of a class.
23
Recognizing the commonalties among the objects and defining classes helps us
deal with the potential complexity.
2 - 23
2 - 24
Professor J Clark
24
The UML notation for a class permits you to see an abstraction apart from any
specific programming language, which lets you emphasize the most important
parts about an abstraction its name, attributes, and operations.
Professor
Professor Torpie
Professor Meijer
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Professor Allen
25
An object is defined by a class. A class defines a template for the structure and
behavior of all its objects. The objects created from a class are also called the
instances of the class.
The class is the static description; the object is a run-time instance of that class.
Since we model from real-world objects, software objects are based on the realworld objects, but they exist only in the context of the system.
Starting with real-world objects, abstract out what you do not care about. Then,
take these abstractions and categorize, or classify them, based on what you do
care about. Classes in the model are the result of this classification process.
These classes are then used as templates within an executing software system to
create software objects. These software objects represent the real-world objects
we originally started with.
2 - 25
What Is an Attribute?
What Is an Attribute?
An attribute is a named property of a class that
describes a range of values that instances of
the property may hold.
A class may have any number of attributes or no attributes at all.
Student
Attributes
- name
- address
- studentID
- dateOfBirth
26
2 - 26
A class may have any number of attributes or no attributes at all. At any time, an
object of a class will have specific values for every one of its class attributes.
An attribute has a type, which tells us what kind of attribute it is. Typical
attributes are integer, Boolean, real, and enumeration. These are called primitive
types. Primitive types can be specific for a certain programming language.
What Is an Operation?
What Is an Operation?
An operation is the implementation of a service
that can be requested from any object of the
class to affect behavior.
A class may have any number of operations or
none at all.
Student
Operations
+ getTuition()
+ addSchedule()
+ getSchedule()
+ deleteSchedule()
+ hasPrerequisites()
27
The outcome of the operation depends on the current state of the object. Often,
but not always, invoking an operation on an object changes the objects data or
state.
2 - 27
What Is Polymorphism?
What Is Polymorphism?
The ability to hide many different
implementations behind a single interface
Manufacturer A
Manufacturer B
Manufacturer C
OO Principle:
Encapsulation
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
28
The Greek term polymorphos means having many forms. There may be one or
many implementations of a given interface. Every implementation of an interface
must fulfill the requirements of that interface. In some cases, the implementation can
perform more than the basic interface requirements.
For example, the same remote can be used to control any type of television
(implementation) that supports the specific interface that the remote was designed to
be used with.
2 - 28
Example: Polymorphism
Example: Polymorphism
financialInstrument.getCurrentValue()
ge
tC
urr
en
tVa
lue
()
Stock
ge
tCu
rre
ntV
a
lue
()
Bond
ge
tCu
rre
ntV
a
lue
()
Mutual Fund
29
In this example, a requesting object would like to know the current value of a
financial instrument. However, the current value for each financial instrument is
calculated in a different fashion. The stock needs to determine the current asking
price in the financial market that it is listed under. The bond needs to determine the
time to maturity and interest rates. A mutual fund needs to look up the closing price
for the day from the fund management company.
In a non object-oriented development environment, we would write code that may
look something like this:
IF financialInstrument = Stock THEN
calcStockValue()
IF financialInstrument = Bond THEN
calcBondValue()
IF financialInstrument = MutualFund THEN
calcMutualFundValue()
With object technology, each financial instrument can be represented by a class, and
each class will know how to calculate its own value. The requesting object simply
needs to ask the specific object (for example, Stock) to get its current value. The
requesting object does not need to keep track of three different operation signatures.
It only needs to know one. Polymorphism allows the same message to be handled in
different ways, depending on the object that receives it.
2 - 29
What Is an Interface?
What Is an Interface?
Interfaces formalize polymorphism
Interfaces support plug-and-play architectures
Tube
<<interface>>
Shape
Pyramid
+ draw()
+ move()
+ scale()
+ rotate()
Cube
Realization relationship
(stay tuned for realization relationships)
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
30
From the UML Users Guide (Booch, 1999): An interface is a collection of operations
that are used to specify a service of a class or a component.
Interfaces formalize polymorphism. They allow us to define polymorphism in a
declarative way, unrelated to implementation. Two elements are polymorphic with
respect to a set of behaviors if they realize the same interfaces. In other words, if two
objects use the same behaviors to get different, but similar results, they are
considered to be polymorphic. A cube and a pyramid can both be drawn, moved,
scaled, and rotated, but they look very different.
You have probably heard that polymorphism is one of the big benefits of object
orientation, but without interfaces there is no way to enforce it, verify it, or even
express it except in informal or language-specific ways. Formalization of interfaces
strips away the mystery of polymorphism and gives us a good way to describe, in
precise terms, what polymorphism is all about. Interfaces are testable, verifiable, and
precise.
Interfaces are the key to the plug-and-play ability of an architecture: Any classifiers
(for example, classes, subsystems, components) that realize the same interfaces may
be substituted for one another in the system, thereby supporting the changing of
implementations without affecting clients.
Realization relationships are discussed later in this module.
2 - 30
Elided/Iconic
Representation
(lollipop)
Pyramid
Shape
Cube
Canonical
(Class/Stereotype)
Representation
<<interface>>
Tube
Shape
Pyramid
+ draw()
+ move()
+ scale()
+ rotate()
Cube
31
The lollipop notation is best used when you only need to denote the existence of an
interface. If you need to see the details of the interface (for example, the operations),
then the class/stereotype representation is more appropriate.
From The Random House Collegiate Dictionary:
2 - 31
What Is a Package?
What Is a Package?
A package is a general-purpose mechanism for
organizing elements into groups.
It is a model element that can contain other
model elements.
UniversityArtifacts
32
2 - 32
Models can contain hundreds and even thousands of model elements. The sheer
number of these elements can quickly become overwhelming. Therefore, it is
critical to group model elements into logical collections to maintain and easily
read the model (application of modularity and hierarchy).
What Is a Subsystem?
What Is a Subsystem?
A combination of a package (can contain other
model elements) and a class (has behavior)
Realizes one or more interfaces which define
its behavior
Subsystem
Realization
Interface
<<subsystem>>
SubsystemName
Interface1
33
A subsystem is a model element that has the semantics of a package, such that it can
contain other model elements, and a class, such that it has behavior. (The behavior of
the subsystem is provided by classes or other subsystems it contains.) A subsystem
realizes one or more interfaces, which define the behavior it can perform.
From the UML Users Guide (Booch, 1999): A subsystem is a grouping of elements of
which some constitute a specification of the behavior offered by the other contained
elements.
A subsystem may be represented as a stereotyped package.
The realization relationship will be discussed later in this module.
2 - 33
What Is a Component?
What Is a Component?
A non-trivial, nearly independent, and
replaceable part of a system that fulfills
a clear function in the context of a welldefined architecture
A component may be
A source code component
A run time component
Source File
Name
<<DLL>>
Component
Interface
An executable component
Component
Name
<<EXE>>
Executable
Name
OO Principle: Encapsulation
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
34
From the UML Users Guide (Booch, 1999): A component is a physical and
replaceable part of a system that conforms to and provides the realization of a set of
interfaces.
Software components include:
Source code components (for example, .h, .cpp files, shell scripts, data files),
Binary code components. Examples include: Java Beans, ActiveX controls, COM
objects (DLL's and OCX's from VB), CORBA objects), and
Stereotypes (with alternate icons) may be used to define these specific kinds of
components.
Component-based development is the creation and deployment of software-intensive
systems assembled from components. Component software development should not
be confused with object-oriented programming (OOP). OOP is a way to build
object-based software components. Component-based development (CBD) is a
technology that allows you to combine object-based components. OOP is concerned
with creating objects, CBD is concerned with making objects work together.
A component conforms to and provides the physical realization of a set of interfaces.
Components are implementation things. They are the physical realization of an
abstraction in your design. Interfaces were discussed earlier in this module.
2 - 34
Implementation Model
<<subsystem>>
Component Name
Component
Interface
Component
Interface
Component
Name
35
2 - 35
2 - 36
36
37
2 - 37
What Is an Association?
What Is an Association?
The semantic relationship between two or
more classifiers that specifies connections
among their instances
A structural relationship, specifying that objects of one
thing are connected to objects of another
<<Entity>>
<<Entity>>
<<Entity>>
Student
Schedule
Course
38
2 - 38
The way that we show relationships between classes is through the use of
associations. Associations are represented on class diagrams by a line connecting
the associating classes. Data may flow in either direction or in both directions
across a link.
Most associations are simple. That is, they exist between exactly two classes.
They are drawn as solid paths connecting pairs of class symbols. Ternary
relationships are also possible.
Sometimes, a class has an association to itself. This does not always mean that an
instance of that class has an association to itself. More often, it means that one
instance of the class has associations to other instances of the same class.
This example shows that a student object is related to a schedule object. The
course class demonstrates how a course object can be related to another course
object.
What Is Multiplicity?
What Is Multiplicity?
Multiplicity is the number of instances one class
relates to ONE instance of another class.
For each association, there are two multiplicity
decisions to make, one for each end of the
association.
For each instance of Professor, many Course
Offerings may be taught.
For each instance of Course Offering, there may be
either one or zero Professor as the instructor.
<<Entity>>
Professor
<<Entity>>
+ instructor
CourseOffering
0..1
0..*
39
For each role, you can specify the multiplicity of its class and how many objects
of the class can be associated with one object of the other class.
2 - 39
Multiplicity Indicators
Multiplicity Indicators
Unspecified
Exactly One
Zero or More
0..*
Zero or More
One or More
1..*
0..1
Specified Range
2..4
2 - 40
2, 4..6
40
A single integer is a valid range, and the symbol * indicates "many. That is, an
asterisk * indicates an unlimited number of objects.
The symbol * by itself is equivalent to 0..* That is, it represents any number,
including none. This is the default value.
What Is Aggregation?
What Is Aggregation?
An aggregation is a special form of association
that models a whole-part relationship between
an aggregate (the whole) and its parts.
An aggregation is an Is a part-of relationship.
Part
1
0..1
41
A hollow diamond is attached to the end of an association path on the side of the
aggregate (the whole) to indicate aggregation.
An aggregation relationship that has a multiplicity greater than one for the
aggregate is called shared. Destroying the aggregate does not necessarily destroy
the parts. By implication, a shared aggregation forms a graph or a tree with many
roots. Shared aggregations are used where there is a strong relationship between
two classes. Therefore, the same instance can participate in two different
aggregations.
2 - 41
What Is Navigability?
What Is Navigability?
Indicates that it is possible to navigate from a
associating class to the target class using the
association
<<Control>>
RegistrationController
<<Entity>>
<<Entity>>
Schedule
CourseOffering
2 - 42
42
In the course registration example, the association between the Schedule and the
Course Offering is navigable in both directions. That is, a Schedule must know
the Course Offering assigned to the Schedule, and the Course Offering must
know the Schedules it has been placed in.
In the case of the association between Schedule and Registration Controller, the
Registration Controller must know its Schedules, but the Schedules have no
knowledge of the Registration Controllers (or other classes). As a result, the
navigability property of the Registration Controller end of the association is
turned off.
Relationships: Dependency
Relationships: Dependency
A relationship between two model elements
where a change in one may cause a change in
the other
Non-structural, using relationship
Dependency
relationship
Client
Class
Supplier
Dependency
relationship
Component
Client
Supplier
Dependency
relationship
Package
ClientPackage
SupplierPackage
43
2 - 43
What Is Generalization?
What Is Generalization?
A relationship among classes where one
class shares the structure and/or behavior
of one or more classes
Defines a hierarchy of abstractions in which
a subclass inherits from one or more
superclasses
Single inheritance
Multiple inheritance
Is an is a kind of relationship
44
2 - 44
Single inheritance: The subclass inherits from only one superclass (has only one
parent).
Multiple inheritance: The subclass inherits from more than one superclass (has
multiple parents).
Superclass
(Parent)
(Ancestor)
+ withdraw()
+ createStatement()
Savings
Generalization
Relationship
Checking
Subclass
(Child)
(Descendents)
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
45
The generalization is drawn from the subclass class to the superclass/parent class.
The terms ancestor and descendent can be used instead of superclass and
subclass.
2 - 45
FlyingThing
Animal
Multiple Inheritance
Airplane
Helicopter
Bird
Wolf
Horse
2 - 46
46
Multiple inheritance means that a class can inherit from several other classes.
For example, Bird inherits from both FlyingThing and Animal.
47
Generalization is much more than just finding common attribute, operations, and
relationships. It should be more about the responsibilities and essence of the classes.
2 - 47
+ owner
GroundVehicle
Superclass
(Parent)
0..*
Person
generalization
Car
Truck
Trailer
Subclass
(Child)
48
In the above example, a truck is defined as a vehicle with tonnage and a car is a
vehicle with a size (for example, compact or mid-size).
Specifically, attributes:
Operations:
Relationships:
2 - 48
What Is Realization?
What Is Realization?
One classifier serves as the contract that the other
classifier agrees to carry out, found between:
Interfaces and the classifiers that realize them
Component
Interface
Class
Interface
<<subsystem>>
Interface
Subsystem
UseCase
49
2 - 49
MaintainScheduleForm
2 - 50
50
Review
Review: Concepts of Object Orientation
What are the four basic principles of object
orientation? Provide a brief description of
each.
What is an object and what is a class?
What is the difference between the two?
What is an attribute?
What is an operation?
What is polymorphism? What
is an interface?
51
2 - 51
2 - 52
52
Module 3
Requirements Overview
Topics
Introduction ......................................................................................................... 3-3
Key Concepts ....................................................................................................... 3-7
Use-Case Model................................................................................................. 3-10
Glossary ............................................................................................................. 3-19
Supplementary Specifications ............................................................................. 3-22
Review............................................................................................................... 3-31
3-1
3-2
Introduction
Requirements Overview Topics
Introduction
Key Concepts
Use-Case Model
Glossary
Supplementary Specifications
Checkpoints
3-3
Requirements in Context
Requirements in Context
The purpose of Requirements is to:
The Business Modeling discipline provides organizational context for the system. This
is the context in which the requirements are defined and analyzed.
The purpose of the Requirements discipline is:
To establish and maintain agreement with the customers and other stakeholders
on what the system should do.
To provide a basis for estimating cost and time to develop the system.
To define a user-interface for the system, focusing on the needs and goals of the
users.
The Analysis and Design discipline gets its primary input (the Use-Case Model and
the Glossary) from Requirements. Flaws in the Use-Case Model can be discovered
during Analysis and Design; change requests are then generated, and applied to the
Use-Case Model.
3-4
Glossary
Actors
Use Cases
...
Supplementary
Specification
Use-Case Specifications
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
The Use-Case Model describes what the system will do. The Use-Case Model serves
as a contract between the customer, the users, and the system developers. It allows
customers and users to validate that the system will become what they expected and
allows system developers to ensure that what they build is what is expected. The UseCase Model consists of use cases and actors. Each use case in the model is described
in detail, showing step-by-step how the system interacts with the actors and what the
system does in the use case. The Use-Case Specification is the document where all of
the use-case properties are documented (for example, brief description and use-case
flows of events).
Note: The OOAD course requirements documentation includes Use-Case
Specifications because it is the textual description that will drive Analysis and Design
activities. (Use-case specifications only include the textual use-case properties.)
The Glossary defines a common terminology for all models and contains textual
descriptions of the required system.
The Supplementary Specification contains those requirements that do not map to a
specific use case (for example, nonfunctional requirements). The Supplementary
Specification is an important complement to the Use-Case Model. Together they
capture all requirements (functional and nonfunctional) that need to be described for
a complete System Requirements Specification.
3-5
Course Registration
Requirements Document
Before we discuss the details of the artifacts that drive the Analysis and Design
discipline, it is important that you understand the problem domain that all of the
course exercises will be based on.
With regards to the formal Requirements artifacts, the Problem Statement is part of
the Vision document. The other sections have been omitted for scoping reasons. For
more information on the Vision document, see the Requirements discipline of the
Rational Unified Process.
3-6
Key Concepts
Requirements Overview Topics
Introduction
Key Concepts
Use-Case Model
Glossary
Supplementary Specifications
Checkpoints
In this section, we will discuss the key concepts of use-case modeling the actor
and the use case, as well as what relationships can exist between them. We will also
look at the artifacts that make up the Use-Case Model: Use-Case Specifications, and
activity diagrams.
3-7
3-8
Use cases are the mechanism for capturing the desired behavior for the system
that is under development, but they do not specify how the behavior is to be
implemented.
The UML specifies a model for communicating system behavior the Use-Case
Model.
Actor
An actor represents a coherent set of roles that users of the system play when
interacting with these use cases. Typically, an actor represents a role that a human, a
hardware device, or even another system plays with a system.
A use case is a sequence of actions a system performs to yield an observable result
that is of value to a particular actor. A use case describes what a system does, but it
does not specify how it does it.
3-9
Use-Case Model
Requirements Overview Topics
Introduction
Key Concepts
Use-Case Model
Glossary
Supplementary Specifications
Checkpoints
3 - 10
10
11
When the customer approves the Use-Case Model, you know the system is what
the customer wants. You can also use the model to discuss the system with the
customer during development.
Potential users use the Use-Case Model to better understand the system.
Designers use it as a basis for their work and to get a system overview.
Testers use it to plan testing activities (use case and integration testing) as early as
possible.
Those developing the next version of the system use it to understand how the
existing version works.
Documentation writers use the use cases as a basis for writing the system user
guides.
The manager uses it to plan and follow up on use-case modeling and subsequent
design.
3 - 11
Use Case
Verification
Identification
End User
Users
Domain Expert
12
There are many ways to model a system, each of which may serve a different
purpose. However, the most important role of a Use-Case Model is to communicate
the system's behavior to the customer or end user. Consequently, the model must be
easy to understand.
Communication with the end users and domain experts:
The Use-Case Model is also used to identify the actors that interact with the system.
Because they represent system users, actors help delimit the system and give a clearer
picture of what it is supposed to do. Use cases are developed on the basis of the
actors' needs, ensuring that the system will turn out to be what the users expected.
3 - 12
Course Catalog
Register for Courses
Maintain Professor
Information
Student
Maintain Student
Information
Login
Registrar
Select Courses to
Teach
Close Registration
Professor
Submit Grades
Billing System
13
3 - 13
Use-Case Specifications
Use-Case Specifications
Name
Brief description
Flow of Events
Relationships
Activity diagrams
Use-Case diagrams
Special
requirements
Pre-conditions
Post-conditions
Other diagrams
Use-Case Model
Actors
Use Cases
...
Use-Case Specifications
14
The use case has a set of properties as shown in the graphic. The use-case properties
may be documented in use-case specifications, which can include the items listed
below:
3 - 14
Brief description describes the role and purpose of the use case.
Flow of events are textual descriptions of what the system does with regard to
the use case. There can be multiple flows of events for example, a basic flow
and alternative flows.
Activity diagrams can be used to illustrate the structure of the flow of events.
Use-case diagrams can be used to show the relationships involving the use case.
Pre-conditions define a constraint on the system regarding when the use case
may start.
Post-conditions define a constraint on the system that applies after the use case
has terminated.
Other diagrams can be used to illustrate the use case, like hand-drawn sketches
or screen captures from an user-interface prototype.
15
Contains the most important information derived from use-case modeling work.
Should describe the use case's flow clearly enough for an outsider to easily
understand it.
Should present what the system does, not how the system is designed to perform
the required behavior.
Guidelines for the flow of events. Specify that the content must:
Detail the flow of events. All "what questions should be answered. Remember
that test designers will use this text to identify test cases.
Describe the flow of events, not only the functionality. To reinforce this, start
every action with "When the actor. . . .
Describe only the events that belong to the use case and not what happens in
other use cases or outside of the system.
Describe the data exchanged between the actor and the use case.
Avoid describing the details of the user interface unless they are needed to
provide an understanding the behavior of the system.
3 - 15
What Is a Scenario?
What Is a Scenario?
A scenario is an instance of a use case.
16
3 - 16
Activity2
Activity1
Activity3
17
The workflow of a use case describes what needs to be done by the system to
provide the value that the served actor is looking for.
The workflow often consists of a basic flow and one or several alternative flows.
The structure of the workflow can be described graphically with the help of an
activity diagram.
3 - 17
Concurrent
Threads
[ delete course ]
Activity
State
Delete Course
[ add course ]
Synchronization
Bar (Fork)
Guard
Condition
Check
Schedule
[ checks completed ]
Assign to
Course
Check
Pre-requisites
[ checks failed ]
Resolve
Conflicts
Synchronization
Bar (Join)
Transition
Update
Schedule
18
3 - 18
Glossary
Requirements Overview Topics
Introduction
Key Concepts
Use-Case Model
Glossary
Supplementary Specifications
Checkpoints
19
3 - 19
Glossary
Glossary
Course Registration System Glossary
1.
Introduction
Definitions
The glossary contains the working definitions for the key concepts in the
Course Registration System.
2.1
Glossary
2.2
Course Offering: A specific delivery of the course for a specific
semester you could run the same course in parallel sessions in the
semester. Includes the days of the week and times it is offered.
2.3
Course Catalog: The unabridged catalog of all courses offered by
the university.
20
3 - 20
21
The idea is not to go over the Glossary in vivid detail, but to demonstrate how to read
it, where to look for information you will need during the Analysis and Design
activities, as well as how to detect if it is insufficient.
3 - 21
Supplementary Specifications
Requirements Overview Topics
Introduction
Key Concepts
Use-Case Model
Glossary
Supplementary Specifications
Checkpoints
3 - 22
22
Supplementary Specification
Supplementary Specification
Functionality
Usability
Reliability
Performance
Supportability
Design constraints
Supplementary
Specification
23
The nonfunctional requirements and functional requirements not captured by the use
cases are included in the Supplementary Specifications. The Supplementary
Specifications include constraints on the implementation.
Functionality: List of the functional requirements that are general to many use cases.
Usability: Requirements that relate to, or affect, the usability of the system. Examples
include ease-of-use requirements or training requirements that specify how readily
the system can be used by its actors.
Reliability: Any requirements concerning the reliability of the system. Quantitative
measures such as mean time between failure or defects per thousand lines of code
should be stated.
Performance: The performance characteristics of the system. Include specific
response times. Reference related use cases by name.
Supportability: Any requirements that will enhance the supportability or
maintainability of the system being built.
Design Constraints: Any design constraints on the system being built.
Supplementary Specifications go hand-in-hand with the Use-Case Model, implying
that:
They are initially considered in the Inception phase as a complement to defining
the scope of the system.
They are refined in an incremental fashion during the Elaboration and
Construction phases.
3 - 23
Course
Registration
Requirements
Document
Supplementary
Specification
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
24
The idea is not to go over the Supplementary Specification in vivid detail, but to
demonstrate how to read it, where to look for information you will need during the
Analysis and Design activities, as well as how to detect if it is insufficient.
3 - 24
25
3 - 25
26
The above, as well as the remaining checklists in this section, is a sample of the kinds
of things to look for when reviewing the Use-Case Model. Explicit, detailed checklists
should be established for the project to support the review of the Use-Case Model.
Verify that there are no open questions. The use cases you found must be able to
perform all system behaviors; if not, some use cases are missing. If you intentionally
left any requirements to be dealt with in the object models, such as nonfunctional
requirements, you must mention this. Put the reference in the Supplementary
Specification(s) unless the requirement concerns a specific use case, in which case
state it in the Special Requirements section of the use case.
The Use-Case Model should not present more functions than were called for in the
requirements.
Traceability from the original requirements to the use cases and the Supplementary
Specification is critical for project management and impact assessment as well as to
make sure nothing has been missed.
The packaging should make the Use-Case Model simple and intuitive to understand
and maintain.
3 - 26
27
Make sure that all the roles in the system's environment have been accounted for and
modeled. You will not be able to do this fully until you have found and described all
the use cases.
Remove any actors not mentioned in the use-case descriptions or that have no
communicates-associations with a use case. However, an actor mentioned in a usecase description is likely to have a communicates-association with that particular use
case.
You should be able to name at least two people who would be able to perform as a
particular actor. If not, see if the role the actor models is part of another role. If so,
you should merge the actors.
If any actors play similar roles in relation to the system, they should be merged into a
single actor. If a particular actor will use the system in several completely different
ways, or has several completely different purposes for using the use case, then there
should probably be more than one actor.
If two actors play the same role in relation to a use case, then actor-generalizations
should be used to model their shared behavior.
It is important that actor names correspond to their roles.
3 - 27
28
A use case that does not interact with an actor is superfluous. You should remove it.
If two use cases are always activated in the same sequence, you should probably
merge them into one use case.
Use cases that have very similar behaviors or flows of events, or will be similar in the
future, should be merged into a single use case. This makes it easier to introduce
future changes.
Note: You must involve the users if you decide to merge use cases because the users,
who interact with the new, merged use case will probably be affected.
If some part of the flow of events is already part of another use case, the sub-flow
should be extracted and then be used by all of the use cases in question.
Note: You must involve the users if you decide to "reuse" the sub-flow, because the
users of the existing use case will probably be affected.
Each use-case name must describe the behavior the use case supports. The names
and descriptions must be understood by the users and customers.
3 - 28
29
3 - 29
30
If each Glossary term is not included somewhere in the use-case descriptions, that
may imply that a use case is missing or that the existing use cases are not complete. It
is more likely, though, that the term is not included because it is not needed, and it
should be removed from the Glossary.
A term should represent the same thing in all use-case descriptions.
3 - 30
Review
Review: Requirements Overview
What are the main artifacts of Requirements?
What are the Requirements artifacts used for?
What is a Use-Case Model?
What is an actor?
What is a use case? List examples of use case
properties.
What is the difference between a use case and a
scenario?
What is a Supplementary Specification
and what does it include?
What is a Glossary and what does
it include?
31
3 - 31
32
These artifacts will be used as the basis for the remainder of the examples and
exercises in this course, so you need to have a good foundation for moving forward.
All questions, issues, etc. regarding the Requirements artifacts will be recorded and
addressed here.
You will not be reviewing the use-case flow of events at this point. They will be
reviewed in detail later in the course.
The Requirements artifacts for this exercise can be found in the Payroll Requirements
Document. See the documents table of contents for specific page numbers.
3 - 32
Module 4
Analysis and Design Overview
Topics
Key Concepts ....................................................................................................... 4-5
Analysis and Design Workflow............................................................................ 4-11
4-1
This Analysis and Design Overview module provides an overview of the Analysis and
Design Discipline. It also defines the terms that span all Analysis and Design activities.
The details of each of the Analysis and Design activities will be described in
subsequent modules. This module is meant to provide context for these detailed
Analysis and Design activity modules.
4-2
The Requirements Discipline provides the primary input for Analysis and Design.
The Test Discipline tests the system designed during Analysis and Design.
The Environment Discipline develops and maintains the supporting artifacts that
are used during Analysis and Design.
The Management Discipline plans the project and each iteration (described in
an Iteration Plan).
4-3
Use-Case Model
Glossary
Analysis
and Design
Design Model
Architecture
Document
Supplementary
Specification
Data Model
The input artifacts are the Use-Case Model, Glossary, and Supplementary
Specification from the Requirements Discipline. The result of Analysis and Design is
a Design Model that serves as an abstraction of the source code; that is, the Design
Model acts as a blueprint of how the source code is structured and written. The
Design Model consists of design classes structured into design packages; it also
contains descriptions of how objects of these design classes collaborate to perform
use cases (use-case realizations).
The design activities are centered around the notion of architecture. The production
and validation of this architecture is the main focus of early design iterations.
Architecture is represented by a number of architectural views that capture the major
structural design decisions. In essence, architectural views are abstractions or
simplifications of the entire design, in which important characteristics are made more
visible by leaving details aside. The architecture is an important vehicle not only for
developing a good Design Model, but also for increasing the quality of any model
built during system development. The architecture is documented in the Architecture
Document.
The development of the Architecture Document is out of the scope of this course, but
we will discuss it is contents and how to interpret them.
4-4
Key Concepts
Analysis & Design Overview Topics
Key Concepts
Analysis and Design Workflow
We will start out by defining some key terms and concepts needed to describe the
Analysis and Design workflow. These terms will be explained in more detail, along
with other important terms and concepts in later modules of the course.
Once we have a common vocabulary, then we will walk through the Analysis and
Design workflow.
4-5
Design
Focus on
understanding the
problem
Idealized design
Behavior
System structure
Functional
requirements
A small model
Focus on
understanding the
solution
Operations and
attributes
Performance
Close to real code
Object lifecycles
Nonfunctional
requirements
A large model
The differences between Analysis and Design are ones of focus and emphasis. The
above slide lists the things that you focus on in Analysis versus Design.
The goal in Analysis is to understand the problem and to begin to develop a visual
model of what you are trying to build, independent of implementation and
technology concerns. Analysis focuses on translating the functional requirements into
software concepts. The idea is to get a rough cut at the objects that comprise our
system, but focusing on behavior (and therefore encapsulation). We then move very
quickly, nearly seamlessly, into Design and the other concerns.
A goal of Design is to refine the model with the intention of developing a Design
Model that will allow a seamless transition to the coding phase. In design, we adapt
to the implementation and the deployment environment. The implementation
environment is the developer environment, which is a software superset and a
hardware subset of the deployment environment
In modeling, we start with an Object Model that closely resembles the real world
(Analysis), and then find more abstract (but more fundamental) solutions to a more
generalized problem (Design). The real power of software design is that it can create
more powerful metaphors for the real world that change the nature of the problem,
making it easier to solve.
4-6
Top
Down
Subsystems
Use Cases
Bottom
Up
Analysis Classes
(Define a
middle level)
Design Classes
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
4-7
What Is Architecture?
What Is Architecture?
Software architecture encompasses a set of
significant decisions about the organization
of a software system.
Selection of the structural elements and their
interfaces by which a system is composed
Behavior as specified in collaborations among
those elements
Composition of these structural and behavioral
elements into larger subsystems
Architectural style that guides this organization
Grady Booch, Philippe Kruchten, Rich Reitman, Kurt Bittner; Rational
(derived from Mary Shaw)
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
4-8
4-9
Logical View
Analysts/Designers
Structure
Implementation View
End-user
Functionality
Programmers
Software management
Use-Case View
Process View
Deployment View
System integrators
Performance
Scalability
Throughput
System engineering
System topology
Delivery, installation
communication
10
The above diagram shows the model Rational uses to describe the software
architecture.
Architecture is many things to many different interested parties. On a particular
project, there are usually multiple stakeholders, each with their own concerns and
view of the system to be developed. The goal is to provide each of these stakeholders
with a view of the system that addresses their concerns, and suppresses the other
details.
To address these different needs, Rational has defined the 4+1 view architecture
model. An architectural view is a simplified description (an abstraction) of a system
from a particular perspective or vantage point, covering particular concerns, and
omitting entities that are not relevant to this perspective. Views are slices of models.
Not all systems require all views (for example, single processor: drop Deployment
View; single process: drop Process View; small program: drop Implementation View,
and so forth). A project may document all of these views or additional views. The
number of views is dependent on the system you are building.
Each of these views, and the UML notation used to represent them, will be discussed
in subsequent modules.
4 - 10
11
Because we have a common vocabulary, we can now briefly discuss the activities of
Analysis and Design and how they work together.
4 - 11
[Inception
Iteration (Optional)]
Perform
Architectural
Synthesis
Define a Candidate
Architecture
Analysis
Analyze Behavior
(Optional)
Refine the
Architecture
Design
Define
Components
Design the
Database
12
A mere enumeration of all workers, activities, and artifacts does not constitute a
process. We need a way to describe the activities, some valuable result, and
interactions between workers. A workflow is a sequence of activities that produces a
result of observable value.
In UML terms, a workflow can be expressed as a sequence diagram, a collaboration
diagram, or an activity diagram. We use a form of activity diagram in the Rational
Unified Process. For each core workflow, an activity diagram is presented. This
diagram shows the workflow, expressed in terms of workflow details.
This slide shows the Analysis and Design workflow. The early Elaboration Phase
focuses on creating an initial architecture for the system (Define a Candidate
Architecture) to provide a starting point for the main analysis work. If the architecture
already exists (because it was produced in previous iterations, or projects, or is
obtained from an application framework), the focus of the work changes to refining
the architecture (Refine the Architecture) analyzing behavior, and creating an initial
set of elements that provide the appropriate behavior (Analyze Behavior).
After the initial elements are identified, they are further refined. Design Components
and Design Real-Time Components produce a set of components that provide the
appropriate behavior to satisfy the requirements on the system. In parallel with these
activities, persistence issues are handled in Design the Database. The result is an
initial set of components that are further refined in the Implementation Discipline.
4 - 12
Architect
Designer
13
Remember, for Analysis and Design, we start out with the Use-Case Model and the
supplementary specifications from the Requirements Discipline and end up with the
Design Model that serves as an abstraction of the source code.
The design activities are centered around the notion of architecture. The production
and validation of this architecture are the main focal points of early design iterations.
The architecture is an important vehicle not only for developing a good Design
Model, but also for increasing the quality of any model built during system
development.
The focus of this course is on the activities of the designer. The architect activities are
discussed, but many of the architectural decisions will be given. Each of the architect
and designer activities will be addressed in individual course modules.
4 - 13
Analysis Model
Architect
Design Model
Deployment Model
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Reference
Architecture
Software
Architecture
Document
14
The software architect role leads and coordinates technical activities and artifacts
throughout the project. The software architect establishes the overall structure for
each architectural view: the decomposition of the view, the grouping of elements,
and the interfaces between these major groupings. Therefore, in contrast to the other
roles, the software architect's view is one of breadth as opposed to one of depth.
In summary, the software architect must be well-rounded and possess maturity,
vision, and a depth of experience that allows for grasping issues quickly and making
educated, critical judgment in the absence of complete information. More
specifically, the software architect, or members of the architecture team, must
combine these skills:
Experience in both the problem domain, through a thorough understanding of
the requirements, and the software engineering domain. If there is a team, these
qualities can be spread among the team members, but at least one software
architect must provide the global vision for the project.
Leadership in order to drive the technical effort across the various teams, and to
make critical decisions under pressure and make those decisions stick. To be
effective, the software architect and the project manager must work closely
together, with the software architect leading the technical issues and the project
manager leading the administrative issues. The software architect must have the
authority to make technical decisions.
Communication to earn trust, to persuade, to motivate, and to mentor. The
software architect cannot lead by decree only by the consent of the rest of the
project. In order to be effective, the software architect must earn the respect of
the project team, the project manager, the customer, and the user community, as
well as the management team.
Goal orientation and being proactive with a relentless focus on results. The
software architect is the technical driving force behind the project, not a visionary
or dreamer. The career of a successful software architect is a long series of suboptimal decisions made in uncertainty and under pressure. Only those who can
focus on doing what needs to be done are successful in this environment of the
project.
4 - 14
Designers Responsibilities
Designers Responsibilities
The designer
must know
use-case
modeling
techniques,
system
requirements,
and software
design
techniques.
Use-Case
Realization
Package/
Subsystem
Designer
Class
15
The designer role defines the responsibilities, operations, attributes, and relationships
of one or several classes, and determines how they are adjusted to the
implementation environment. In addition, the designer role may have responsibility
for one or more design packages, or design subsystems, including any classes owned
by the packages or subsystems.
The designer must have a solid working knowledge of:
System requirements
4 - 15
Check Balance
Customer
Withdraw Money
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
16
Use cases are one recommended method for organizing your requirements. Instead
of a bulleted list of requirements, you organize them in a way that tells how someone
may use the system. By doing so, you make a requirement more complete and
consistent. You can also better understand the importance of a requirement from a
users perspective.
It is often difficult to tell how a system does what it is supposed to do from a
traditional object-oriented system model. This stems from the lack of a common
thread through the system when it performs certain tasks. Use cases are that thread,
because they define the behavior performed by a system.
Use cases are not part of "traditional" object orientation, but their importance has
become more and more apparent, further emphasizing the fact that use cases are
part of the UML.
4 - 16
Design Model
Use Case
Use-Case Realization
Sequence Diagrams
Collaboration Diagrams
Use Case
Class Diagrams
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
17
A use-case realization describes how a particular use case is realized within the
Design Model, in terms of collaborating objects. A use-case realization ties together
the use cases from the Use-Case Model with the classes and relationships of the
Design Model. A use-case realization specifies what classes must be built to
implement each use case.
In the UML, use-case realizations are stereotyped collaborations. The symbol for a
collaboration is an ellipsis containing the name of the collaboration.The symbol for a
use-case realization is a dotted line version of the collaboration symbol.
A use-case realization in the Design Model can be traced to a use case in the UseCase Model. A realization relationship is drawn from the use-case realization to the
use case it realizes.
Within the UML, a use-case realization can be represented using a set of diagrams
that model the context of the collaboration (the classes/objects that implement the
use case and their relationships class diagrams), and the interactions of the
collaborations (how these classes/objects interact to perform the use cases
collaboration and sequence diagrams).
The number and types of the diagrams that are used depend on what is needed to
provide a complete picture of the collaboration and the guidelines developed for the
project under development.
4 - 17
Use Case A
Scenarios 1 & 2
Use Case B
Scenario 1
Use Case A
Scenario 3
Use-Case
Realization A
End of
iteration
Use-Case
Realization A
Use-Case
Realization B
Iteration n
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Iteration n + 1
18
This course assumes the developer is using an iterative process. Remember, each
pass through the sequence of process workflows is called an iteration. Thus, from a
development perspective, the software lifecycle is a succession of iterations, through
which the software develops incrementally.
During the Analysis and Design workflow in an iteration a use case will serve as the
primary input artifact. By going through the a series of activities defined in the
Analysis and Design workflow, the development team will create an associated usecase realization that describes how a particular use case will be realized.
4 - 18
19
4 - 19
4 - 20
Module 5
Architectural Analysis
Topics
Architectural Analysis Overview............................................................................ 5-4
Key Concepts ....................................................................................................... 5-5
Define the high-level Organization of Subsystems ............................................... 5-10
Identify Analysis Mechanisms.............................................................................. 5-19
Identify Key Abstractions .................................................................................... 5-28
Create Use-Case Realizations ............................................................................. 5-32
Review............................................................................................................... 5-38
5-1
A focus on software architecture allows you to articulate the structure of the software
system (the packages/components), and the ways in which they integrate (the
fundamental mechanisms and patterns by which they interact).
Architectural Analysis is where we make an initial attempt at defining the
pieces/parts of the system and their relationships, organizing these pieces/parts into
well-defined layers with explicit dependencies, concentrating on the upper layers of
the system. This will be refined, and the lower layers will be defined during
Incorporate Existing Design Elements.
5-2
Architecture
Analysis
Architect
[Inception
Iteration (Optional)]
Perform
Architectural
Synthesis
Define a Candidate
Architecture
Analyze Behavior
(Optional)
Refine the
Architecture
Define
Components
Design the
Database
As you may recall, the above diagram illustrates the workflow that we are using in this
course. It is a tailored version of the Analysis and Design core workflow of the
Rational Unified Process. Architectural Analysis is an activity in the Define a
Candidate Architecture workflow detail.
Architectural Analysis is how the project team (or the architect) decides to define
the projects high-level architecture. It is focused mostly on bounding the analysis
effort in terms of agreed-upon architectural patterns and idioms, so that the analysis
work is not working so much from first principles. Architectural Analysis is very
much a configuring of Use-Case Analysis.
During Architectural Analysis, we concentrate on the upper layers of the system,
making an initial attempt at defining the pieces/parts of the system and their
relationships and organizing these pieces/parts into well-defined layers with explicit
dependencies.
In Use-Case Analysis, we will expand on this architecture by identifying analysis
classes from the requirements. Then, in Incorporate Existing Design Elements, the
initial architecture is refined, and the lower architecture layers are defined, taking
into account the implementation environment and any other implementation
constraints.
Architectural Analysis is usually done once per project, early in the Elaboration
phase. The activity is performed by the software architect or architecture team.
This activity can be skipped if the architectural risk is low.
5-3
Supplementary
Specification
Glossary
Software
Architecture Doc
Reference
Architecture
Vision
Document
Architectural
Analysis
Project-Specific
Guidelines
Design Model
Use-Case Model
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Deployment Model
4
Purpose:
To define a candidate architecture for the system based on experience gained
from similar systems or in similar problem domains.
To define the architectural patterns, key mechanisms, and modeling conventions
for the system.
To define the reuse strategy.
To provide input to the planning process.
Input Artifacts:
Use-Case Model
Supplementary Specifications
Glossary
Design Model
Reference Architecture
Vision Document
Project Specific Guidelines
Software Architecture Document
Resulting Artifacts:
Software Architecture Document
Design Model
Deployment Model
5-4
Key Concepts
Architectural Analysis Steps
Key Concepts
Define the High-Level Organization of
Subsystems
Identify Analysis mechanisms
Identify Key Abstractions
Create Use-Case Realizations
Checkpoints
The above are the topics we will be discussing within the Architectural Analysis
module. Unlike the designer activity modules, you will not be discussing each step of
the activity, as the objective of this module is to understand the important
Architectural Analysis concepts, not to learn HOW to create an architecture.
Before you discuss Architectural Analysis in any detail, it is important to
review/define some key concepts.
5-5
Logical View
Analysts/Designers
Structure
Implementation View
End-user
Functionality
Programmers
Software management
Use-Case View
Process View
Deployment View
System integrators
Performance
Scalability
Throughput
System engineering
System topology
Delivery, installation
communication
The above diagram describes the model Rational uses to describe the software
architecture. This is the recommended way to represent a software architecture.
There may be other precursor architectures that are not in this format. The goal is
to mature those architectural representations into the 4+1 view representation.
In Architectural Analysis, you will concentrate on the Logical View. The other views
will be addressed in later architecture modules:
5-6
The Logical View will be refined in the Identify Design Mechanisms, Identify
Design modules.
5-7
Client Package
Supplier
Package
Dependency Implications
Changes to the Supplier package may affect the
Client package.
The Client package cannot be reused independently
because it depends on the Supplier package.
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Elements in one package can import elements from another package. In the UML,
this is represented as a dependency relationship.
The relationships of the packages reflect the allowable relationships between the
contained classes. A dependency relationship between packages indicates that the
contents of the supplier packages may be referenced by the client. In the above
example, if a dependency relationship exists between the Client package and the
Supplier package, then classes in the Client package may access classes in the
Supplier package.
Some of the implications of package dependency are:
Whenever a change is made to the Supplier package, the Client package must,
potentially, be recompiled and re-tested.
The grouping of classes into logical sets and the modeling of their relationships can
occur anywhere in the process when a set of cohesive classes is identified.
5-8
Hierarchy
should be
acyclic
A
C
B
A'
C
It is desirable that the package hierarchy be acyclic. This means that the following
situation should be avoided (if possible):
5-9
10
5 - 10
Analysis/Design pattern
Provides a solution to a narrowly-scoped technical
problem
Provides a fragment of a solution, or a piece of the
puzzle
Framework
Defines the general approach to solving the
problem
Provides a skeletal solution, whose
details may be Analysis/Design patterns
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
11
5 - 11
Pattern Name
Parameterized
Collaboration
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Structural Aspect
Behavioral Aspect
12
5 - 12
13
5 - 13
Application Subsystems
Business-Specific
Middleware
System Software
General
functionality
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
14
5 - 14
5
Application
Major abstractions,
classes, etc.
3
Application
Framework
Mechanisms,
services
Infrastructure
15
Context
A large system that requires decomposition.
Problem
A system that must handle issues at different levels of abstraction; for example:
hardware control issues, common services issues, and domain-specific issues. It
would be extremely undesirable to write vertical components that handle issues at all
levels. The same issue would have to be handled (possibly inconsistently) multiple
times in different components.
Forces
Parts of the system should be replaceable.
Changes in components should not ripple.
Similar responsibilities should be grouped together.
Size of components complex components may have to be decomposed.
Solution
Structure the systems into groups of components that form layers on top of each
other. Make upper layers use services of the layers below only (never above). Try not
to use services other than those of the layer directly below. (Do not skip layers unless
intermediate layers would only add pass-through components.)
A strict layered architecture states that design elements (classes, components,
packages, and subsystems) only utilize the services of the layer below them. Services
can include event-handling, error-handling, database access, and so forth. It contains
more palpable mechanisms, as opposed to the raw operating system level calls
documented in the bottom layer.
5 - 15
Layering Considerations
Layering Considerations
Level of abstraction
Group elements at the same level of abstraction
Separation of concerns
Group like things together
Separate disparate things
Application vs. domain model elements
Resiliency
Loose coupling
Concentrate on encapsulating change
User interface, business rules, and retained data tend
to have a high potential for change
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
16
5 - 16
<<layer>>
Package Name
17
Layers can be represented in Rose as packages with the <<layer>> stereotype. The
layer descriptions can be included in the documentation field of the specification of
the package.
5 - 17
Application
<<layer>>
Business Services
18
The above example includes the Application and Business-Specific layers for the
Course Registration System.
The Application layer contains the design elements that are specific to the Course
Registration application.
We expect that multiple applications will share some key abstractions and common
services. These have been encapsulated in the Business Services layer, which is
accessible to the Application layer. The Business Services layer contains businessspecific elements that are used in several applications, not necessarily just this one.
5 - 18
19
The architecture should be simple, but not simplistic. It should provide standard
behavior through standard abstractions and mechanisms. Thus, a key aspect in
designing a software architecture is the definition and the selection of the
mechanisms that designers use to give "life" to their objects.
In Architectural Analysis, it is important to identify the analysis mechanisms for the
software system being developed. Analysis mechanisms focus on and address the
nonfunctional requirements of the system (that is, the need for persistence, reliability,
and performance), and builds support for such non-functional requirements directly
into the architecture.
Analysis mechanisms are used during analysis to reduce the complexity of analysis,
and to improve its consistency by providing designers with a shorthand representation
for complex behavior. Mechanisms allow the analysis effort to focus on translating the
functional requirements into software abstractions without becoming bogged down in
the specification of relatively complex behavior that is needed to support the
functionality but which is not central to it.
5 - 19
Implementation
Environment
realized by client
classes using
constrained by
Mechanisms
Supplementary
Specification
COTS Products
Databases
IPC Technology
etc.
responsible for
Use-Case Model
Architect
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
20
5 - 20
21
There are three categories of architectural mechanisms. The only difference between
them is one of refinement.
Analysis mechanisms capture the key aspects of a solution in a way that is
implementation-independent. They either provide specific behaviors to a domainrelated class or component, or correspond to the implementation of cooperation
between classes and/or components. They may be implemented as a framework.
Examples include mechanisms to handle persistence, inter-process communication,
error or fault handling, notification, and messaging, to name a few.
Design mechanisms are more concrete. They assume some details of the
implementation environment, but are not tied to a specific implementation (as is an
implementation mechanism).
Implementation mechanisms specify the exact implementation of the mechanism.
Implementation mechanisms are are bound to a certain technology, implementation
language, vendor, or other factor.
In a design mechanism, some specific technology is chosen (for example, RDBMS vs.
ODBMS), whereas in an implementation mechanism, a VERY specific technology is
chosen (for example, Oracle vs. SYBASE).
The overall strategy for the implementation of analysis mechanisms must be built into
the architecture. This will be discussed in more detail in Identify Design mechanisms,
when design and implementation mechanisms are discussed.
5 - 21
22
5 - 22
Persistency
Communication (IPC and RPC)
Message routing
Distribution
Transaction management
Process control and synchronization (resource
contention)
Information exchange, format conversion
Security
Error detection / handling / reporting
Redundancy
Legacy Interface
23
5 - 23
Granularity
Volume
Duration
Access mechanism
Access frequency (creation/deletion, update, read)
Reliability
Latency
Synchronicity
Message size
Protocol
24
5 - 24
Latency
Duration
Access mechanism
Access frequency
Security mechanism
Data granularity
User granularity
Security rules
Privilege types
Others
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
25
Security:
Data granularity: Package-level, class-level, attribute level
User granularity: Single users, roles/groups
Security Rules: Based on value of data, on algorithm based on data, and on
algorithm based on user and data
Privilege Types: Read, write, create, delete, perform some other operation
5 - 25
Classes
Analysis
Mechanisms
Flight
Aircraft
Mission
Persistency
Communication
Schedule
Parsing
Route
Authentication
Load
26
5 - 26
27
The above are the selected analysis mechanisms for the Course Registration System.
Persistency: A means to make an element persistent (that is, exist after the
application that created it ceases to exist).
Distribution: A means to distribute an element across existing nodes of the system.
Security: A means to control access to an element.
Legacy Interface: A means to access a legacy system with an existing interface.
These are also documented in the Payroll Architecture Handbook, Architectural
Mechanisms section.
5 - 27
28
This is where the key abstractions for the problem domain are defined. Furthermore,
this is where the vocabulary of the software system is established.
The purpose of this step is to "prime the pump" for analysis by identifying and
defining the key abstractions that the system must handle. These may have been
initially identified during business modeling and requirement activities. However,
during those activities, the focus was on the problem domain. During analysis and
design, our focus is more on the solution domain.
5 - 28
29
Requirements and Business Modeling activities usually uncover key concepts that the
system must be able to handle. These concepts manifest themselves as key design
abstractions. Because of the work already done, there is no need to repeat the
identification work again during Use-Case Analysis. To take advantage of existing
knowledge, we identify preliminary entity analysis classes to represent these key
abstractions on the basis of general knowledge of the system. Sources include the
Requirements, the Glossary, and in particular, the Domain Model, or the Business
Object Model, if you have one.
5 - 29
30
While defining the initial analysis classes, you can also define any relationships that
exist between them. The relationships are those that support the basic definitions of
the abstractions. It is not the objective to develop a complete class model at this
point, but just to define some key abstractions and basic relationships to kick off the
analysis effort. This will help to reduce any duplicate effort that may result when
different teams analyze the individual use cases.
Relationships defined at this point reflect the semantic connections between the
defined abstractions, not the relationships necessary to support the implementation
or the required communication among abstractions.
The analysis classes identified at this point will probably change and evolve during the
course of the project. The purpose of this step is not to identify a set of classes that
will survive throughout design, but to identify the key abstractions the system must
handle. Do not spend much time describing analysis classes in detail at this initial
stage, because there is a risk that you might identify classes and relationships that are
not actually needed by the use cases. Remember that you will find more analysis
classes and relationships when looking at the use cases.
5 - 30
Student
Schedule
CourseCatalog
CourseOffering
Course
31
5 - 31
32
5 - 32
Design Model
Use Case
Use-Case Realization
Sequence Diagrams
Collaboration Diagrams
Use Case
Class Diagrams
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
33
A use-case realization is the expression of a particular use case within the Design
Model. It describes the use case in terms of collaborating objects. A use-case
realization ties together the use cases from the Use-Case Model with the classes and
relationships of the Design Model. A use-case realization specifies what classes must
be built to implement each use case.
In the UML, use-case realizations are stereotyped collaborations. The symbol for a
collaboration is an oval containing the name of the collaboration. The symbol for a
use-case realization is a dotted line version of the collaboration symbol.
A use-case realization in the Design Model can be traced to a use case in the UseCase Model. A realization relationship is drawn from the use-case realization to the
use case it realizes.
Within the UML, a use-case realization can be represented using a set of diagrams
that model the context of the collaboration (the classes/objects that implement the
use case and their relationships class diagrams), and the interactions of the
collaborations (how these classes/objects interact to perform the use cases
collaboration and sequence diagrams).
The number and types of the diagrams that are used depend on what is needed to
provide a complete picture of the collaboration and the guidelines developed for the
project under development.
5 - 33
Requirements
Use Case
Use-Case
Realization
34
Use cases form the central focus of most of the early analysis and design work. To
enable the transition between requirements-centric activities and design-centric
activities, the use-case realization serves as a bridge, providing a way to trace
behavior in the Design Model back to the Use-Case Model, as well as organizing
collaborations in the Design Model around the Use-Case concept.
For each Use Case in the Use Case Model, create a use-case realization in the Design
Model. The name for the use-case realization should be the same as the associated
use case, and a trace dependency should be established from the use case realization
to its associated use case.
5 - 34
35
This is where the quality of the architecture modeled up to this point is assessed
against some very specific criteria.
In this module, we will concentrate on those checkpoints that the designer is most
concerned with (that is, looks for). The architect should do a much more detailed
review of the Architectural Analysis results and correct any problems before the
project moves on to the next activity. We will not cover those checkpoints, as they
are out of scope of this course. (Remember, this is not an architecture course.)
5 - 35
Checkpoints
Checkpoints
General
Is the package partitioning and
layering done in a logically
consistent way?
Have the necessary analysis
mechanisms been identified?
Packages
Have we provided a comprehensive
picture of the services of the
packages in upper-level layers?
(continued)
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
36
The next few slides contains the key things a designer would look for when assessing
the results of Architectural Analysis. An architect would have a more detailed list.
A well-structured architecture encompasses a set of classes, typically organized into
multiple hierarchies
Note: At this point, some of the packages/layers may not contain any classes, and that
is okay. More classes will be identified over time, starting in the next activity, UseCase Analysis.
5 - 36
Checkpoints (cont.)
Checkpoints (cont.)
Classes
Have the key entity classes and
their relationships been identified
and accurately modeled?
Does the name of each class clearly
reflect the role it plays?
Are the key abstractions/classes
and their relationships consistent
with the Business Model, Domain
Model, Requirements, Glossary,
etc.?
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
37
5 - 37
Review
Review: Architectural Analysis
What is the purpose of Architectural Analysis?
What is a package?
What are analysis mechanisms? Give examples.
What key abstractions are identified during
Architectural Analysis? Why are they identified
here?
What is a layered architecture? Give examples of
typical layers.
5 - 38
38
39
Note: This exercise has been tightly scoped to emphasize the Analysis and Design
modeling concepts and reduce the emphasis on architectural issues. Thus, much of
the architecture has been provided to you, rather than asking you to provide it as part
of the exercise. Remember, this is not an architecture course.
5 - 39
(continued)
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
40
To identify the key abstractions, you can probably concentrate on the Problem
Statement and the Glossary.
Create a class to represent each key abstraction Be sure to include a brief
description for each class. You do not need to allocate the classes to packages. That
will occur in the next module. You do not need to define relationships between the
classes at this point. We will concentrate on class relationships in later modules.
The class diagrams of the upper-level layers and their dependencies should be drawn
using the given textual descriptions.
References to sample diagrams within the course that are similar to what should be
produced are:
Refer to the following slides if needed;
5 - 40
41
You will need to create two different class diagrams in this solution: one showing the
key abstractions and one showing the architectural layers and their dependencies.
Refer to the following slides if needed;
5 - 41
Exercise: Review
Exercise: Review
Compare your key abstractions
with the rest of the class
Have the key concepts been
identified?
Does the name of each class
reflect the role it plays?
5 - 42
42
Module 6
Use-Case Analysis
Topics
Use-Case Analysis Overview................................................................................. 6-4
Supplement The Use-Case Description ................................................................. 6-6
Find Classes From Use-Case Behavior................................................................... 6-8
Distribute Use-Case Behavior to Classes.............................................................. 6-26
Describe Responsibilities .................................................................................... 6-36
Describe Attributes and Associations................................................................... 6-40
Use-Case Analysis Steps...................................................................................... 6-52
Unify Analysis Classes ......................................................................................... 6-57
Review............................................................................................................... 6-63
6-1
6-2
[Inception
Iteration (Optional)]
Perform
Architectural
Synthesis
Define a Candidate
Architecture
Designer
Analyze Behavior
(Optional)
Refine the
Architecture
Define
Components
Use-Case
Analysis
Design the
Database
As you may recall, the above diagram illustrates the workflow that we are using in this
course. It is a tailored version of the Analysis and Design core workflow of the
Rational Unified Process. Use-Case Analysis is an activity in the Analyze Behavior
workflow detail.
At this point, we have made an initial attempt at defining our architecture we have
defined the upper layers of our architecture, the key abstractions, and some key
analysis mechanisms. This initial architecture, along with the software requirements
defined in the Requirements discipline, guides and serves as input to the Use-Case
Analysis activity.
An instance of Use-Case Analysis is performed for each use case to be developed
during an iteration. The focus during Use-Case Analysis is on a particular use case.
In Use-Case Analysis, we identify the analysis classes and define their
responsibilities. As the analysis classes and their responsibilities are defined, we will
also note the usage of any architectural (more specifically, analysis) patterns defined
in Architectural Analysis. The architectural layers and their dependencies may affect
the allocation of responsibility to the defined analysis classes.
The allocation of responsibility is modeled in Use-Case Realizations that describe how
analysis classes collaborate to perform use cases. The Use-Case Realizations will be
refined in the Use-Case Design Model.
6-3
Glossary
Project Specific
Guidelines
Supplementary
Specifications
Software
Architecture
Document
Use-Case
Analysis
Use-Case Model
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Use-Case Realization
Analysis Model
Analysis Classes
4
Use-Case Analysis is performed by the designer, once per iteration per Use-Case
Realization. What event flows, and therefore what Use-Case Realizations you are
going to work on during the current iteration are defined prior to the start of UseCase Analysis in Architectural Analysis.
Purpose
To identify the classes that perform a use cases flow of events
To distribute the use case behavior to those classes, using Use-Case Realizations
To identify the responsibilities, attributes and associations of the classes
To note the usage of architectural mechanisms
Input Artifacts
Glossary
Supplementary Specifications
Use-Case
Use-Case Model
Use-Case Realization
Software Architecture Document
Analysis Class
Analysis Model
Project Specific Guidelines
Resulting Artifacts
Analysis Classes
Analysis Model
Use-Case Realizations
Note: We will not be developing a separate Analysis Model in this course.
6-4
The above are the major steps of the Use-Case Analysis activity.
First we must review the use-case descriptions developed in the Requirements
discipline. Chances are, they will need some enhancements to include enough detail
to begin developing a model.
Next, we study the use-case flow of events, identify analysis classes, and allocate usecase responsibilities to the analysis classes. Based on these allocations, and the
analysis class collaborations, we can begin to model the relationships between the
identified analysis classes.
Once the use case has been analyzed, we need to take a good look at the identified
classes, making sure they are thoroughly documented and identify which analysis and
mechanisms they implement.
Last, but not least, we need to make sure that our developed Analysis Model is
consistent.
6-5
The purpose of the Supplement the Descriptions of the Use Case is to capture
additional information needed in order to understand the required internal behavior
of the system that may be missing from the Use-Case Description written for the
customer of the system. This information will be used as input to the rest of the steps
in Use-Case Analysis and is used to assist in the allocation of responsibility.
Note: In some cases, we may find that some requirements were incorrect or not wellunderstood. In those cases, the original use-case flow of events should be updated
(for example, iterate back to the Requirements discipline).
6-6
The system
displays a
list of
course
offerings.
The system
retrieves and
displays a list of
current course
offerings from the
course catalog
legacy database.
The description of each use case is not always sufficient for finding analysis classes
and their objects. The customer generally finds information about what happens
inside the system uninteresting, so the use-case descriptions may leave such
information out. In these cases, the use-case description reads like a black-box
description, in which internal details on what the system does in response to an
actors actions is either missing or very summarily described. To find the objects that
perform the use case, you need to have the white box description of what the
system does from an internal perspective.
For example, in the case of the Course Registration System, the student might prefer
to say the system displays a list of course offerings. While this might be sufficient for
the student, it gives us no real idea of what really happens inside the system. In order
to form an internal picture of how the system really works, at a sufficient level of
detail to identify objects, we might need additional information.
Taking the Register for Courses use case as an example, the expanded description
would read as: The system retrieves a list of current course offerings from the course
catalog legacy database. This level of detail gives us a clear idea of what information
is required and who is responsible for providing that information.
6-7
6-8
Review: Class
Review: Class
An abstraction
Describes a group of objects with common:
Properties (attributes)
Behavior (operations)
Relationships
Semantics
Class Name
Attributes
Operations
Professor
name
ProfessorId : UniqueId
create()
save()
delete()
change()
6-9
Design Model
Use Case
Use-Case Realization
Sequence Diagrams
Collaboration Diagrams
Use Case
Class Diagrams
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
10
6 - 10
Source
Code
Exec
Use-Case Analysis
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
11
Finding a candidate set of roles is the first step in the transformation of the system
from a mere statement of required behavior to a description of how the system will
work.
The analysis classes, taken together, represent an early conceptual model of the
system. This conceptual model evolves quickly and remains fluid for some time as
different representations and their implications are explored. Formal documentation
can impede this process, so be careful how much energy you expend on maintaining
this mode in a formal sense; you can waste a lot of time polishing a model that is
largely expendable. Analysis classes rarely survive into the design unchanged. Many
of them represent whole collaborations of objects, often encapsulated by subsystems.
Analysis classes are proto-classes, which are essentially "clumps of behavior." These
analysis classes are early conjectures of the composition of the system; they rarely
survive intact into Implementation. Many of the analysis classes morph into
something else later (subsystems, components, split classes, or combined classes).
They provide you with a way of capturing the required behaviors in a form that we
can use to explore the behavior and composition of the system. Analysis classes
allow us to "play" with the distribution of responsibilities, re-allocating as necessary.
6 - 11
12
The technique for finding analysis classes described in this module uses three
different perspectives of the system to drive the identification of candidate classes.
These three perspectives are:
6 - 12
<<entity>>
<<boundary>>
System
information
System
boundary
<<control>>
Use-case
behavior
coordination
<<boundary>>
System
boundary
<<entity>>
System
information
13
Analysis classes represent an early conceptual model for things in the system that
have responsibilities and behavior. Analysis classes are used to capture a first-draft
rough-cut of the Object Model of the system.
Analysis classes handle primarily functional requirements. They model objects from
the problem domain. Analysis classes can be used to represent "the objects we want
the system to support" without making a decision about how much of them to
support with hardware and how much with software.
Three aspects of the system are likely to change:
The boundary between the system and its actors
The information the system uses
The control logic of the system
In an effort to isolate the parts of the system that will change, the following types of
analysis classes are identified with a canned set of responsibilities:
Boundary
Entity
Control
Stereotypes may be defined for each type. These distinctions are used during
Analysis, but disappear in Design.
The different types of analysis classes can be represented using different icons or with
the name of the stereotype in guillemets (<< >>): <<boundary>>, <<
control>>, <<entity>>.
Each of these types of analysis classes are discussed on the following slides.
6 - 13
Environment Dependent
14
A boundary class intermediates between the interface and something outside the
system. Boundary classes insulate the system from changes in the surroundings (for
example, changes in interfaces to other systems and changes in user requirements),
keeping these changes from affecting the rest of the system.
A system can have several types of boundary classes:
6 - 14
<<control>>
Actor 1
<<boundary>>
<<boundary>>
Actor 2
<<entity>>
<<entity>>
15
A boundary class is used to model interaction between the system's surroundings and
its inner workings. Such interaction involves transforming and translating events and
noting changes in the system presentation (such as the interface).
Boundary classes model the parts of the system that depend on its surroundings. They
make it easier to understand the system because they clarify the system's boundaries
and aid design by providing a good point of departure for identifying related services.
For example, if you identify a printer interface early in the design, you will realize that
you must also model the formatting of printouts.
Because boundary classes are used between actors and the working of the internal
system (actors can only communicate with boundary classes), they insulate external
forces from internal mechanisms and vice versa. Thus, changing the GUI or
communication protocol should mean changing only the boundary classes, not the
entity and control classes.
A boundary object (an instance of a boundary class) can outlive a use-case instance if,
for example, it must appear on a screen between the performance of two use cases.
Normally, however, boundary objects live only as long as the use-case instance.
6 - 15
Student
RegisterForCoursesForm
CourseCatalogSystem
16
The goal of Analysis is to form a good picture of how the system is composed, not to
design every last detail. In other words, identify boundary classes only for phenomena
in the system or for things mentioned in the flow of events of the Use-Case
Realization.
Consider the source for all external events and make sure there is a way for the
system to detect these events.
One recommendation for the initial identification of boundary classes is one
boundary class per actor/use-case pair. This class can be viewed as having
responsibility for coordinating the interaction with the actor. This may be refined as a
more detailed analysis is performed. This is particularly true for window-based GUI
applications where there is typically one boundary class for each window, or one for
each dialog box.
In the above example:
6 - 16
The CourseCatalogSystem interfaces with the legacy system that provides the
unabridged catalog of all courses offered by the university. This class replaces the
CourseCatalog abstraction originally identified in Architectural Analysis.
17
When identifying and describing analysis classes, be careful not to spend too much
time on the details. Analysis classes are meant to be a first cut at the abstractions of
the system. They help to clarify the understanding of the problem to be solved and
represent an attempt at an idealized solution (Analysis has been called idealized
Design).
User Interface Classes: Boundary classes may be used as holding places for GUI
classes. The objective is not to do GUI design in this analysis, but to isolate all
environment-dependent behavior. The expansion, refinement and replacement of
these boundary classes with actual user-interface classes (probably derived from
purchased UI libraries) is a very important activity of Class Design and will be
discussed in the Class Design module. Sketches or screen captures from a userinterface prototype may have been used during the Requirements discipline to
illustrate the behavior and appearance of the boundary classes. These may be
associated with a boundary class. However, only model the key abstractions of the
system; do not model every button, list, and widget in the GUI.
System and Device Interface Classes: If the interface to an existing system or device
is already well-defined, the boundary class responsibilities should be derived directly
from the interface definition. If there is a working communication with the external
system or device, make note of it for later reference during design.
6 - 17
Architectural Analysis
Abstractions
Business-Domain
Model
Glossary
Environment Independent
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
18
Entity objects represent the key concepts of the system being developed. Entity
classes provide another point of view from which to understand the system, because
they show the logical data structure. Knowing the data structure can help you
understand what the system is supposed to offer its users.
Frequent sources of inspiration for entity classes are the:
6 - 18
<<control>>
Actor 1
<<boundary>>
<<boundary>>
Actor 2
<<entity>>
<<entity>>
19
Entity classes represent stores of information in the system. They are typically used to
represent the key concepts that the system manages. Entity objects (instances of entity
classes) are used to hold and update information about some phenomenon, such as
an event, a person, or a real-life object. They are usually persistent, having attributes
and relationships needed for a long period, sometimes for the lifetime of the system.
The main responsibilities of entity classes are to store and manage information in the
system.
An entity object is usually not specific to one Use-Case Realization and sometimes it
is not even specific to the system itself. The values of its attributes and relationships
are often given by an actor. An entity object may also be needed to help perform
internal system tasks. Entity objects can have behavior as complicated as that of other
object stereotypes. However, unlike other objects, this behavior is strongly related to
the phenomenon the entity object represents. Entity objects are independent of the
environment (the actors).
6 - 19
20
Taking the use-case flow of events as input, underline the noun phrases in the flow of
events. These form the initial candidate list of analysis classes.
Next, go through a series of filtering steps where some candidate classes are
eliminated. This is necessary due to the ambiguity of the English language. The result
of the filtering exercise is a refined list of candidate entity classes. While the filtering
approach does add some structure to what could be an ad-hoc means of identifying
classes, people generally filter as they go rather than blindly accepting all nouns and
then filtering.
6 - 20
CourseOffering
Schedule
Student
21
The following are the definitions for each of the classes shown in the above diagram:
CourseOffering: A specific offering for a course, including days of the week and
times.
Schedule: The courses a student has selected for the current semester.
Student: A person enrolled in classes at the university.
As mentioned earlier, sometimes there is a need to model information about an actor
within the system. This is not the same as modeling the actor. (Actors are external by
definition.) These classes are sometimes called surrogates.
For example, a course registration system maintains information about the student
that is independent of the fact that the student also plays a role as an actor in the
system. This information about the student is stored in a Student class that is
completely independent of the actor role the student plays. The Student class will
exist whether or not the student is an actor to the system.
6 - 21
Analysis class
stereotype
Use Case
22
Control classes provide coordinating behavior in the system. The system can perform
some use cases without control classes by using just entity and boundary classes. This
is particularly true for use cases that involve only the simple manipulation of stored
information. More complex use cases generally require one or more control classes
to coordinate the behavior of other objects in the system. Examples of control classes
include transaction managers, resource coordinators, and error handlers.
Control classes effectively decouple boundary and entity objects from one another,
making the system more tolerant of changes in the system boundary. They also
decouple the use-case specific behavior from the entity objects, making them more
reusable across use cases and systems.
Control classes provide behavior that:
Is surroundings-independent (does not change when the surroundings change).
Defines control logic (order between events) and transactions within a use case.
Changes little if the internal structure or behavior of the entity classes changes.
Uses or sets the contents of several entity classes, and therefore needs to
coordinate the behavior of these entity classes.
Is not performed in the same way every time it is activated (flow of events
features several states).
Although complex use cases may need more than one control class it is
recommended, for the initial identification of control classes, that only one control
class be created per use case.
6 - 22
<<control>>
Actor 1
<<boundary>>
<<boundary>>
Actor 2
<<entity>>
<<entity>>
23
A control class is a class used to model control behavior specific to one or more use
cases. Control objects (instances of control classes) often control other objects, so
their behavior is of the coordinating type. Control classes encapsulate use-casespecific behavior.
The behavior of a control object is closely related to the realization of a specific use
case. In many scenarios, you might even say that the control objects "run" the UseCase Realizations. However, some control objects can participate in more than one
Use-Case Realization if the use-case tasks are strongly related. Furthermore, several
control objects of different control classes can participate in one use case. Not all use
cases require a control object. For example, if the flow of events in a use case is
related to one entity object, a boundary object may realize the use case in
cooperation with the entity object. You can start by identifying one control class per
Use-Case Realization, and then refine this as more Use-Case Realizations are
identified, and commonality is discovered.
Control classes can contribute to understanding the system, because they represent
the dynamics of the system, handling the main tasks and control flows.
When the system performs the use case, a control object is created. Control objects
usually die when their corresponding use case has been performed.
6 - 23
Course Catalog
System
RegistrationController
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
24
One recommendation is to identify one control class per use case. However, this can
become more than one use case as analysis continues. Remember that more
complex use cases generally require one or more control cases. Each control class is
responsible for orchestrating/controlling the processing that implements the
functionality described in the associated use case.
In the above example, the RegistrationController <<control>> class has been
defined to orchestrate the Register for Courses processing within the system.
6 - 24
Student
Course Catalog
System
Use-Case Model
Design Model
RegisterForCoursesForm
CourseCatalogSystem
CourseOffering
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Student
Schedule
RegistrationController
25
For each Use-Case Realization, there is one or more class diagrams depicting its
participating classes, along with their relationships. These diagrams help to ensure
that there is consistency in the use-case implementation across subsystem boundaries.
Such class diagrams have been called View of Participating Classes diagrams
(VOPC, for short).
The diagram on this slide shows the classes participating in the Register for Courses
use case. [Note: The Part-time Student and Full-time Student classes from the Rose
solution have been omitted for brevity. (They both inherit from Student.) Class
relationships will be discussed later in this module.]
6 - 25
26
Now that we have identified the candidate analysis classes, we need to allocate the
responsibilities of the use case to the analysis classes and model this allocation by
describing the way the class instances collaborate to perform the use case in UseCase Realization.
The purpose of Distribute Use-Case Behavior to Classes is to:
6 - 26
Sequence Diagrams
Use Case
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Collaboration Diagrams
Use-Case Realization
27
You can identify analysis classes responsible for the required behavior by stepping
through the flow of events of the use case. In the previous step, we outlined some
classes. Now it is time to see exactly where they are applied in the use-case flow of
events.
In addition to the identified analysis classes, the Interaction diagram should show
interactions of the system with its actors. The interactions should begin with an actor,
since an actor always invokes the use case. If you have several actor instances in the
same diagram, try keeping them in the periphery of that diagram.
Interactions between actors should not be modeled. By definition, actors are external,
and are out of scope of the system being developed. Thus, you do not include
interactions between actors in your system model. If you need to model interactions
between entities that are external to the system that you are developing (for example,
the interactions between a customer and an order agent for an order-processing
system), those interactions are best included in a Business Model that drives the
System Model.
Guidelines for how to distribute behavior to classes are described on the next slide.
6 - 27
28
6 - 28
29
6 - 29
Supplier Object
:Client
:Supplier
Object Lifeline
1: PerformResponsibility
Message
Focus of Control
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
Reflexive Message
1.1: PerformAnother
Responsibility
Hierarchical Message
Numbering
30
6 - 30
: RegisterForCoursesForm
: RegistrationController
: CourseCatalogSystem
: Schedule
: Student
: Course Catalog
1: // create schedule( )
2: // get course offerings( )
3: // get course offerings(forSemester)
Create a new
schedule
31
The above example shows the object interactions to support the Create a Schedule
sub-flow of the Register for Courses use case. Some of the rationale for responsibility
allocation is as follows:
Only the CourseCatalogSystem class interacts with the external legacy Course
Catalog System.
Note the inclusion of the actors. This is important as the diagram explicitly
models what elements communicate with the outside world.
6 - 31
Supplier Object
:Client
PerformResponsibility
:Supplier
Message
32
6 - 32
: CourseCatalogSystem
1: // create schedule( )
7: // select 4 primary and 2 alternate offerings( )
: RegistrationController
: Student
33
The above example shows the collaboration of objects to support the Register for
Courses use case, Create a Schedule subflow. It is the Collaboration diagram
equivalent of the Sequence diagram shown earlier.
6 - 33
Alternate Flow 1
Alternate Flow 2
Alternate Flow 3
Alternate Flow 4
Alternate Flow 5
Alternate Flow n
AF3
AF1
AF2
34
Model most of the flow of events to make sure that all requirements on the
operations of the participating classes are identified. Start with describing the basic
flow, which is the most common or most important flow of events. Then describe
variants such as exceptional flows. You do not have to describe all the flow of events,
as long as you employ and exemplify all operations of the participating objects. Very
trivial flows can be omitted, such as those that concern only one object.
Examples of exceptional flows include the following:
Time-out handling. If the user does not reply within a certain period, the use case
should take some special measures.
Handling of erroneous input to the objects that participate in the use case (for
example, incorrect user input).
6 - 34
Sequence Diagrams
Show the explicit
sequence of messages
Better for visualizing
overall flow
Better for real-time
specifications and for
complex scenarios
Show relationships in
addition to interactions
Better for visualizing
patterns of collaboration
Better for visualizing all
of the effects on a given
object
Easier to use for
brainstorming sessions
35
Sequence diagrams and Collaboration diagrams express similar information, but show
it in different ways.
Collaboration diagrams emphasize the structural collaboration of a society of objects
and provide a clearer picture of the patterns of relationships and control that exist
amongst the objects participating in a use case. Collaboration diagrams show more
structural information (that is, the relationships among objects). Collaboration
diagrams are better for understanding all the effects on a given object and for
procedural design.
Sequence diagrams show the explicit sequence of messages and are better for realtime specifications and for complex scenarios. A Sequence diagram includes
chronological sequences, but does not include object relationships. Sequence
numbers are often omitted in Sequence diagrams, in which the physical location of
the arrow shows the relative sequence. On Sequence diagrams, the time dimension is
easier to read, operations and parameters are easier to present, and a larger number
of objects are easier to manage than in Collaboration diagrams.
Both Sequence and Collaboration diagrams allow you to capture semantics of the
use-case flow of events; they help identify objects, classes, interactions, and
responsibilities; and they help validate the architecture.
6 - 35
Describe Responsibilities
Use-Case Analysis Steps
Supplement the Use-Case Descriptions
For each Use-Case Realization
Find Classes from Use-Case Behavior
Distribute Use-Case Behavior to Classes
36
At this point, analysis classes have been identified and use-case responsibilities have
been allocated to those classes. This was done on a use-case-by-use-case basis, with
a focus primarily on the use-case flow of events. Now it is time to turn our attention
to each of the analysis classes and see what each of the use cases will require of
them. A class and its objects often participate in several Use-Case Realizations. It is
important to coordinate all the requirements on a class and its objects that different
Use-Case Realizations may have.
The ultimate objective of these class-focused activities is to to document what the
class knows and what the class does. The resulting Analysis Model gives you a big
picture and a visual idea of the way responsibilities are allocated and what such an
allocation does to the class collaborations. Such a view allows the analyst to spot
inconsistencies in the way certain classes are treated in the system, for example, how
boundary and control classes are used.
The purpose of the Describe Responsibilities step is namely to describe the
responsibilities of the analysis classes.
6 - 36
Describe Responsibilities
Describe Responsibilities
What are responsibilities?
How do I find them?
Interaction Diagram
:Client
:Supplier
// PerformResponsibility
Class Diagram
Supplier
// PerformResponsibility
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
37
6 - 37
<<entity>>
Student
// get tuition()
// add schedule()
// get schedule()
// delete schedule()
// has pre-requisites()
<<entity>>
Schedule
<<boundary>>
CourseCatalogSystem
// commit()
// select alternate()
// remove offering()
// level()
// cancel()
// get cost()
// delete()
// submit()
// save()
// any conflicts?()
// create with offerings()
// update with new selections()
<<boundary>>
RegisterForCoursesForm
// display course offerings()
// display blank schedule()
// update offering selections()
38
The View of Participating Classes (VOPC) class diagram contains the classes whose
instances participate in the Use-Case Realization Interaction diagrams, as well as the
relationships required to support the interactions. We will discuss the relationships
later in this module. Right now, we are most interested in what classes have been
identified, and what responsibilities have been allocated to those classes.
6 - 38
39
6 - 39
40
Now that we have defined the analysis classes and their responsibilities, and have an
understanding of how they need to collaborate, we can continue our documentation
of the analysis classes by describing their attributes and associations.
The purpose of Describe Attributes and Operations is to:
6 - 40
Define the events in other analysis classes that the class must know about.
Define the information that the analysis class is responsible for maintaining.
ClassName
Attribute : Type = InitValue
Attribute : Type = InitValue
Attribute : Type = InitValue
attribute
41
Attributes are used to store information. They are atomic things with no
responsibilities.
The attribute name should be a noun that clearly states what information the attribute
holds. The description of the attribute should describe what information is to be
stored in the attribute; this can be optional when the information stored is obvious
from the attribute name.
During Analysis, the attribute types should be from the domain, and not adapted to
the programming language in use. For example, in the above diagram, enum will
need to be replaced with a true enumeration that describes the days the
CourseOffering is offered (for example, MWF or TR).
6 - 41
Finding Attributes
Finding Attributes
Properties/characteristics of identified
classes
Information retained by identified classes
Nouns that did not become classes
Information whose value is the important thing
Information that is uniquely "owned by an
object
Information that has no behavior
42
6 - 42
<<entity>>
Schedule
<<entity>>
Course
43
6 - 43
Finding Relationships
Finding Relationships
PerformResponsibility
Collaboration
Diagram
:Client
:Supplier
Link
Client
Class
Diagram
Client
Supplier
0..*
0..*
Prime suppliers
Supplier
PerformResponsibility()
Association
44
To find relationships, start studying the links in the Collaboration diagrams. Links
between classes indicate that objects of the two classes need to communicate with
one another to perform the use case. Thus, an association or an aggregation is
needed between the associated classes.
Reflexive links do not need to be instances of reflexive relationships; an object can
send messages to itself. A reflexive relationship is needed when two different objects
of the same class need to communicate.
The navigability of the relationship should support the required message direction. In
the above example, if navigability was not defined from the Client to the Supplier,
then the PerformResponsibility message could not be sent from the Client to the
Supplier.
Focus only on associations needed to realize the use cases; do not add associations
you think "might" exist unless they are required based on the Interaction diagrams.
Remember to give the associations role names and multiplicities. You can also
specify navigability, although this will be refined in Class Design.
Write a brief description of the association to indicate how the association is used, or
what relationships the association represents.
6 - 44
Part
<<entity>>
Student
<<entity>>
Schedule 0..*
<<entity>>
0..2 CourseOffering
0..*
45
In the example on the slide, the relationship from Student to Schedule is modeled as
an aggregation, because a Schedule is inherently tied to a particular Student. A
Schedule outside of the context of a Student makes no sense in this Course
Registration System. The relationship from Schedule to CourseOffering is an
association because CourseOfferings may appear on multiple Schedules.
6 - 45
Association or Aggregation?
Association or Aggregation?
If two objects are tightly bound by a whole-part
relationship
The relationship is an aggregation.
Car
Door
0..2,4
Door
0..2,4
46
Aggregation should be used only where the "parts" are incomplete outside the context
of the whole. If the classes can have independent identity outside the context
provided by other classes, or if they are not parts of some greater whole, then the
association relationship should be used.
When in doubt, an association is more appropriate. Aggregations are generally
obvious. A good aggregate should be a natural, coherent part of the model. The
meaning of aggregates should be simple to understand from the context. Choosing
aggregation is only done to help clarify; it is not something that is crucial to the
success of the modeling effort.
The use of aggregation versus association is dependent on the application you are
developing. For example, if you are modeling a car dealership, the relationship
between a car and the doors might be modeled as aggregation, because the car
always comes with doors, and doors are never sold separately. However, if you are
modeling a car parts store, you might model the relationship as an association, as the
car (the body) might be independent of the doors.
6 - 46
<<entity>>
Professor
instructor
<<entity>>
Department
Department Head
Role Name
<<entity>>
Course
preRequisites
47
Each end of an association has a role in relationship to the class on the other end of
the association. The role specifies the face that a class presents on each side of the
association. A role must have a name, and the role names on opposite sides of the
association must be unique. The role name should be a noun indicating the
associated object's role in relation to the associating object.
The use of association names and role names is mutually exclusive: one would not
use both an association name and a role name. For each association, decide which
conveys more information.
The role name is placed next to the end of the association line of the class it
describes.
In the case of self-associations, role names are essential to distinguish the purpose for
the association.
In the above example, the Professor participates in two separate association
relationships, playing a different role in each.
6 - 47
Review: Multiplicity
Review: Multiplicity
Unspecified
Exactly One
Zero or More
0..*
Zero or More
One or More
1..*
0..1
Specified Range
2..4
2, 4..6
48
For each role you can specify the multiplicity of its class. Multiplicity is the number of
objects of the class that can be associated with one object of the other class.
Multiplicity is indicated by a text expression on the association line. The expression is
a comma-separated list of integer ranges. A range is indicated by an integer (the lower
value), two dots, and an integer (the upper value). A single integer is a valid range.
You may also specify narrower limits such as 2..4.
During Analysis, assume a multiplicity of 0..* (zero to many) unless there is some
clear evidence of something else.
A multiplicity of zero implies that the association is optional. When you use this
notation, make sure this is what you mean. If an object might not be there,
operations that use the association will have to adjust accordingly.
Within multiplicity ranges, probabilities may be specified. Thus, if the multiplicity is
0..*, and is expected to be between 10 and 20 in 85% of the cases, make note of it.
This information will be of great importance during Design. For example, if persistent
storage is to be implemented using a relational database, narrower limits will help
better organize the database tables.
6 - 48
0..*
<<entity>>
Course
0..*
preRequisites
0..3
49
Multiplicity lets you know the lower and the upper bound number of
relationships that a given object can have with another object. Many times you
do not know what the maximum number of instances may be, and you will use
the * to specify that this number is unknown.
This example indicates that a course object can be related to zero or more course
offerings. You can tell that the relationship is optional because the lower bound
number is zero. The upper bound number of the relationship is unknown, as
indicated by the *. If you read the association the other way, you will see that a
given course offering object can be related to only one course. This relationship is
mandatory and indicates that it is not possible for a course offering object to exist
without an associated course object.
6 - 49
<<entity>>
CourseOffering
alternateCourses
<<entity>>
Schedule
add student to
remove student from
<<entity>>
CourseOffering
50
There can be multiple associations between the same two classes, but they should
represent distinct relationships, and DIFFERENT ROLES; they should not be just for
invoking different operations.
If there is more than one association between two classes then they MUST be named.
It is unusual to find more than one association between the same two classes.
Occurrences of multiple associations should be carefully examined.
To determine if multiple associations are appropriate, look at instances of the classes.
ClassA and ClassB have two associations between them, Assoc1 and Assoc2. If an
instance of ClassA has a link with two SEPARATE instances of ClassB, then multiple
associations are valid.
In the above example, the top diagram is an appropriate use of multiple associations,
but the bottom diagram is not. In the valid case, two associations are required
between Schedule and CourseOffering, as a Schedule can contain two kind of
CourseOfferings, primary and alternate. These must be distinguishable, so two
separate associations are used. In the invalid case, the two relationships represent
two operations of CourseOffering, not two roles of CourseOffering.
Remember, Students and CourseOfferings are related via the Schedule class. Students
are enrolled in a CourseOffering if there is a relationship between the Students
Schedule and the CourseOffering.
6 - 50
<<boundary>>
RegisterForCoursesForm
1
1
0..1
currentSchedule
0..1
<<entity>>
<<entity>>
Student
1
0..*
Schedule
0..*
primaryCourses
0..4
<<entity>>
CourseOffering
51
The diagram on this slide shows classes that collaborate to perform the Register for
Courses use case, along with their relationships. As noted earlier, this type of
diagram is called a View of Participating Classes (VOPC) diagram.
The relationships in this diagram are defined using the Interaction diagrams for the
Register for Courses use case provided earlier in this module.
Rationale for relationships:
6 - 51
52
At this point, we have a pretty good understanding of the analysis classes, their
responsibilities, and the collaborations required to support the functionality described
in the use cases.
Now we must look into how each of the defined analysis classes implements the
analysis mechanisms identified in Architectural Analysis.
The purpose of the Qualify Analysis Mechanisms step is to:
Provide additional information about how the class applies the analysis
mechanism.
For each such mechanism, qualify as many characteristics as possible, giving ranges
where appropriate, or when there is still much uncertainty.
Different architectural mechanisms will have different characteristics, so this
information is purely descriptive and need only be as structured as necessary to
capture and convey the information. During Analysis, this information is generally
quite speculative, but the capturing activity has value, since conjectural estimates can
be revised as more information is uncovered. The analysis mechanism characteristics
should be documented with the class.
6 - 52
53
6 - 53
54
6 - 54
Analysis Mechanism(s)
Student
Persistency, Security
Schedule
Persistency, Security
CourseOffering
Course
RegistrationController
Distribution
55
6 - 55
56
The above is just an example of how the characteristics for an analysis mechanism
would be documented for a class. For scoping reasons, the analysis mechanisms and
their characteristics are not provided for all of the analysis classes.
6 - 56
57
At this point, we have a pretty good understanding of the analysis classes, their
responsibilities, the analysis mechanisms they need to implement, and the
collaborations required to support the functionality described in the use cases.
Now we must review our work and make sure that it is as complete and as consistent
as possible before moving on to the architecture activities.
The purpose of Unify Analysis Classes is to ensure that each analysis class represents a
single well-defined concept, with non-overlapping responsibilities.
6 - 57
RegisterFor
CoursesForm
RegisterFor
CoursesForm
Registration
Controller
Registration
Controller
Register for
Courses
Course
Offering
Schedule
Course
Catalog
System
CloseRegistration
Form
Close
Registration
Student
Student
Course
Offering
Billing
System
Course
Offering
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
CloseRegistration Student
Controller
Schedule
Course
Catalog
System
Schedule
CloseRegistration
Controller
CloseRegistration
Form
Billing
System
58
Before the Design work can be done, the analysis classes need to be filtered to ensure
that a minimum number of new concepts have been created.
Different use cases will contribute to the same classes. In the example above, the
classes CourseCatalogSystem, CourseOffering, Schedule and Student participate in
both the Register for Courses and Close Registration use cases.
A class can participate in any number of use cases. It is therefore important to
examine each class for consistency across the whole system.
Merge classes that define similar behaviors or that represent the same phenomenon.
Merge entity classes that define the same attributes, even if their defined behavior is
different; aggregate the behaviors of the merged classes.
When you update a class, you should update any supplemental use-case
descriptions (described earlier in this module), where necessary. Sometimes an
update to the original Requirements (that is, use cases) may be necessary, but this
should be controlled, as the Requirements are the contract with the user/customer,
and any changes must be verified and controlled.
6 - 58
Glossary
Design Model
Supplementary
Specification
Analysis Classes
Use-Case Model
59
We now have a pretty good feeling about our Analysis Model. Now it is time to
review our work for completeness and consistency.
Be sure to:
Verify that the analysis classes meet the functional requirements made on the
system.
Verify that the analysis classes and their relationships are consistent with the
collaborations they support.
It is very important that you evaluate your results at the conclusion of the Use-Case
Analysis.
The number of reviews, the formality of the reviews, and when they are performed
will vary, depending on the process defined for the project.
6 - 59
60
This is where the quality of the model up to this point is assessed against some very
specific criteria.
In this module, we will concentrate on those checkpoints that the designer is most
concerned with (that is, looks for).
6 - 60
61
6 - 61
62
6 - 62
Review
Review: Use-Case Analysis
What is the purpose of Use-Case Analysis?
What is an analysis class? Name and
describe the three analysis stereotypes.
What is a Use-Case Realization?
Describe some considerations
when allocating responsibilities
to analysis classes.
How many Interaction diagrams
should be produced during
Use-Case Analysis?
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
63
6 - 63
(continued)
Mastering Object Oriented Analysis and Design with UML
Copyright 2003 Rational Software, all rights reserved
64
The goal of this exercise is to identify classes that must collaborate to perform a use
case, allocate the use-case responsibilities to those classes, and diagram the
collaborations.
Good sources for the analysis classes are the Glossary and any analysis classes defined
during Architectural Analysis.
References to the givens:
6 - 64
65
When identifying analysis classes from the use-case flows of events, use the analysis
stereotypes for guidance (boundary, control, and entity).
Be sure to define the identified classes. These definitions become very important as
you start to allocate responsibilities to those classes.
The relationships to be identified are those needed to support the collaborations
modeled in the use-case Interaction diagrams. The attributes to be identified are the
obvious properties of the identified classes. More attributes may be defined during
later Class Design.
For each identified analysis class, determine if any of the analysis mechanisms apply.
To make this decision, the Supplementary Specification may be needed.
Refer to the following slides if needed:
6 - 65
66
Start with diagramming the basic flow and then do the other sub-flows if you have
time.
The Interaction diagrams may be collaboration or Sequence diagrams. On an
Interaction diagram, sending a message to an object means that you are allocating
responsibility for performing that task to the object.
Be sure to use the // naming convention for responsibilities.
Refer to the following slides if needed:
6 - 66
Exercise: Review
Exercise: Review
Compare your Use-Case
Realization with the rest of the class
Do the Interaction diagrams carry out
the use-case flow of events?
Are the stereotypes behaving properly?
Is each association supported by a
link?
Does each association have multiplicity
assigned?
Have role names been assigned? Do
they accurately represent the face the
class plays in the relationship?
Payroll System
67
After completing a model, it is important to step back and review your work. Some
helpful questions are the following:
Has the use case behavior been successfully represented in the model? In other
words, is the flow of events the same in the specifications as it is in the model?
Has there been any significant behavior that was added? Removed? Changed?
The model should reflect the intent of the Use-Case Specifications.
Is each stereotype behaving properly? Are actors only interfacing with boundary
classes? Are control classes controlling the use-case flow of events only? Are any
classes doing operations on data (attributes) that are not owned by that class?
6 - 67
6 - 68