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 represents a user with an ATM card and a bank account.
ATM card
The ATMCard
class is identified by the card number, customer name, expiration date, and the user's PIN.
Bank account
BankAccount
is a parent class with two types: SavingAccount
and CurrentAccount
. These classes are derived from the BankAccount
class. This class stores the account number, total balance, and the user's available balance.
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 represents a bank with a name and a bank code. A bank may or may not have an ATM.
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.
...
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.