Class Diagram for the ATM System
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.
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. ATMCard also secures access through PIN verification.
Bank account
The BankAccount
class represents a user’s account at the bank. Two concrete types extend it: SavingAccount
and CurrentAccount
.
SavingAccount
: This derived class represents a saving account with a withdrawal limit.CurrentAccount
: This derived class represents a current/checking account with a withdrawal limit.
Bank
The Bank
class models a financial institution responsible for accounts and cards. It provides account validation and backend transaction processing. It also associates bank code and name with issued cards and accounts.
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 insertion of the card.Printer
: This class represents a printer that prints the transaction/withdrawal receipts for the user.