2.9. UML Class Diagram

@startuml
class Bank {
- name
- bic
- swift
- atms
+ manages()
+ maintains()
}
class Customer {
- firstname
- lastname
- birthdate
+ login()
+ logout()
}
class Address {
- street
- city
- postcode
- country
}
class Card {
# customer
# number
# cvv
# expiration
# pin
+ change_pin()
- create_transaction()
}
class CreditCard {
- limit
- interest_rate
}
class DebitCard
class ATM {
- address
+ check_balance()
+ withdraw()
- create_transaction()
}
class Transaction {
- id
- date
- type
- amount
+ create()
+ commit()
+ rollback()
}
class Account {
# number
# iban
# balance
+ deposit()
# create_transaction()
}
class CurrentAccount {
+ withdraw()
+ transfer()
}
class SavingAccount {
- interest_rate
+ yield_interest()
}
Bank *-- Address
Bank o-- ATM : "0...*"
Bank o-- Account : "0...*"
ATM *-- Address
Customer o-- Account : "1...*"
Customer *-- Address
Account o-- Card : "0...*"
Account <|-- CurrentAccount
Account <|-- SavingAccount
Transaction <.right. ATM
Transaction <.. Account
Transaction <.. Card
Card <|-- CreditCard
Card <|-- DebitCard
@enduml
from decimal import Decimal
from datetime import date, datetime
class Address:
street: str
city: str
postcode: str
country: str
class Bank:
name: str
bic: str
swift: str
address: Address
def manages(self): ...
def maintains(self): ...
class Customer:
firstname: str
lastname: str
birthdate: date
address: Address
def login(self): ...
def logout(self): ...
class Card:
customer: Customer
number: int
cvv: int
expiration: date
pin: int
def change_pin(self): ...
def create_transaction(self): ...
class CreditCard(Card):
limit: Decimal
interest_rate: float
class DebitCard(Card):
pass
class ATM:
bank: Bank
address: Address
def check_balance(self): ...
def withdraw(self): ...
def create_transaction(self): ...
class Transaction:
id: str
date: datetime
type: str
amount: Decimal
def create(self): ...
def commit(self): ...
def rollback(self): ...
class Account:
number: int
iban: str
balance: Decimal
def deposit(self): ...
def create_transaction(self): ...
class CurrentAccount:
def withdraw(self): ...
def transfer(self): ...
class SavingAccount:
interest_rate: float
def yield_interest(self): ...
2.9.1. Use Case - 1
Boxes and Arrows

2.9.2. Use Case - 2

2.9.3. Use Case - 3

2.9.4. Use Case - 4

2.9.5. Use Case - 5

2.9.6. Use Case - 6

2.9.7. Use Case - 7

2.9.8. Use Case - 8

2.9.9. Use Case - 9

2.9.10. Use Case - 10
