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

Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.