Use Case – Customer withdraws cash from Teller (or ATM machine) by filling out a withdrawal slip (or form on ATM machine)
Use Case – Customer withdraws cash from Teller (or ATM machine) by filling out a withdrawal slip (or form on ATM machine).
Problem Statement:
1. Design the system so that the ‘Balance returned’ can be changed from int to double at a later date without breaking the system.
2. Design the system so that the ‘Currency’ can be changed from ‘Lira’ to ‘Euro’ at a later date.
3. The ‘pin’ used for authentication(4-digits) needs to be changed to accommodate 5 digits.
Step 1 – Identify the main entities
- BankRecord (contains all the customer details and account info)
- BankTeller (interacts with BankRecord and BankManager)
- BankManager (authorizes transaction)
- WithdrawalSlip (encapsulates all the financial info)
Each of these gets modeled as an object in a true OO design. Some of the objects would use composition – for example the BankRecord object would be composed of the Customer object and the Account object.
Solution
1. The WithdrawalSlip class encapsulates all the ‘Money’ related info – including currency.
2. The BankRecord encapsulates the Authorization method
Leave a Reply