You are on page 1of 36

ATM Case Study

A Discussion
Case Study
A Bank wishes to introduce ATM service to provide
limited facilities to her customers. Customers may get
ATM cards on request. Users may view their balance or
transfer or withdraw money using these cards. Cards
may be used to access many accounts and an account
may be accessed using different cards. A card may be
blocked temporarily or permanently (e.g. If it is lost) by
the Bank. A PIN is associated with each card to verify
the authority of the user. There is an OD limit associated
with each cheque account. Theoretically, any amount
may be withdrawn from a cheque account at any time
(provided it is less than the balance+Odlimit). There is no
OD facility for a savings account.
Case Study (cty)
The personal information of the customers and
their account details are already maintained by
the Banks main system. A subsystem is
required to handle the ATMs functionality. Two
hardware systems Card reader and Money
dispenser will communicate with this subsystem.
The card reader reads the Cards ID and passes
it to the system. It is also able to eject the card
when an eject signal is received from the
system. Similarly the money dispenser is able to
dispense the required amount of money.
Case Study-3
The Limited ATM system is required to provide
at least the following operations.
Enter a new card / new account detail
Block /Reactivate/Cancel a card
View the balance of the account
Withdraw money from the account
Transfer money from one account to another
Change the PIN of a card
The validity of the card and the authority of the
User will be checked for each transaction session.
A Business Client Clerk Manage
Activity r
Diagram :Card
Apply for Card [Recorded]

Record Detail

Approve
:Card
[Finalised]
Finalise Card :Card
[Approved]

Receive Card

Assign Pin :Card


[active]
Applying for
New Card
Client arrives at ATM
A Business
[CARD valid]
Activity Insert Card

Diagram [CARD valid]

[PIN OK]
Give PIN

[PIN OK]
[Quit]
Select Service

[withdraw]

View Balance Withdraw Eject Card

Client Client leaves


Transaction ATM
Glossary
ATM Card -
Withdraw -
Requirement List

Client shall view the balance


Client shall withdraw money within a limit
Client shall change the PIN
Bank Clerk shall store a new CARD detail
Bank Clerk shall add another account to a
CARD
Shall check the CARDs validity
Shall verify the PIN
Shall use 3-DCS (168 bits) encoding
Grouping the Candidate Requirements

CARD MANIPULATION
Clerk store a new CARD detail
Clerk add another account to a CARD
Clerk & Client shall fix new PIN first time
Client shall change the PIN
TRANSACTIONS
Client shall view the balance (within 2 minutes)
Client shall withdraw money from savings/
current account within the limit
Client shall transfer money within the limit
Use Cases Transactions

transfer

withdraw

Client
view Balance

Add structures
Use Cases Transactions Structures added

transfer

withdraw
get Accounts
Client
view Balance

print Balance
Use Cases Card Manipulation

fix PIN

Client

add new account

Clerk add new card

Add structures
Use Cases Card Manipulation

fix PIN

Client

add new account

Clerk add new card


ATM- Withdraw From Current
Name : Withdraw From Current
Actor : Client
Pre-conditions : User already logged-in
A menu is active with withdraw option
Post-conditions : Amount is deducted from users account
Purpose : To allow the client to withdraw money
Description:
(1) Client initiates this usecase by selecting withdraw
(2) System get all the accounts (use case get Account)
(3) System displays all the accounts and prompts to select any one
(3) Client selects one account
(4) System prompts for the amount
(5) Client indicate an amount
(6) System issues money, update record, and confirms
Alternative courses:
(3) & (4) System selects the only one available account
(6) requested amount is bigger than balance, system display message
Errors:
Issue Cash?
Usecase Description-
Withdraw from Savings
Prototype
Withdraw from Current
Select A Service Select An Account
Withdraw Cheque
View Balance Savings (House)
Transfer Credit

Suceess Give An Amount


Take Your Money
Another Transaction? OK
Get Your Card? OK OK
Client selecetd
ATM- Withdraw withdraw
[account=1]
System gets
all accounts

[accounts>1]
Displays all
accounts

Client Select One


Account

[Quit]
System asks for
Amount to withdraw

[amount > balance] [amount > balance]


Client types Client selects
amount Display message Fast cash

Eject Card
Issue cash
Complete other Usecases!
View Balance
Transfer
Add Card
Add Account
Change PIN
Change Status
Check PIN
ATM ; E-R Diagram Classes (ITE-1)
ATMSavings ATMCustome ATMCheque
1..* rcustID 1..*
accID accID
balance 0..* getCustID() 0..* balance
getAccID() 1 oDlimit
setBalance() 1..* getAccID()
getBalance() setBalance()
ATMCard
getBalance()
1..* cardNo
pin 1..*
0..* status 0..*
getCardID()
For the time being there is setPIN()
no need for an Association checkPIN() What if, the date joined (an
Class or Attributed setStatus() Account to a Card) attribute
Association is important ?
getStatus()
Realize Usecases
Identify Systems Tasks
Identify Collaborating Objects
Allocate Responsibilities
Draw CRC
Draw Colloboration
Assign a Ctrl class (and a UI class- if necessary)
for each usecase.
Draw Collobaration again
Update Class diagram
Withdraw From Current
Name : Withdraw From Current Identify Systems Tasks
Actor : Client
Pre-conditions : User already logged-in Identify Nouns
A menu is active with withdraw option
Post-conditions : Amount is deducted from users account
Purpose : To allow the client to withdraw money
Description:
(1) Client initiates this usecase by selecting withdraw
(2) System get all the accounts (use case get Account)
(3) System displays all the accounts and prompts to select any one
(3) Client selects one account
(4) System prompts for the amount
(5) Client indicate an amount
(6) System issues money, update record, and confirms
Alternative courses:
(3) & (4) System selects the only one available account
(6) requested amount is bigger than balance, system display message
Errors:
Systems Tasks Identified

(1) System gets all the accounts on Card


(2) System displays the details of Accounts
(3) Prompts to select one
(4 System prompts for the amount
(5) System issue money
(6) Update records (update what?)
How to allocate these tasks to different clas
Use case Realization!

Identify Collaborations

1 withdra
w
Client

withdra
w

2 :Card :Account
CRC - Allocate Responsibilities

Class Name Card


Responsibilities Collaborations

Provide Card information.

Account provides Accounts


Provide list of Accounts.
detail.

Class Name Account

Responsibilities Collaborations

Provide Account information.

Provide Withdrawal
Collaboration Diagram (Initial Idea)!

1 getAllAccDetail()
2 *getAccDetail()

4 withdraw(amm)
3 withdraw(acc,am
::Card
::Account
Client m)
Collaboration Diagram,
with UI and CTRL objects!
0
withdraw(cID)

3 selectAccount 2 startUI()
5.1 withdraw(am
4 proAmou 5 withdraw(acc,am) )
Client nt ::withdrawUI ::withdrawCtrl

1 getAllAccDetail()
1.1 *getAccDetail() ::Cheque
::Card

Issue Cash?
Analysis Level Class Diagram : Ite-2
ATMSavings ATMCustome ATMCheque
1..* rcustID 1..*
accID accID
balance balance
accName 0..* getCustID() 0..*
oDlimit
1 accName
getAccID()
setBalance() 1..* getAccID()
getBalance() 1..*
1..* setBalance()
getAccDetail() ATMCard getBalance()
withdraw(amo) 0..* getAccDetail()
cardNo 0..* withdraw(amo)
pin
status
ATMwdUI
getCardID()
setPIN() ATMwdCTRL
startUI();
selectAcc(); getPIN()
proAmount(); setStatus() withdraw(cID)
getStatus() withdraw(aID,amo)
getAllAccDetail()

What next? Identify Super-Sub & Aggregations


Analysis Level Class Diagram (Ite-3)
ATMCustome
1..* rcustID
1..*
getCustID()
ATMSavings ATMAccount 1
accID
balance 1..*
withdraw(amo)
accName ATMCard
getAccID()
0..* cardNo
ATMCheque setBalance()
pin
getBalance()
status
oDlimit getAccDetail() 1..*
withdraw(amo) getCardID()
withdraw(amo)
setPIN()
getPIN()
ATMwdUI setStatus()
getStatus()
ATMwdCTRL startUI(); getAllAccDetail()
selectAcc();
withdraw(cID) proAmount();
withdraw(aID,amo)
Analysis Level Class Diagram (ver-2)
ATMCustome
1..* rcustID
1..*
getCustID()
ATMSavings ATMAccount ATMCustAcc
1
accID
balance
withdraw(amo)
accName
1..*
getAccID()
ATMCheque setBalance() ATMCard
getBalance()
oDlimit getAccDetail() cardNo
withdraw(amo) pin
withdraw(amo) status

ATMwdUI getCardID()
setPIN()
ATMwdCTRL getPIN()
startUI(); setStatus()
selectAcc();
proAmount();
getStatus()
withdraw(cID) getAllAccDetail()
withdraw(aID,amo)
Which version is better, why?
Sequence diagram
with entity objects only

Client

:Card :Account

getAllAccDetail() *getAccDetail( )

withdraw(acc,am)
withdraw(am)

Use Case: withdraw


Sequence diagram
With Boundary & Control Classes

Client :withdrawCtrl :Card :Account

:withdrawUI *getAllAccDetails()
startUI() *getAccDetail()

selectAccount()

proAmount()
withdraw() withdraw()

Issue Cash?

Use Case: withdraw


State Transitions
Include relevant State Transition Diagrams
(or Activity Diagrams)
CARD Statechart
Card()
Pending

fixPIN()
OnUse

OnUse Active

setStatus()
after [1 year]
Blocked

Lapsed

~Card()
Withdraw- Operation Specification
Pre- and Post-condition Pair
pre-conditions:
CARD is valid
ACCOUNT is valid
ACCOUNT is associated with CARD
amount is valid
post-conditions:
if amount is greater than ACCOUNT.balance
value of ACCOUNT.balance set equal to
ACCOUNT.balance-amount
value of result set equal to success
otherwise
value of result set equal to failure

Issue Cash?
Structured English- withdraw
get all the accounts associated with CARD
if there are more than one ACCOUNT
Do while there is no more ACCOUNTS left
get all the details associated with ACCOUNT
display details
endDo
set ACCOUNT to user selected ACCOUNT
else
set ACCOUNT to the only existing ACCOUNT
endIf
if ACCOUNT.balance is greater than amount
set ACCOUNT.balance to ACCOUNT.balance amount
set result to TRUE
else
set result to FALSE
endIf
return result

Issue Cash?
Activity Diagram- Withdraw
Get Account
Details [more]

[NoOfAccounts = 1] [NoOfAccounts > 1]


A List an Account
Only Account details

[no more]
Get Users
Get amount
Choice (say A)

[amount >A . balance]

Result FALSE
[amount < =A . balance]

A.balance
A.balance-amount
Result TRUE
Issue Cash?

You might also like