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

  1. BankRecord (contains all the customer details and account info)
  2. BankTeller (interacts with BankRecord and BankManager)
  3. BankManager (authorizes transaction)
  4. 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

Specializing in high volume web and cloud application architecture, Anuj Varma’s customer base includes Fortune 100 companies (dell.com, British Petroleum, Schlumberger).
Anuj also offers a 1-day ‘technology crash course’ focused on cloud technologies for executives.
For Anuj’s specialized one-on-one executive seminars, visit ExecutiveTechnologySeminars
All content on this site is original and owned by anujvarma.com.

Anuj Varma – who has written posts on Anuj Varma, Technology Architect.


Leave a Reply

Your email address will not be published. Required fields are marked *