Chapter 11

11
Chapter 11:
The Object-Oriented Approach to
Design: Use Case Realization
Systems Analysis and Design in a Changing
World, 3rd Edition
11
Learning Objectives
 Explain
the purpose and objectives of objectoriented design
 Develop
design class diagrams
 Develop
interaction diagrams based on the
principles of object responsibility and use case
controllers
Systems Analysis and Design in a Changing World, 3rd Edition
2
11
Learning Objectives (continued)
 Develop
detailed sequence diagrams as the core
process in systems design
 Develop
collaboration diagrams as part of
systems design
 Document
the architectural design using package
diagrams
Systems Analysis and Design in a Changing World, 3rd Edition
3
11
Overview
 Primary
focus of this chapter and the next is how
to develop detailed object-oriented design models
 Programmers
use models to code the system
 Two
most important models are design class
diagrams and interaction diagrams (sequence
diagrams and collaboration diagrams)
 Class
diagrams are developed for domain, view,
and data access layers
 Interaction
diagrams extend system sequence
diagrams
Systems Analysis and Design in a Changing World, 3rd Edition
4
Object-Oriented Design – The Bridge
Between Analysis and Programming
11
 Bridge
between user’s requirements and new
system’s programming
 Object-oriented
design is process by which
detailed object-oriented models are built
 Programmers
use design to write code and test
new system
 User-interface,
network, controls, security, and
database requires design tasks and models
Systems Analysis and Design in a Changing World, 3rd Edition
5
11
Overview of Object-Oriented Programs
 Set
of objects that cooperate to accomplish result
 Object
contains program logic and necessary
attributes in a single unit
 Objects
send each other messages and
collaborate to support functions of main program
 OO
system designer provides detail for
programmers

Design class diagrams, interaction diagrams,
(some) statechart diagrams
Systems Analysis and Design in a Changing World, 3rd Edition
6
Object-Oriented Event-Driven
Program Flow
Systems Analysis and Design in a Changing World, 3rd Edition
11
7
11
Simplified Design Class for Student Class
Systems Analysis and Design in a Changing World, 3rd Edition
8
Object-Oriented Design
Processes and Models
 Diagrams

11
developed during analysis
Use case diagrams, use case descriptions and
activity diagrams, domain model class diagrams,
and system sequence diagrams
 Diagrams
developed during design

Design class diagrams – set of object-oriented
classes needed for programming, navigation
between classes, attribute names and properties
and method names and properties

Interaction diagrams, package diagrams
Systems Analysis and Design in a Changing World, 3rd Edition
9
Design Models with Their
Respective Input Models
Systems Analysis and Design in a Changing World, 3rd Edition
11
10
11
Iterative Process of OO Design
 Create
preliminary design class diagrams model
 Develop
interaction diagrams for each use case
or scenario (realization of use cases)
 Return
to design class diagram

Develop method names based design of
interaction diagrams

Update navigation visibility and attributes
 Partition
design class diagram into related
functions using package diagrams (subsystems
or layers)
Systems Analysis and Design in a Changing World, 3rd Edition
11
Design Classes and
Design Class Diagrams
11
 Design
class diagrams and detailed interaction
diagrams

Use each other as inputs and developed in parallel
 Design
class diagram first-cut is from domain
model and engineering design principles
 Preliminary
design class diagram used to develop
interaction diagrams
 Design
decisions are made during development
of interaction diagrams

Design class diagram is refined
Systems Analysis and Design in a Changing World, 3rd Edition
12
Design Classes and
Design Class Diagrams (continued)
11
 Design
class diagram extends domain model
class diagram developed during OO analysis
 Shows
set of problem domain classes and their
association relationships
 Describes
design components within the classes
 When
developers build design class diagrams,
more classes are added
Systems Analysis and Design in a Changing World, 3rd Edition
13
11
Design Class Symbols
 UML
does not distinguish between design class
notation and domain model notation
 Domain
 Design
modeling shows users’ work environment
class design specifically defines software
classes
 UML
uses stereotype notation to categorize a
model element by its characteristics
Systems Analysis and Design in a Changing World, 3rd Edition
14
Standard Stereotypes Found
in Design Models
Systems Analysis and Design in a Changing World, 3rd Edition
11
15
11
Standard Design Classes
 Entity
– design identifier for problem domain
class

Persistent class – exists after system is shut down
– designed to live on system’s
automation boundary
 Boundary

User interface and windows classes
– mediates between boundary and entity
classes, between the view layer and domain layer
 Control
access – retrieve from and send data to
database
 Data
Systems Analysis and Design in a Changing World, 3rd Edition
16
11
Design Class Notation
 Name
– class name and stereotype information
– visibility (private or public), attribute
name, type-expression, initial-value, property
 Attributes
signature – information needed to invoke
(or call) the method
 Method

Method visibility, method name, type-expression
(return parameter), method parameter list
(incoming arguments)

Overloaded method – method with same name but
two or more different parameter lists
Systems Analysis and Design in a Changing World, 3rd Edition
17
Internal Symbols Used to
Define a Design Class
Systems Analysis and Design in a Changing World, 3rd Edition
11
18
Student Class Examples for the Domain
Diagram and the Design Class Diagram
Systems Analysis and Design in a Changing World, 3rd Edition
11
19
11
Some Fundamental Design Principles
– each object is self-contained unit
that includes data and methods that access data
 Encapsulation
reuse – designers often reuse same
classes for windows components
 Object
hiding – data associated with object
is not visible to outside world
 Information
visibility – object is able to view and
interact with another object
 Navigation
Systems Analysis and Design in a Changing World, 3rd Edition
20
Navigation Visibility Between
Customer and Order
Systems Analysis and Design in a Changing World, 3rd Edition
11
21
11
Coupling and Cohesion
– qualitative measure of how closely
classes in a design class diagram are linked
 Coupling

Number of navigation arrows on design class
diagram

Low: system is easier to understand and maintain
– qualitative measure of consistency of
functions within a single class
 Cohesion

Separation of responsibility – divide low cohesive
class into several highly cohesive classes
Systems Analysis and Design in a Changing World, 3rd Edition
22
Developing the First-Cut
Design Class Diagram
 Extend
11
domain model class diagram:

Elaborate attributes with type and initial value
information

Add navigation visibility arrows
 Detailed
design proceeds, use case by use case:

Interaction diagrams implement navigation

Navigation arrows are updated to be consistent

Method signatures are added to each class
Systems Analysis and Design in a Changing World, 3rd Edition
23
11
RMO Domain Model Class Diagram
Systems Analysis and Design in a Changing World, 3rd Edition
24
11
First-cut RMO Design Class Diagram
Systems Analysis and Design in a Changing World, 3rd Edition
25
Interaction Diagrams – Realizing Use
Case and Defining Methods
11
 Realization
of use case done through interaction
diagram development
 Determine
what objects collaborate by sending
messages to each other to carry out use case
 Sequence
diagrams and collaboration diagrams
represent results of design decision

Use well-established design principles such as
coupling, cohesion, separation of responsibilities
Systems Analysis and Design in a Changing World, 3rd Edition
26
Partial Design Class Diagram for the Look
Up Item Availability Use Case
Systems Analysis and Design in a Changing World, 3rd Edition
11
27
11
Object Responsibility
 Objects
responsible for system processing
 Knowing
about object’s own data and other
classes with which it collaborates to carry out use
cases
 Doing
activities to assist in execution of use case

Receive and process messages

Instantiate, or create, new objects required to
complete use case
 CRC
cards – class-responsibility-collaboration
Systems Analysis and Design in a Changing World, 3rd Edition
28
11
Use Case Controller
 System
sequence diagram (SSD) shows input
messages from external actors within use case
 Only
indicates that messages go to system
 Use
case controller classes are designed as
collection point for incoming messages
– class invented to handle needed system
function
 Artifact
 Use
case controller acts as intermediary between
outside world and internal system
Systems Analysis and Design in a Changing World, 3rd Edition
29
11
Designing with Sequence Diagrams
 Sequence
diagrams used to explain object
interactions and document design decisions
 Documents
inputs to and outputs from system for
single use case or scenario
 Captures
interactions between system and
external world as represented by actors
 Inputs
are messages from actor to system
 Outputs
are return messages showing data
Systems Analysis and Design in a Changing World, 3rd Edition
30
SSD for the Look Up Item Availability
Use Case
Systems Analysis and Design in a Changing World, 3rd Edition
11
31
11
First-Cut Sequence Diagram
 Start
with elements from SSD
 Replace
 Add
:System object with use case controller
other objects to be included in use case

Select input message from the use case

Add all objects that must collaborate
 Determine

other messages to be sent
Which object is source and destination of each
message?
Systems Analysis and Design in a Changing World, 3rd Edition
32
Objects included in Look Up Item
Availability
Systems Analysis and Design in a Changing World, 3rd Edition
11
33
First-Cut Sequence Diagram for the Look
Up Item Availability Use Case
Systems Analysis and Design in a Changing World, 3rd Edition
11
34
Guidelines for Preliminary Sequence
Diagram Development
11
 Take
each input message and determine internal
messages that result from that input

For that message, determine its objective

Needed information, class destination, class
source, and objects created as a result
 Identify
complete set of classes affected by each
input message

Select objects from domain class diagram
 Flesh
out components for each message
Systems Analysis and Design in a Changing World, 3rd Edition
35
Developing a Multilayer Design for
Look up item availability
 First-cut
11
sequence diagram – classes in domain
layer
 Add

design for user-interface classes – view layer
Forms added as windows classes to sequence
diagram
design for data access classes – data
access layer with separate classes for database
 Add
 Tools

build GUI and problem domain classes
Java and Visual Studio.NET
Systems Analysis and Design in a Changing World, 3rd Edition
36
Look Up Item Availability Use Case with
View Layer and User-Interface Object
Systems Analysis and Design in a Changing World, 3rd Edition
11
37
Partial Three-Layer Design for
Look Up Item Availability
Systems Analysis and Design in a Changing World, 3rd Edition
11
38
Developing a First-Cut Sequence Diagram
for RMO Telephone Order
 Design
11
for each input message in the SSD
 Design
components for all messages are
combined to provide comprehensive sequence
diagram for entire use case
 Information
from SSD and first-cut design class
diagram used to develop sequence diagram
 Which
object is source and which object is
destination?
visibility – destination object must be
visible to source object
 Navigation
Systems Analysis and Design in a Changing World, 3rd Edition
39
Completed Three-Layer Design for
Look Up Item Availability
Systems Analysis and Design in a Changing World, 3rd Edition
11
40
SSD for the Telephone Order Scenario of
the Create New Order Use Case
Systems Analysis and Design in a Changing World, 3rd Edition
11
41
Partial Sequence Diagram for the
Telephone Order Scenario
Systems Analysis and Design in a Changing World, 3rd Edition
11
42
Another Partial Sequence Diagram
for the Telephone Order Scenario
Systems Analysis and Design in a Changing World, 3rd Edition
11
43
Sequence Diagram for Telephone Order
Scenario of Create New Order Use Case
Systems Analysis and Design in a Changing World, 3rd Edition
11
44
Developing a Multilayer Design for
the Telephone Order Scenario
11
 To
reduce complexity of diagrams, extend use
case scenario one message at a time

Add user interface view layer to scenario

Add single data access class

Add each message to extend design
 Sequence
diagrams can become complicated
 Completed
design provides foundation for
programming the use case
Systems Analysis and Design in a Changing World, 3rd Edition
45
Telephone Order Sequence Diagram for
the startOrder Message
Systems Analysis and Design in a Changing World, 3rd Edition
11
46
Telephone Order Sequence Diagram for
the addItem Message
Systems Analysis and Design in a Changing World, 3rd Edition
11
47
Telephone Order Sequence Diagram for
the final messages
Systems Analysis and Design in a Changing World, 3rd Edition
11
48
11
Designing with Collaboration Diagrams
 Collaboration
diagrams and sequence diagrams

Both are interaction diagrams

Both capture same information

Process of designing is same for both
 Model
used is designer’s personal preference

Sequence diagram – because use case
descriptions and dialog follow sequence of steps

Collaboration diagram – emphasizes coupling
Systems Analysis and Design in a Changing World, 3rd Edition
49
11
The Symbols of a Collaboration Diagram
Systems Analysis and Design in a Changing World, 3rd Edition
50
A Collaboration Diagram for
Look Up Item Availability
Systems Analysis and Design in a Changing World, 3rd Edition
11
51
A Collaboration Diagram for
Create New Order
Systems Analysis and Design in a Changing World, 3rd Edition
11
52
Look Up Item Availability Use Case
Using Iconic Symbols
Systems Analysis and Design in a Changing World, 3rd Edition
11
53
11
Updating the Design Class Diagram
 Design
class diagrams developed for each layer

New classes for view layer and data access layer

New classes for domain layer use case controllers
 Sequence
diagram’s messages used to add
methods

Constructor methods,

Data get and set method

Use case specific methods
Systems Analysis and Design in a Changing World, 3rd Edition
54
Design Class, with Method Signatures,
for the Order class
Systems Analysis and Design in a Changing World, 3rd Edition
11
55
Updated Design Class Diagram
for the Domain Layer
Systems Analysis and Design in a Changing World, 3rd Edition
11
56
Package Diagrams – Structuring
the Major Components
11
 High-level
diagram in UML to associate classes
of related groups
 Identifies
major components of a system and
dependencies
 Determines

final program partitions for each layer
View, domain, data access
 Can
divide system into subsystem and show
nesting within packages
Systems Analysis and Design in a Changing World, 3rd Edition
57
Partial Design of a Three-Layer Package
Diagram for RMO
Systems Analysis and Design in a Changing World, 3rd Edition
11
58
11
RMO Subsystem Packages
Systems Analysis and Design in a Changing World, 3rd Edition
59
Implementation Issues for Three-Layer
Design
 Construct
11
system with programming

Java or VB.NET

IDE tools (JBuilder, Visual Studio) provides help
 Integration
with user-interface design, database
design, and network design
 Use
object responsibility to define program
responsibilities for each layer

(View, domain, data access)
Systems Analysis and Design in a Changing World, 3rd Edition
60
11
Summary
 Object-oriented
design is the bridge between
user requirements (in analysis models) and final
system (constructed in programming language)
 Systems
design is driven by use cases, design
class diagrams, and sequence diagrams

Domain class diagrams are transformed into
design class diagrams

Sequence diagrams are extensions of system
sequence diagrams
Systems Analysis and Design in a Changing World, 3rd Edition
61
11
Summary (continued)
 Object-oriented
design principles must be applied

Encapsulation – data fields are placed in classes
along with methods to process that data

Coupling – connectivity between classes

Cohesion – nature of an individual class

Navigation – access classes have to other classes

Object responsibilities – which messages are sent
and received
 Three-layer
design is used because maintainable
Systems Analysis and Design in a Changing World, 3rd Edition
62