Publications | RomiSatriaWahono.Net

Object-Oriented Analysis and
Design Methodology

Romi Satria Wahono
Email : romi@romisatriawahono.net
HP
: http://romisatriawahono.net
Department of Information and Computer Sciences
Graduate School of Science and Engineering
Saitama University

1

Contents
„

An Introduction to the Object-Orientation
„ An Introduction to the Object-Oriented
Methodology
„ Object-Oriented Notation Guide
„ Object-Oriented Analysis and Design

„ Object-Oriented Implementation

2

An Introduction to the
Object-Orientation

3

What is Object-Orientation
„
„

„

A new technology based on objects and classes
A way of thingking to organizing software as a
collection of discrete objects that incorporate
both data structure and behaviour
An abstraction of the real world based on

objects and their interactions with other objects

4

Three Characteristics of OO
„

„

„

Abstraction and Classification :
„
„
„
„

Focusing on essential, inherent aspects of an entity and
ignoring its accidental.
The idea of grouping software ideas into classes of things


Encapsulation and Information Hiding :
„
„

Separating the external aspects of an object, which are
accessible to other objects, from the internal implementation
details of object, which are hidden from other objects

Polymorphism and Inheritance :
„
„

Ability of abstractions to share
properties by inheritance
hierarchy

Abstraction
Object-Oriented
Object-Oriented

System
System

Encapsulation

Polymorphism

5

Object and Classes
„

Object
„
„

„
„
„
„


„

An object is a thing or concept. It can be a real-world thing or
concept, or an abstraction of a thing or concept expressed as a
software representation.
An object has state (attributes) and behavior (method)
Individual objects, also called instances, have identity and are
distinct things, and can be distinguished from other objects.

Classes
„
„
„
„

A class is a description of a collection of objects with common
attributes and behavior.
In practice, the definition or specification of a class includes the
definitions of the attributes comprising the state, the methods

implementing the behavior, and how to handle creation and
destruction of an object.

6

An Introduction to the ObjectOriented Methodology

7

What Are Analysis and Design For
„

Testing a physical entity before building
system
„ Communicating with Customers
„ Visualization
„ Reduction of Complexity

8


Various Type of Methodologies
„
„
„
„
„
„
„

Shlaer/Mellor Method [Shlaer-1988]
Coad/Yourdon Method [Coad-1991]
Booch Method [Booch-1991]
OMT Method [Rumbaugh-1991]
Wirfs-Brock Method [Wirfs-Brock-1990]
OOSE Objectory Method [Jacobson-1992]
UML (Unified Modeling Language) [UML-1997]

9

Development Process

Object-Oriented Analysis

Object-Oriented Design

Object-Oriented Implementation

10

Object-Oriented Notation Guide

11

Class and Object
„

Class

„

Class Name


„

Object Instances
Class Name

Attribute

Attribute

Operation

Operation

Instantiation Relationship
Class Name

Class Name
12


Generalization and Inheritance
Superclass

Subclass 1

Subclass 2

13

Aggregation
„

Aggregation 1
Assembly Class

Part 1 Class

Part 2 Class

„


Aggregation 2
Assembly Class

Part 1 Class

Part 2 Class

14

Association
„

Association
Association Name
Class 1

„

Role 1

Role 2

Class 2

Qualified Association
Association Name
Class 1 qualifier

„

Role 1

Role 2

Class 2

Multiplicity of Associations
Class

Class

Exactly One

Many

1+

Class
One or More 15

Ternary Association
Association Name
Class 1

Class 2
Role 1

Role 2

Role 3
Class 3

16

Object-Oriented Analysis and
Design

17

Analysis and Design Process
„
„
„

„
„

Problem Statement
System Architecture
Object Modeling
„
„

Identifying Object Classes
„
„ Preparing a Data Dictionary for Classes
„
„ Identifying Associations
„
„ Identifying Attributes
„
„ Refining with Inheritance
„
„ Grouping Classes into Modules

Dynamic Modeling
Functional Modeling

18

Problem Statement
„

Requirements Statement
„

Problem Scope
„ What is needed
„ Application Context
„ Assumptions
„ Performance Needs

19

Example : ATM Network
Cashier
Station

ATM
ATM
ATM

Central
Computer

Bank
Computer
Bank
Computer

Account
Account
Account
Account

20

System Architecture
Consortium
Computer

ATM Station

Bank Computer
Cashier

ATM
Cash
Card
User

Consortium
Phone
Lines
Station
Code
Bank
Code

User
Interface

Cashier
Station

Database
Phone
Lines

Account
Customer
Card
Authorization

Transaction

Transaction

Transaction

21

Identifying Object Classes
Requirements

Tentative
Extract nouns

Statement

Object Classes
„

Discard
Unnecessary
and Incorrect
Classes

„
„
„
„
„
„

Eliminate spurious
Classes

Object
Classes

Redundant classes
Irrelevant classes
Vague classes
Attributes
Operations
Roles
Implementation constructs
22

Example: IOC for ATM Network
Bad Classes
Vague

Attribute

Implementation

System

Banking Network

Receipt

Cash

Access

Software

Security
Provision

Record Keeping
Provision

Transaction
Data

Account
Data

Transaction
Log

Comm
Line

User

Cost

Redundant

Irrelevant

Good Classes
Account

ATM

Bank

Cashier
Station

Central
Computer

Bank
Computer

Consortium Customer

Cashier

Cash Card Transaction

23

Preparing a Data Dictionary
„ Isolated word have many interpretations,

so prepare a data dictionary for all
modeling entities
„ Describe the scope of the class within the
current problem, including assumptions or
restrictions on its membership or use
„ The data dictionary also describes
associations, attributes, and operation
24

Example: DD for ATM Network
„
„

„
„

„
„
„
„
„
„
„
„
„
„

Account : a single account in a bank against which
transactions can be applied. Account may be of various
types, at least checking or savings. A customer can hold
more than one account.
Bank : A financial institution that holds accounts for
customers and that issues cash cards authorizing access
to accounts over the ATM network.
ATM : …
Bank Computer : …
Cash Card : …
Cashier : ...
etc.
25

Identifying Associations
Object

Tentative
Extract verbs

Classes

associations
„

Discard
Unnecessary
and Incorrect
Associations

„
„
„
„
„
„

Eliminate spurious Associations
associations

Associations between
eliminated classes
Irrelevant or implementation
associations
Actions
Ternary associations
Derived associations
Misnamed associations
Multiplicity

26

Example: IAs for ATM Network
Consortium Bank

Consists of

Has
Has

Holds
Holds

Bank

Code

Account

Customer

Employs
Employs
Owns

Central
Computer

Concerns
Concerns

Owns
Communicates
with

Bank
Computer

Cashier
Entered
Entered by
by

Communicates
with
Communicates
with

ATM

Entered
Entered on
on

Accesses
Accesses

Owns

Entered
Entered on
on

Cashier
Station

Concerns
Concerns

Has
Has

Cashier
Transaction

Remote
Transaction
Authorized
Authorized by
by

Cash
Card

27

Identifying Attributes
Object
Classes

Extract object
properties

Tentative
attributes

„
„

Discard
Unnecessary
and Incorrect
Attributes

„
„
„
„
„
„

Eliminate spurious Attributes
attributes

Objects
Qualifiers
Names
Identifiers
Link attributes
Internal values
Fine detail
Discordant attributes
28

Example: IAT for ATM Network
Card
Code

Consists of

Consortium

Bank
Code

Bank
name
Station
Code

Owns

Central
Computer
Station
Code

Owns
Bank
Code

Communicates
with

Bank
Computer
Station
Code

Station

Entered
Entered on
on

Customer
name
address

Accesses
Accesses

Cashier
name

Entered
Entered on
on

Concerns
Concerns

Has
Has

Cashier
Transaction
Kind
date-time
amount

Remote
Transaction
Kind
date-time
amount

Has
Has

Concerns
Concerns

Entered
Entered by
by

Communicates
with

cash on hand
dispensed

Account Holds
Holds Account
Code
Balance
Employee
credit limit
Code
type

Employs
Employs
Owns

Communicates
with
Cashier

ATM

Issues
Issues

Authorized
Authorized by
by

Cash
Card
password

29

Refining With Inheritance
„
„

This step is to organize classes by using
inheritance to share common structure
Inheritance can be added in two directions :
„
„

Bottom Up : By generalizing common aspect of existing
classes into a superclasses
„
„

„
„

By searching for classes with similar attributes, associations,
or operations
„
„ For each generalization, define a superclass to share
common features

Top Down : By refining existing classes into specialized
subclasses
30

Example: RWI for ATM Network
Entered
Entered on
on

ATM

Kind
date-time
amount

ATM

Cashier
Station

cash on hand
dispensed

Communicates
Station with
Code

Central
Computer
Owns

Consortium

Transaction

Bank
Code

Cashier
Transaction

Communicates
with
Owns

name

Communicates
Communicates
Owns
with
with

Station
Code

Bank
name
Account
Code

Authorized
Authorized by
by
Issues
Issues
Cash
Has
Has
Card

Cashier

Bank
Computer

Consists
Consists of
of

Remote
Transaction

Entered
Entered by
by

Station
Code

Bank
Code

Concerns
Concerns

Employs
Employs

Customer
name
address

Employee
Code
Card
Code

password

Has
Has
Holds
Holds

Accesses
Accesses

Account
Balance
credit limit
type

31

Grouping Classes into Modules
„

A module is a set of classes that captures
some logical subset of entire model
„ For example: a model of computer
operating system might contain modules
for process control, device control, file
maintenance, and memory management

32

Example: GCIM for ATM Network
„

Tellers: Cashier, Entry Station, Cashier
Station, ATM
„ Account: Account, Cash Card, Card
Authorization, Customer, Transaction,
Update, Cashier Transaction, Remote
Transaction
„ Banks: Consortium, Bank

33

Dynamic Model
„ The dynamic model shows the time-

dependent behavior of the system and the
objects in it.
„ Begin dynamic analysis by looking for
event, externally visible stimuli and
responses.
„ The dynamic model is important for
interactive systems, but insignificant for
purely static data repository, such as
database.

34

Dynamic Model
„ The following steps are performed in

constructing a dynamic model

„ Prepare scenarios of typical interaction

sequences
„ Identify events between objects
„ Prepare an event trace for each scenario
„ Build a state diagram
„ Match events between objects to verify
consistency
35

Example: DM for ATM Network
User

ATM

Consortium

Bank

Insert card
request password
enter password

verify account
account OK

verify card with bank
bank account OK

request kind
enter kind
request amount
enter amount

dispense
dispense cash
cash
request
request take
take cash
cash

process transaction

process bank transaction
bank transaction succeed

transaction succeed

take
take cash
cash
take
take card
card
display
display main
main screen
screen

36

Functional Model
„ The functional model shows how values

are computed, without regard for
sequencing, decisions, or object structure
„ The functional model shows which values
depend on which other values and the
functions that relate them
„ Data flow diagrams are useful for showing
functional dependencies
37

Example: FM for ATM Network
Cash
Card

Account
bank
bank code,
code,
card
card code
code

read inputs

balance
balance

perform
transaction

password,
password,
transaction
transaction kind,
kind,
amount,
amount,
account
account type
type

generate
outputs

Messages,
Messages,
cash,
cash,
receipt
receipt

User
38

Object-Oriented Implementation

39

Implementation Process
„

Class Definition
„ Creating Objects
„ Calling Operations
„ Using Inheritance
„ Implementing Association

40

References -1„
„
„
„

„
„
„
„

[ Booch-1991] Grady Booch, Object-Oriented Analysis
and Design with Application, Benjamin/Cummings, 1991.
[Booch-1999] Grady Booch, James Rumbaugh, and Ivar
Jacobson, The Unified Modeling Language User Guide,
Addison-Wesley, 1999.
[Coad-1991] Peter Coad and Edward Yourdon, ObjectOriented Analysis, Yourdon Press, 1991.
[Jacobson-1992] Ivar Jacobson, Magnus Christerson,
Patrik Jonson, and Gunnar Overgaard, Object-Oriented
Software Engineering: A Use Case Driven Approach,
Addison-Wesley, 1992.
41

References -2„
„

„
„

„
„

„
„

[ Jacobson-1999] Ivar Jacobson, Grady Booch, and
James Rumbaugh, The Unified Software Development
Process, Addison-Wesley, 1999.
[Rumbaugh-1991] James Rumbaugh, Michael Blaha,
William Premerlani, Frederick Eddy, and William
Lorenson, Object-Oriented Modeling and Design,
Prentice Hall, 1991.
[Rumbaugh-1999] James Rumbaugh, Ivar Jacobson,
and Grady Booch, The Unified Modeling Language
Reference Manual, Addison-Wesley, 1999.
[Shlaer-1988] Sally Shlaer and Stephen J. Mellor,
Object-Oriented System Analysis: Modeling the World in
Data, Yourdon Press, 1988.
42

References -3„
„

[ UML-1999] Unified Modeling Language Specification,
Object Management Group, www.omg.org, 1999.
[Wirfs-Brock-1990]
Rebecca
Wirfs-Brock,
Brian
Wilkerson, and Lauren Wiener, Designing ObjectOriented Software, Prentice Hall, 1990.

43