Users may view their balance or transfer or withdraw money using these cards.. • Enter a new card / new account detail • Block /Reactivate/Cancel a card • View the balance of the account
Trang 1ATM Case Study
A Discussion
Trang 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 balance+Odlimit) There is
no OD facility for a savings account.
Trang 3Case Study (cty)
The personal information of the customers and their account details are already maintained by the Bank’s main system A subsystem is required
to handle the ATM’s functionality Two hardware systems Card reader and Money dispenser will communicate with this subsystem The card
reader reads the Card’s 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
Trang 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
Trang 5Apply for Card
Assign Pin Finalise Card
:Card [Recorded]
:Card [Approved]
:Card [Finalised]
:Card [active]
Trang 7• ATM Card
• Withdraw
Trang 8-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 CARD’s validity
• Shall verify the PIN
• Shall use 3-DCS (168 bits) encoding
Trang 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
Trang 11Structures added
Trang 12add new account
add new card
fix PIN
Use Cases Card Manipulation
Client
Add structures
Trang 13add new account
add new card
fix PIN
Use Cases Card Manipulation
Client
Trang 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 user’s 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?
Trang 15Usecase Withdraw from Savings
Trang 16Description-Prototype Withdraw from Current
Trang 17ATM- Withdraw
System gets all accounts
Client selects Fast cash
Client Select One Account
Client selecetd withdraw
Displays all accounts [accounts>1]
Issue cash
Display message [amount > balance]
[Quit]
Trang 18Complete other Usecases!
Trang 19ATM ; E-R Diagram Classes (ITE-1)
ATMSavings
ATMCard
custID getCustID()
accID balance oDlimit
cardNo pin
status
getAccID() setBalance() getBalance()
For the time being there is
no need for an Association
Trang 20Realize Usecases
• Identify System’s Tasks
• Identify Collaborating Objects
• Draw Collobaration again
• Update Class diagram
Trang 21Withdraw 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 user’s 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 System’s Tasks
Identify Nouns
Trang 22System’s 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?
Trang 23Use case Realization!
withdraw Client
:Account :Card
withdraw
1
Identify Collaborations
Trang 24CRC - Allocate Responsibilities
Class Name Card
Provide Card information.
Class Name Account
Provide Account information.
Provide Withdrawal Provide list of Accounts. Account provides Account’s detail.
Trang 25Collaboration Diagram (Initial Idea)!
getAllAccDetail() 2 *getAccDetail()1
withdraw(acc,amm)
Trang 27ATMCustomer ATMChequeATMSavings
ATMCard
custID getCustID()
accID balance oDlimit accName
cardNo pin status
getAccID() setBalance() getBalance()
getAccDetail() withdraw(amo)
Trang 28Analysis Level Class Diagram (Ite-3)
ATMCustomer
ATMSavings
ATMCard
custID getCustID()
cardNo pin status
getAccDetail() withdraw(amo)
accID balance accName
1 *
Trang 29Analysis Level Class Diagram (ver-2)
ATMCustomer
ATMSavings
ATMCard
custID getCustID()
cardNo pin status
getAllAccDetail()
1 *
1 1 *
getAccDetail() withdraw(amo)
accID balance accName
1 *
ATMCustAcc
Trang 30with entity objects only
Use Case: withdraw
Trang 31With Boundary & Control Classes
*getAccDetail() :withdrawUI
:withdrawCtrl :Card :Account
Trang 32State Transitions
• Include relevant State Transition Diagrams (or Activity Diagrams)
Trang 34Withdraw- Operation Specification
Pre- and Post-condition Pair
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?
Trang 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
Trang 36Get Account Details [NoOfAccounts = 1]
[amount < =A balance]
A.balance A.balance-amount Result TRUE
List an Account details
A Only Account
Activity Diagram- Withdraw