0% found this document useful (0 votes)
172 views43 pages

Object-Oriented Design and Modeling Using The Uml: C H A P T E R

UML diagrams

Uploaded by

Gaurav Rathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views43 pages

Object-Oriented Design and Modeling Using The Uml: C H A P T E R

UML diagrams

Uploaded by

Gaurav Rathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

C H A P T E R

18
Irwin/McGraw-Hill

OBJECTORIENTED DESIGN
AND MODELING
USING THE UML

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Chapter 18

Whitten Bentley Dittman

Object-Oriented Design & Modeling Using the UML

Differentiate between entity, interface, and control objects.


Understand the concept of a dependency relationship and the circumstances
under which it is used.
Describe association navigability and explain why it is used.
Define visibility and explain its three levels.
Explain the difference between a behavior and a method.
Understand the basic concept object responsibility and how it is related to
message sending between object types.
Explain the importance of considering object reuse during systems design.
Differentiate between design patterns, object frameworks, and components.
Describe three activities involved in completing object design.
Differentiate between a design use-case narrative an an analysis use-case
narrative.
Construct an object robustness diagram.
Describe CRC card modeling.
Construct statechart and sequence diagrams.
Construct a class diagram that reflects design specifics.
Construct component and deployment diagrams.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Chapter Map

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Object-Oriented Design

Object-oriented design (OOD) an approach used to


specify the software solution in terms of collaborating
objects, their attributes, and their methods.
Continuation of object-oriented analysis

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Object Types

Entity object an object that contains business-related


information that is typically persistent and stored in a
database.

ENTITY
OBJECT
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Object Types

Interface object an object that provides the means by


which an actor can interface with the system.
Examples include a window, dialogue box, or screen.
For nonhuman actors, an application program interface
(API) is the interface object.

INTERFACE
OBJECT
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Object Types

Control object an object that contains application


logic that isnt the responsibility of an entity object.
Examples of such logic are business rules and
calculations that involve multiple objects
Control objects coordinate messages between
interface objects and entity objects and the sequences
in which the messages occur.

CONTROL
OBJECT
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Relationships - Dependency


A dependency relationship is used to model the association
between two classes:
To indicate that when a change occurs in one class, it may affect
the other class.
To indicate the association between a persistent class and a
transient class.
Interface classes typically are transient

Illustrated with a dashed arrow


The Order Display
Window is an interface
class. It is dependent on
the Order Processor
class to respond to
events initiated from
the interface.
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Relationships - Navigability

Classes with associations can navigate (send


messages) to each other.
By default the associations are bidirectional.
Sometimes you want to limit the message sending to
only one direction.
Illustrated with an arrow pointing in the direction a
message can be sent.
Given a User, you can
find that users current
password for
authentication. But
given a password, you
cannot find the
corresponding user.
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Attribute and Method Visibility

Visibility the level of access an external object has


to an attribute or method.
Public attributes/methods can be accessed/invoked by
any other method in any other object or class.
Denoted by the symbol +

Protected attributes/methods can be


accessed/invoked by any method in the same class or
in subclasses of that class.
Denoted by the symbol #

Private attributes/methods can be accessed/invoked


by any method in the same class.
Denoted by the symbol

Method the software logic that


is executed in response to a message.
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Object Responsibilities

Object responsibility the obligation that an object has


to provide a service when requested and thus collaborate
with other objects to satisfy the request if required.
An object responsibility is implemented by the creation
of methods that may have to collaborate with other
objects and methods.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Object Responsibility
1: Message to
request to display a
customers order
information

2: Message to
request customer
information
Customer

Order

submits
1

Customer Order

8: Display customer
order

0..*
1

3: Return customer
information
4: Message to
request all products
that an order
contains

7: Return all product


information

1..*

6: Return detailed
product information

Member Ordered Product

Product

is for
0..*

5: Message to
request detailed
product information

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Object Reusability

The number one driving force for developing systems


using object-oriented technology is the potential to
reuse objects.
Allows development of quality applications cheaper
and faster.
Objects should be defined within a good
generalization/specialization hierarchy.
Comparison of an OO Language and a 3GL Language
Programming
Language

Project Duration
(calendar months)

Level of Effort
(person months)

Software Size
(lines of code)

PL/1

19

152

265,000

Smalltalk

3.5

10.4

22,000

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Student Generalization/Specialization Hierarchy

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Patterns

Design pattern a common solution to a given


problem in a given context, which supports reuse of
proven approaches and techniques.
Example: An Electric
companys customers
may be individuals or
businesses. Many
aspects of dealing with
customers are the same,
in which case they are
treated as parties.
Where they differ they
are treated through their
subtype.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Object Reusability

Object framework a set of related, interacting


objects that provide a well-defined set of services for
accomplishing a task.
Component a group of objects packaged together
into one unit. An example of a component is a
dynamic link library (DLL) or executable file.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

The Process of Object-Oriented Design

Refining the use case model to reflect the


implementation environment.
Modeling object interactions and behavior that support
the use case scenario.
Updating the object model to reflect the
implementation environment.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Refining The Use Case Model

Step 1: Transforming the Analysis Use Cases to


Design Use Cases
Step 2: Updating the Use Case Model Diagram and
Other Documentation to Reflect any New Use Cases

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Use Case

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Use Case (continued)

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Use Case (continued)

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Design Use Case (concluded)

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Modeling Object Interactions and Behaviors

Step 1: Identify and Classify Use-Case Design Objects


Step 2: Identify Object Attributes
Step 3: Model High-Level Object Interactions
Step 4: Identify Object States, Behaviors, and
Responsibilities
Step 5: Model Detailed Object Interactions

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Identify and Classify Use-Case Design Objects

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Model High-Level Interactions with Object Robustness Diagrams

Actors may interact


with the system via
interface objects
Irwin/McGraw-Hill

Control object
coordinates
messages sent to
the entity objects
Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Identify Object States, Behaviors & Responsibilities

Analyze the use cases to identify required system


behaviors
Associate behaviors and responsibilities with objects
Examine object model for additional behaviors
Verify classifications

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Identify Object States, Behaviors & Responsibilities

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Condensed Behavior List

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

CRC Card Listing Behaviors and Collaborators of an Object

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Examine Class Diagram to Discover Additional Behaviors

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Four Implicit Object Behaviors

Create new instances


Update data or attributes
Delete instances
Display information
When identifying
behaviors, dont forget
these implied behaviors
for every object.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

State and Diagramming State

Object state a condition of the object at one point in


its lifetime.
State transition event an occurrence that triggers a
change in an objects state through the updating of one
or more of its attribute values.
Statechart diagram a UML diagram that depicts
the combination of states that an object can assume
during its lifetime,
the events that trigger transitions between states,
the rules governing the from and to states an object
may transition.
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Object State Example

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Statechart diagram

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Verifying Object Behavior and Collaboration

Role playing the act of simulating object behavior


and collaboration by acting out an objects behaviors
and responsibilities.
Participants may assume the role of an actor on an
object type
Message sending is simulated by using an item such
as a ball that is passed between the participants.
Useful for discovering missing objects and behaviors.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Modeling Object Interactions for a Use Case

Sequence Diagram a UML diagram that models the


logic of a use case by depicting the interaction of
messages between objects in time sequence.
Collaboration Diagram a UML diagram that
models the logic of a use case by depicting the flows
of messages between objects in message sequence.

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Partial Sequence Diagram

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Updating Object Model to Reflect Implementation Environment

Design class diagram a diagram that depicts classes


that correspond to software components that are used
to build the software application. Includes:
Classes
Associations and gen/spec and aggregation
relationships
Attributes and attribute-type information
Methods with parameters
Navigability
Dependencies

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Transforming Analysis Class Diagram to Design Class Diagram

Add design objects to diagram


Add attributes and attribute-type information to design
objects
Add attribute visibility
Add methods to design objects
Add method visibility
Add association navigability
Add dependency relationships

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Partial Design Class Diagram

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Additional UML Design and Implementation Diagrams

Activity diagrams model actions that will be


performed when an operation is executing as well as
the results of those actions.
Component diagrams graphically depict the physical
architecture of the software of the system. They can be
used to show how programming code is divided into
modules and to depict the dependencies between those
components.
Deployment diagrams describe the physical
architecture of the hardware and software in the
system.
Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Component Diagram

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

SYSTEMS ANALYSIS AND DESIGN METHODS 6th Edition

Whitten Bentley Dittman

Deployment Diagram

Irwin/McGraw-Hill

Copyright 2004 The McGraw-Hill Companies. All Rights reserved

You might also like