...

/

Untitled Masterpiece

Learn to create a class diagram for the ATM design using the bottom-up approach.

In this lesson, we’ll design the classes and then identify the relationship between classes according to the requirements for the ATM design problem.

Components of the ATM system

As mentioned earlier, we’ll design the class diagram for the ATM using a bottom-up approach.

User

The User class models a bank customer who uses the ATM. It holds the user’s ATMCard and associated BankAccount and initiates ATM sessions and transactions.

The User class
The User class
Click to see the relevant requirement

ATM card

The ATMCard class encapsulates the details required for card-based authentication and authorization. It uniquely identifies a user’s bank card for ATM operations and secures access through PIN verification.

The ATMCard class
The ATMCard class
Click to see the relevant requirement

Bank account

The BankAccount class represents a user’s bank account. Two concrete types extend it: SavingAccount and CurrentAccount.

  • SavingAccount: This derived class represents a savings account with a withdrawal limit.

  • CurrentAccount: This derived class represents a current/checking account with a withdrawal limit.

BankAccount and its derived classes
BankAccount and its derived classes
Click to see the relevant requirements

Bank

The Bank class models a financial institution responsible for accounts and cards. It provides account validation and backend transaction processing, and associates the bank code and name with issued cards and accounts.

The Bank class
The Bank class
Click to see the relevant requirement

Card reader, cash dispenser, keypad, screen, and printer

  • CardReader: This class accepts or rejects a card.

  • CashDispenser: This class provides the required amount specified by the user in cash.

  • Keypad: This class allows the user to enter the PIN.

  • Screen: This class represents a screen that displays information upon card insertion.

  • Printer: This class represents a printer that prints the transaction/withdrawal receipts for the user.

The class diagram of the Keypad, CashDispenser, CardReader, Screen, and Printer classes
The class diagram of the Keypad, CashDispenser, CardReader, Screen, and Printer classes
Click to see the relevant requirements
...