slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
OOAD PowerPoint Presentation
Download Presentation
OOAD

Loading in 2 Seconds...

play fullscreen
1 / 20

OOAD - PowerPoint PPT Presentation


  • 142 Views
  • Uploaded on

OOAD. An Example. Account. acct # balance sec-code state. Trans_Rec. trans_type date_time amount teller_ID. has . withdrw dep prov_balance. 0..*. 1. Atm. atm #. req_withdrw req_dep req_balance req_int_rate. Std_Acct. Savings_Acct. int_rate. add_on_interest

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'OOAD' - lovette


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

OOAD

An Example

slide2

Account

acct #

balance

sec-code

state

Trans_Rec

trans_type

date_time

amount

teller_ID

has

withdrw

dep

prov_balance

0..*

1

Atm

atm #

req_withdrw

req_dep

req_balance

req_int_rate

Std_Acct

Savings_Acct

int_rate

add_on_interest

prov_int_rate

abstract

(Static)

Class diagram

slide3

ACCOUNT

Static OOAD

Diagram – other notations

acct #

balance

sec-code

state

TRANS_REC

trans_type

date_time

amount

teller_ID

has

withdrw

dep

prov_balance

(0,N)

(1,1)

ATM

atm #

req_withdrw

req_dep

req_balance

req_int_rate

STD_ACCT

SAVINGS_ACCT

int_rate

add_on_interest

prov_int_rate

slide4

Scenario 1

ACCOUNT

abstract

acct #

balance

sec-code

state

TRANS_REC

trans_type

date-time

amount

teller_ID

withdrw

dep

ATM

atm #

req_withdrw

req_dep

withdrw / deposit

create

slide5

Scenario 2

ACCOUNT

abstract

acct #

balance

sec-code

state

prov_balance

ATM

req_balance

prov_balance

slide6

ACCOUNT

abstract

Scenario 3

acct #

sec-code

state

ATM

req_int_rate

SAVINGS_ACCT

int_rate

prov_int_rate

prov_int_rate

slide7
OBJECT SPECIFICATION atm

STRUCTURES

EXTERNAL INPUTS / OUTPUTS

INPUT request-for-withdrawal (atm #, acct #, amount, sec-code)

INPUT request-for-deposit (atm #, acct #, amount)

INPUT request-for-balance (acct #, sec-code)

INPUT request-for-int-rate (acct #, sec-code)

OUTPUT message-for-customer

OUTPUT cash

ATTRIBUTES

atm # := identifies atm

STATE-DIAGRAM

slide8
SERVICES <atm>

- SERVICE req_withdrw ( )

VARIABLE ok:= withdrawal possible?

TRIGGERED BY INPUT request-for-withdrawal

SEND MESSAGE TO account(acct #).withdrw

(IN atm #, amount, sec-code; OUT ok)

IF ok equal TRUE

THEN BEGIN WRITE OUTPUT message-for-customer

USE OUPUT cash(amount) END

ELSE WRITE OUTPUT message-for-customer

END-SERVICE req_withdrw.

slide9
SERVICES <atm>

- SERVICE req_dep ( )

VARIABLE ok:= deposit successful ?

TRIGGERED BY INPUT request-for-deposit

SEND MESSAGE TO account(acct #).dep

(IN atm #, amount; OUT ok)

IF ok equal TRUE THEN WRITE OUTPUT message-for-customer

ELSE WRITE OUTPUT message-for-customer

END-SERVICE req_dep.

slide10
SERVICES <atm>

SERVICE req_balance( )

VARIABLE ok:= access to balance possible?

TRIGGERED BY INPUT request-for-balance

SEND MESSAGE TO account(acct #).prov_balance

(IN sec-code; OUT balance, ok)

IF ok equal TRUE THEN WRITE OUTPUT message-for-customer (balance)

ELSE WRITE OUTPUT message-for-customer

END-SERVICE req_balance.

slide11
SERVICES <atm>

SERVICE req_int_rate( )

VARIABLE ok:= access to int-rate possible?

TRIGGERED BY INPUT request-for-int-rate

SEND MESSAGE TO savings_acct(acct #).prov_int_rate

(IN sec-code; OUT int-rate, ok)

IF ok equal TRUE THEN WRITE OUTPUT message-for-customer (int-rate)

ELSE WRITE OUTPUT message-for-customer

END-SERVICE req_int_rate.

END SPECIFICATION atm.

slide12
OBJECT SPECIFICATION account

STRUCTURES

account has (0,N) trans_rec

account specialized_into std_acct

account specialized_into savings_acct

EXTERNAL INPUTS / OUTPUTS

ATTRIBUTES

acct # := identifies atm

balance := current balance on account in $

sec-code := authorization code

state := active, closed

STATE-DIAGRAM

active

Informal

closed

slide13
SERVICES <account>

- SERVICE withdrw ( IN atm #, amount, req-sec-code; OUT ok)

IF (state = active) & (req-sec-code = sec-code) & (amount < balance)

THEN BEGIN <transaction ok>

ok <= TRUE

balance <= balance - amount

SEND MESSAGE TO trans-rec.create

(IN “withdrawal”, current date&time, amount, atm #; OUT)

END

ELSE ok<= FALSE

END-SERVICE withdrw.

slide14
SERVICES <account>

- SERVICE dep ( IN atm #, amount; OUT ok)

IF (state = active)

THEN BEGIN <transaction ok>

ok <= TRUE

balance <= balance + amount

SEND MESSAGE TO trans-rec.create

(IN “depositl”, current date&time, amount, atm #; OUT)

END

ELSE ok<= FALSE

END-SERVICE dep.

slide15
SERVICES <account>

- SERVICE prov_balance ( IN req-sec-code; OUT result_balance, ok)

IF (state = active) & (req-sec-code = sec-code)

THEN BEGIN <transaction ok>

ok <= TRUE

result_balance <= balance

END

ELSE ok<= FALSE

END-SERVICE prov_balance.

END SPECIFICATION account.

slide16
OBJECT SPECIFICATION std_acct

STRUCTURES

std_acct is-a account

EXTERNAL INPUTS / OUTPUTS

ATTRIBUTES

STATE-DIAGRAM

SERVICES

END SPECIFICATION std_acct

slide17
OBJECT SPECIFICATION savings_acct

STRUCTURES

savings_acct is-a account

EXTERNAL INPUTS / OUTPUTS

ATTRIBUTES

int_rate := currently valid interest rate

STATE-DIAGRAM

slide18
SERVICES <savings_acct>

- SERVICE prov_int_rate ( IN req-sec-code; OUT result_int_rate, ok)

IF (state = active) & (req-sec-code = sec-code)

THEN BEGIN <transaction ok>

ok <= TRUE

result_int_rate <= int_rate

END

ELSE ok<= FALSE

END-SERVICE prov_int_rate.

slide19
SERVICES <savings_acct>

- SERVICE add_on_interest ( )

VARIABLE interest := used to calculate interest

TRIGGERED BY TIME (end-of-month)

calculate interest from ( balance & int-rate )

balance <= balance + interest

END-SERVICE add_on_interest.

END SPECIFICATION savings_acct.

slide20
OBJECT SPECIFICATION trans_rec

STRUCTURES

trans_rec has <belongs to> (1,1) account

EXTERNAL INPUTS / OUTPUTS

ATTRIBUTES

trans_type := withdrawal or desposit

date_time := date & time of transaction

amount := amount used in trans_type

teller_ID := ID of accessing entity (teller, atm)

STATE-DIAGRAM

SERVICES

- SERVICE create is standard create.

END SPECIFICATION trans_rec.