You are on page 1of 43

Object-Oriented Analysis and

Design Methodology

Romi Satria Wahono


Email : romi@romisatriawahono.net
HP : http://romisatriawahono.net

Copyright © 2003 IlmuKomputer.Com

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 Abstraction
properties by inheritance
hierarchy 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 Object-
Oriented 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 „ Object Instances

Class Name 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 „ Aggregation 2

Assembly Class Assembly Class

Part 1 Class Part 2 Class Part 1 Class Part 2 Class

14
Association
„ Association
Association Name
Class 1 Class 2
Role 1 Role 2

„ Qualified Association
Association Name
Class 1 qualifier Class 2
Role 1 Role 2

„ Multiplicity of Associations
1+
Class Class Class

Exactly One Many 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

Account
Bank
ATM
Computer Account
Central
ATM Computer
Bank Account
ATM Computer
Account

20
System Architecture
Consortium
ATM Station Bank Computer
Computer

Cashier
ATM Consortium Cashier
Station
Phone
Cash Lines
Card Database
Station Phone
User Code Lines Account
Bank Customer
User
Code
Interface
Card
Authorization

Transaction Transaction Transaction

21
Identifying Object Classes
Requirements Tentative Object
Eliminate spurious
Extract nouns
Classes
Statement Object Classes Classes

„ Redundant classes
Discard „ Irrelevant classes
Unnecessary „ Vague classes
and Incorrect „ Attributes
Classes „ Operations
„ Roles
„ Implementation constructs
22
Example: IOC for ATM Network
Bad Classes
Vague Attribute Implementation

System Banking Network Receipt Cash Access Software


Security Record Keeping Transaction Account Transaction Comm
Provision Provision Data Data Log Line

User Cost

Redundant Irrelevant

Good Classes
Account ATM Bank Consortium Customer Cashier
Cashier Central Bank
Cash Card Transaction
Station Computer Computer
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
Eliminate spurious Associations
Extract verbs
associations associations
Classes

„ Associations between
eliminated classes
Discard „ Irrelevant or implementation
Unnecessary associations
and Incorrect „ Actions
Associations „ Ternary associations
„ Derived associations
„ Misnamed associations
„ Multiplicity 26
Example: IAs for ATM Network
Consists of Has
Has
Holds
Holds
Consortium Bank
Code Bank Account Customer
Employs
Employs
Owns Owns Concerns
Concerns
Communicates Owns Accesses
Accesses
Central with Bank
Computer Computer Cashier

Communicates Entered
Entered by
by Concerns
Concerns Has
Has
with
Entered
Entered on
on
Communicates Cashier Cashier
with Station Transaction

Entered
Remote
Entered on
on
ATM Transaction Cash
Authorized Card
Authorized by
by 27
Identifying Attributes
Tentative
Object
Extract object attributes Eliminate spurious Attributes
properties attributes
Classes

„ Objects
„ Qualifiers
Discard „ Names
Unnecessary „ Identifiers
and Incorrect „ Link attributes
Attributes „ Internal values
„ Fine detail
„ Discordant attributes
28
Example: IAT for ATM Network
Card
Issues
Issues
Consists of Code
Account Holds
Holds Account
Bank Bank Code
Consortium Code Balance Customer
name Employee Has
Has
Station credit limit name
Code type
Owns Code address
Owns Employs
Employs
Central Owns Concerns
Concerns Accesses
Accesses
Bank Bank
Computer Code Cashier
Computer
Communicates Station name
Station
Code
with Code Concerns
Concerns Has
Has
Entered
Entered by
by
Communicates
with Cashier Entered
Entered on
on Cashier
Communicates Station Transaction
with Kind
date-time
amount
Remote
Entered
Entered on
on
ATM Transaction
Cash
cash on hand Kind
dispensed date-time Authorized
Authorized by
by Card
amount 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 Transaction
ATM Concerns
Concerns
Kind
date-time
amount

ATM Cashier Cashier Remote


cash on hand Station Transaction Transaction
dispensed Communicates
Communicates with Entered
Entered by
by
Station with Station Owns Authorized
Authorized by
by
Code Code Cashier
Issues
Issues Cash
Central Bank Bank name
Computer Computer Has
Has Card
Code
Communicates password
Communicates Employs
Employs
with Owns Customer
with
Owns Station name
Code Employee address Accesses
Accesses
Bank Bank Code Has
Has
Consortium Code
name Card Account
Consists Code Balance
Consists of
of Account
Holds
Holds credit limit 31
Code
type
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
verify card with bank
account OK bank account OK
request kind
enter kind
request amount
enter amount
process transaction
process bank transaction

bank transaction succeed


dispense
dispense cash
cash
transaction succeed
request
request take
take cash
cash
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

Account
Cash
Card bank
bank code,
code,
card
card code
code balance
balance

perform generate
read inputs
transaction outputs

password,
password,
Messages,
Messages,
transaction
transaction kind,
kind,
cash,
cash,
amount,
amount,
receipt
receipt
account
account type
type
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, Object-
Oriented 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 Object-
Oriented Software, Prentice Hall, 1990.

43

You might also like