E N D
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 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.
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.
Client Clerk Manager :Card :Card :Card :Card Apply for Card [active] [Finalised] [Approved] [Recorded] Record Detail Approve Finalise Card Receive Card Assign Pin A Business Activity Diagram Applying for New Card
Client arrives at ATM A BusinessActivity Diagram [CARD valid] Insert Card [CARD valid] Give PIN [PIN OK] [PIN OK] [Quit] Select Service [withdraw] Eject Card Withdraw View Balance ClientTransaction Client leaves 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 CARD’s 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 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?
Prototype Withdraw from Current Select A Service • Withdraw • View Balance • Transfer Select An Account • Cheque • Savings (House) • Credit Suceess Take Your Money Another Transaction? Get Your Card? Give An Amount OK OK OK
Client selecetd withdraw ATM- 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 amount Client selects Fast cash Display message 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 ATMCustomer 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()getStatus() 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 ?
Realize Usecases • Identify System’s 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 Identify System’s 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 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 Nouns
(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?) System’s Tasks Identified How to allocate these tasks to different classes?
:Account :Card Use case Realization! Identify Collaborations 1 withdraw Client withdraw 2
CRC - Allocate Responsibilities Class Name Card Responsibilities Collaborations Provide Card information. Account provides Account’s detail. Provide list of Accounts. Class Name Account Responsibilities Collaborations Provide Accountinformation. Provide Withdrawal
::Card ::Account Collaboration Diagram (Initial Idea)! 2 1 *getAccDetail() getAllAccDetail() 4 withdraw(amm) 3 withdraw(acc,amm) Client
::withdrawCtrl ::withdrawUI ::Card ::Cheque withdraw(cID) 2 3 selectAccount startUI() 5.1 withdraw(am) 4 5 proAmount withdraw(acc,am) Client getAllAccDetail() 1 1.1 *getAccDetail() Collaboration Diagram, with UI and CTRL objects! 0 Issue Cash?
Analysis Level Class Diagram : Ite-2 ATMSavings ATMCustomer 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()getStatus()getAllAccDetail() ATMwdCTRL startUI();selectAcc();proAmount(); withdraw(cID)withdraw(aID,amo) What next? Identify Super-Sub & Aggregations
ATMwdUI startUI();selectAcc();proAmount(); Analysis 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()getStatus()getAllAccDetail() withdraw(amo) ATMwdCTRL withdraw(cID)withdraw(aID,amo)
ATMwdUI startUI();selectAcc();proAmount(); Analysis 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()getStatus()getAllAccDetail() ATMwdCTRL withdraw(cID)withdraw(aID,amo) Which version is better, why?
Sequence diagram with entity objects only Client :Card :Account Detail( ) *getAcc getAllAccDetail() withdraw(acc,am) withdraw(am) Use Case:withdraw
With Boundary & Control Classes Sequence diagram :Account :withdrawCtrl :Card Client :withdrawUI *getAllAccDetails() startUI() *getAccDetail() selectAccount() proAmount() withdraw() withdraw() Issue Cash? Use Case:withdraw
State Transitions • Include relevant State Transition Diagrams (or Activity Diagrams)
Blocked Lapsed Pending OnUse Active CARD Statechart Card() fixPIN() OnUse setStatus() after [1 year] ~Card()
Withdraw- Operation Specification Pre- and Post-condition Pair pre-conditions: CARD is valid ACCOUNT is valid ACCOUNT is associated with CARD amountis 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 Only Account List an Account details [no more] Get User’s Choice (say A) Get amount [amount >A . balance] Result FALSE [amount < =A . balance] A.balance A.balance-amount Result TRUE Issue Cash?