This CLI application simulates a simple banking management terminal.
Note that this app is designed to be used for managing the services of an imaginary bank (let's call it PAO Bank) and not to be used by a customer of a bank, therefore not having an Authentication functionality.
Done
System with
- at least 10 actions/ queries that can be made;
- at least 8 types of objects.
To implement:
- classes having private/ protected data members & access methods.
- at least 2 distinct collections (I used List/ArrayList and TreeSet) for managing the objects defined previously (e.g. List, Set, Map, etc.) - and at least 1 sorted (TreeSet).
- use inheritance.
- at least 1 service class exposing the actions.
- 1 Main class - making calls to the services.
Done
Done
- package accounts
- abstract class Account
- class CheckingAccount
- class SavingsAccount
- class AccountFactory
- abstract class Account
- package card
- class Card
- package atm
- class Atm
- abstract class AtmTransaction
- class Deposit
- class Withdrawal
- package transfer
- class Transfer
- package Utils
- class Address
- class RandomGenerator
- package services
- class ClientService
- class AccountService
- class TransactionService
- class AtmService
- class BankingInteractor
- class Main (uses class BankingService)
The withdrawal function should only work if the bank account has enough money to withdraw a requested amount.
Thoughts:
- Builder pattern?
- use interfaces for services
- Add currency class?
- Generate a UML?
Later on:
- JUnit testing - mocking / test doubles
Notes
- Date is obsolete. LocalDateTime/ LocalDateTime has been used. See useful article
- I chose to not implement a class with constants or declare all constants as static final, but instead, I used enums. useful article
- Used
BigDecimal
for balance/ other money related variables instead of double - because floating point values are not precise.