You are on page 1of 43

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

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

An Introduction to the Object-Orientation

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

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

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.

An Introduction to the ObjectOriented Methodology

What Are Analysis and Design For


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

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]

Development Process
Object-Oriented Analysis

Object-Oriented Design

Object-Oriented Implementation

10

Object-Oriented Notation Guide

11

Class and Object


Class
Class Name Attribute Operation

Object Instances
Class Name Attribute Operation

Instantiation Relationship
Class Name Class Name
12

Generalization and Inheritance


Superclass

Subclass 1

Subclass 2

13

Aggregation
Aggregation 1
Assembly Class

Aggregation 2
Assembly Class

Part 1 Class

Part 2 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 1+ Class 2

Multiplicity of Associations
Class Exactly One Class Many Class One or More 15

Ternary Association
Association Name Class 1 Role 1 Role 2 Class 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 Account Account Account

ATM ATM ATM


Central Computer

Bank Computer Bank Computer

20

System Architecture
ATM Station Consortium Computer Bank Computer
Cashier ATM Cash Card User User Interface Phone Lines Station Code Bank Code Phone Lines Consortium Cashier Station

Database
Account Customer
Card Authorization

Transaction

Transaction

Transaction

21

Identifying Object Classes


Requirements
Extract nouns Tentative Object Classes

Statement

Eliminate spurious Classes

Object Classes

Discard Unnecessary and Incorrect Classes

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

Example: IOC for ATM Network


Bad Classes
Vague
System Security Provision Banking Network Record Keeping Provision Receipt Transaction Data User

Attribute
Cash Account Data Cost

Implementation
Access Transaction Log Software Comm Line

Redundant

Irrelevant

Good Classes
Account Cashier Station ATM Central Computer Bank Bank Computer Consortium Customer Cash Card Transaction Cashier

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 Classes
Extract verbs Tentative associations Eliminate spurious Associations associations

Discard Unnecessary and Incorrect 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
Owns Consists of Holds Holds Has Has Code Owns Communicates with

Bank
Employs Employs Owns

Account
Concerns Concerns

Customer

Central Computer

Bank Computer

Accesses Accesses

Cashier
Entered by Entered by Concerns Concerns Has Has

Communicates with Communicates with

Cashier Station

Entered on Entered on

Cashier Transaction

ATM

Entered on Entered on

Remote Transaction
Authorized by Authorized by

Cash Card

27

Identifying Attributes
Object Classes
Extract object properties Tentative attributes Eliminate spurious Attributes attributes

Discard Unnecessary and Incorrect Attributes

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

Example: IAT for ATM Network


Consists of
Card Code

Consortium
Owns

Bank Code

Bank
name Station Code

Account Holds Account Holds Code Balance Employee credit limit Code type

Issues Issues Has Has

Customer
name address

Central Computer
Station Code

Owns
Bank Code

Communicates with

Bank Computer
Station Code

Employs Employs Owns

Concerns Concerns
name

Accesses Accesses

Cashier
Entered by Entered by Entered on Entered on Concerns Concerns Has Has

Communicates with Cashier Communicates with Entered on Entered on

Station Remote Transaction


Kind date-time amount

Cashier Transaction
Kind date-time amount

ATM
cash on hand dispensed

Authorized by Authorized 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


ATM
Entered on Entered on

Transaction
Kind date-time amount

Concerns Concerns

ATM
cash on hand dispensed

Cashier Station
Communicates with
Station Code

Cashier Transaction
Entered by Entered by

Remote Transaction
Authorized by Authorized by Issues Issues Cash Has Has Card

Communicates Station with

Central Computer
Owns

Code

Owns

Cashier
name

Bank Code

Communicates Communicates Owns with with

Bank Computer
Station Code

Employs Employs
Employee Code Card Code

Customer
name address

password

Accesses Accesses

Consortium

Bank Code

Bank
Consists of Consists of
name Account Code

Has Has Holds Holds

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 timedependent 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
Insert card request password enter password verify account account OK request kind enter kind request amount enter amount process transaction process bank transaction bank transaction succeed transaction succeed

ATM

Consortium

Bank

verify card with bank bank account OK

dispense cash dispense cash request take cash request take cash take cash take cash take card take card display main screen display main 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 code, bank code, card code card code balance balance

read inputs

perform transaction

generate outputs

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

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

You might also like