✅ 1.
Use Case Diagram
🔷 Purpose:
This diagram shows the interactions between users (actors) and the functionalities (use cases) of
the ATM system. It helps identify what the system should do from the user's perspective.
🔷 Description:
• The primary actor is the Customer who interacts with the ATM.
• The ATM Machine serves as the interface between the customer and the Bank Server.
• Key use cases include:
• Insert Card: Start of the interaction.
• Authenticate User (PIN): The customer must enter the correct PIN.
• View Balance: To check current balance in an account.
• Withdraw Cash: Request cash from the account.
• Deposit Cash: Insert cash to credit the account.
• Transfer Funds: Send money to another account.
• Print Receipt: Optional transaction receipt.
• Eject Card: End of session.
Actors:
• Customer
• Bank Server (System)
• ATM Machine
Use Cases:
• Insert Card
• Authenticate User (PIN)
• View Balance
• Withdraw Cash
• Deposit Cash
• Transfer Funds
• Print Receipt
• Eject Card
+------------------+
| Customer |
+------------------+
/ \
/ \
+----+ +------------------+
|ATM | | Bank Server |
+----+ +------------------+
Customer --> Insert Card --> Authenticate PIN --> View Balance
| |
Withdraw Deposit
Transfer Print Receipt
|
Eject Card
🧠 Interpretation:
It provides a high-level functional overview, useful for identifying system requirements and actor
roles.
✅ 2. Class Diagram
🔷 Purpose:
It describes the static structure of the system by showing classes, their attributes and methods, and
relationships between classes.
🔷 Description:
• ATM: Central controller that communicates with other components.
• Customer: Has details like name and a card.
• Account: Represents user bank account with balance and number.
• Card: Contains information such as card number and expiry.
• BankServer: Performs operations like PIN validation, balance checking.
• Transaction: Represents operations like withdrawal, deposit, etc.
• CashDispenser: Responsible for dispensing cash.
• ReceiptPrinter: Prints a summary of the transaction.
Main Classes:
• ATM
• Customer
• Account
• Transaction
• BankServer
• Card
• CashDispenser
• ReceiptPrinter
Relationships:
• Customer has one or more Account
• ATM interacts with BankServer, Card, CashDispenser, ReceiptPrinter
• ATM initiates Transaction
+--------------+ +-------------+
| Customer |<>----- | Account |
+--------------+ +-------------+
| -name | | -balance |
| -card | | -accNumber |
+--------------+ +-------------+
| ^
| uses | belongs to
v |
+-----------+ +--------------+
| Card |-------->| BankServer |
+-----------+ +--------------+
| -cardNo | | -validatePIN |
| -expiry | | -getBalance |
+-----------+ +--------------+
+------------+ +------------------+
| ATM |------->| CashDispenser |
+------------+ +------------------+
| -location | | -dispenseCash() |
| -id | +------------------+
| -bank |
+------------+ +------------------+
| ReceiptPrinter |
+------------------+
+------------------+
| Transaction |
+------------------+
| -amount |
| -date |
| -type |
+------------------+
🧠 Interpretation:
This diagram models real-world objects involved in ATM operations and shows how they relate,
useful for developers during implementation.
✅ 3. Sequence Diagram (Withdraw Cash)
🔷 Purpose:
Describes how objects interact over time to complete a specific task, such as withdrawing cash.
🔷 Description (Withdraw Cash):
1. Customer inserts card into ATM.
2. ATM asks for PIN, then sends it to BankServer for validation.
3. If PIN is valid, ATM asks for amount to withdraw.
4. ATM sends a debit request to BankServer.
5. On success, ATM commands CashDispenser to dispense money.
6. ATM then instructs ReceiptPrinter to print a receipt.
7. Finally, ATM ejects the card and ends the session.
Participants: Customer → ATM → BankServer → CashDispenser
Customer ATM BankServer CashDispenser
| | | |
| InsertCard|--------------->| |
| EnterPIN | validatePIN() |
|-----------|--------------->| |
| |<--------------| Valid/Invalid |
| Request Withdraw | |
|-----------|--------------->| debitAccount()|
| |<--------------| success/fail |
| |-----> dispenseCash()---------->|
| |<-------------------------------|
| |-----> printReceipt() |
| EjectCard | |
🧠 Interpretation:
This diagram helps in understanding how the system components interact dynamically,
especially during critical use cases.
✅ 4. Activity Diagram (Withdraw Cash)
🔷 Purpose:
Shows the flow of activities and decisions for a process—in this case, withdrawing money.
🔷 Description:
1. Customer inserts card and enters PIN.
2. System validates PIN.
• If invalid, shows an error and ejects the card.
3. If valid, user chooses the Withdraw option.
4. System asks for the amount.
5. System checks account balance.
6. If sufficient, it dispenses cash and prints receipt.
7. Finally, card is ejected and session ends.
+----------------------+
| Start |
+----------------------+
|
v
+----------------------+
| Insert ATM Card |
+----------------------+
|
v
+----------------------+
| Enter PIN |
+----------------------+
|
v
+----------------------+
| Validate PIN |
+----------------------+
| Yes | No
v v
+----------------+ +-----------------+
| Select Service | | Show Error Msg |
+----------------+ +-----------------+
| |
v v
+----------------+ +-----------+
| Withdraw Cash | | Eject Card|
+----------------+ +-----------+
|
v
+---------------------+
| Enter Amount |
+---------------------+
|
v
+---------------------+
| Check Balance |
+---------------------+
|
v
+---------------------+
| Dispense Cash |
+---------------------+
|
v
+---------------------+
| Print Receipt |
+---------------------+
|
v
+---------------------+
| Eject Card |
+---------------------+
|
v
+---------------------+
| End |
+---------------------+