Title: ATM Case Study
1ATM Case Study
2Case 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 balanceOdlimit). There is no OD
facility for a savings account.
3Case 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.
4Case 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.
5A Business Activity Diagram
Applying for New Card
6A BusinessActivity Diagram
Client arrives at ATM
CARD valid
Insert Card
CARD valid
Give PIN
PIN OK
PIN OK
Quit
Select Service
withdraw
Eject Card
View Balance
Withdraw
ClientTransaction
Client leaves ATM
7Glossary
8Requirement 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
9Grouping 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
10Use Cases
Transactions
transfer
withdraw
Client
view Balance
Add structures ?
11Use Cases
Transactions
Structures added
transfer
withdraw
get Accounts
Client
view Balance
print Balance
12Use Cases
Card Manipulation
fix PIN
Client
add new account
Clerk
add new card
Add structures ?
13Use Cases
Card Manipulation
fix PIN
Client
add new account
Clerk
add new card
14ATM- 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?
15Usecase Description- Withdraw from Savings
16Prototype Withdraw from Current
- Select A Service
- Withdraw
- View Balance
- Transfer
- Select An Account
- Cheque
- Savings (House)
- Credit
Give An Amount
Suceess Take Your Money Another Transaction? Get
Your Card?
OK
OK
OK
17ATM- Withdraw
Client selecetd withdraw
account1
System gets all accounts
accountsgt1
Displays all accounts
Client Select One Account
Quit
System asks for Amount to withdraw
amount gt balance
amount gt balance
Client selects Fast cash
Client types amount
Display message
Eject Card
Issue cash
18Complete other Usecases!
- View Balance
- Transfer
- Add Card
- Add Account
- Change PIN
- Change Status
- Check PIN
19ATM E-R Diagram ? Classes (ITE-1)
ATMCustomer
ATMSavings
ATMCheque
1..
1..
custID
accIDbalance
accIDbalanceoDlimit
0..
0..
getCustID()
getAccID()setBalance()getBalance()
1
getAccID()setBalance()getBalance()
1..
ATMCard
1..
cardNopinstatus
1..
0..
0..
getCardID()setPIN()checkPIN()setStatus()getSta
tus()
For the time being there is no need for an
Association Class or Attributed Association
What if, the date joined (an Account to a Card)
attribute is important ?
20Realize 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
21Withdraw From Current
Identify Systems Tasks
- 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
Identify Nouns
22Systems 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 classes?
23Use case Realization!
Identify Collaborations
1
withdraw
Client
withdraw
2
24CRC - Allocate Responsibilities
Class Name
Card
Responsibilities
Collaborations
Provide Card information.
Account provides Accounts detail.
Provide list of Accounts.
Class Name
Account
Responsibilities
Collaborations
Provide Account information.
Provide Withdrawal
25Collaboration Diagram (Initial Idea)!
2
1
getAccDetail()
getAllAccDetail()
4
withdraw(amm)
3
withdraw(acc,amm)
Client
26Collaboration Diagram, with UI and CTRL objects!
0
Issue Cash?
27Analysis Level Class Diagram Ite-2
ATMCustomer
ATMSavings
ATMCheque
1..
1..
custID
accIDbalanceaccName
accIDbalanceoDlimitaccName
0..
0..
getCustID()
1
getAccID()setBalance()getBalance()getAccDetail(
)withdraw(amo)
1..
getAccID()setBalance()getBalance()getAccDetail(
)withdraw(amo)
1..
1..
ATMCard
0..
0..
cardNopinstatus
ATMwdUI
getCardID()setPIN()getPIN()setStatus()getStatu
s()getAllAccDetail()
ATMwdCTRL
startUI()selectAcc()proAmount()
withdraw(cID)withdraw(aID,amo)
What next? Identify Super-Sub Aggregations
28Analysis Level Class Diagram (Ite-3)
ATMCustomer
1..
custID
1..
getCustID()
ATMSavings
ATMAccount
1
accIDbalanceaccName
1..
withdraw(amo)
ATMCard
getAccID()setBalance()getBalance()getAccDetail(
)withdraw(amo)
cardNopinstatus
0..
ATMCheque
1..
oDlimit
getCardID()setPIN()getPIN()setStatus()getStatu
s()getAllAccDetail()
withdraw(amo)
ATMwdCTRL
withdraw(cID)withdraw(aID,amo)
29Analysis Level Class Diagram (ver-2)
ATMCustomer
1..
custID
1..
getCustID()
ATMSavings
ATMAccount
ATMCustAcc
1
accIDbalanceaccName
withdraw(amo)
1..
getAccID()setBalance()getBalance()getAccDetail(
)withdraw(amo)
ATMCard
ATMCheque
cardNopinstatus
oDlimit
withdraw(amo)
getCardID()setPIN()getPIN()setStatus()getStatu
s()getAllAccDetail()
ATMwdCTRL
withdraw(cID)withdraw(aID,amo)
Which version is better, why?
30Sequence diagram
with entity objects only
Client
Card
Account
getAcc
Detail( )
getAllAccDetail()
withdraw(acc,am)
withdraw(am)
Use Case withdraw
31With Boundary Control Classes
Sequence diagram
Account
withdrawCtrl
Card
Client
withdrawUI
getAllAccDetails()
startUI()
getAccDetail()
selectAccount()
proAmount()
withdraw()
withdraw()
Issue Cash?
Use Case withdraw
32State Transitions
- Include relevant State Transition Diagrams (or
Activity Diagrams)
33Statechart
CARD
Card()
fixPIN()
OnUse
setStatus()
after 1 year
Card()
34Withdraw- 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?
35Structured 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?
36Activity Diagram- Withdraw
Get Account Details
more
NoOfAccounts 1
NoOfAccounts gt 1
A ? Only Account
List an Account details
no more
Get Users Choice (say A)
Get amount
amount gtA . balance
Result ? FALSE
amount lt A . balance
A.balance ? A.balance-amount Result ? TRUE
Issue Cash?