abc-bank
abc-bank copied to clipboard
abc bank solution
Separate accountType concerns from Account to it's own concrete implementations such as CheckingAccount, SavingAccount, MaxiSavingAccount. Make deposit, withdraw, and transfer functionality thread safe. Fix issues in DataProvider to make it singleton. Make Account class immutable such that it doesn't leak it's state to the outside world unintentionally. deposit(), withdraw(), transfer() change state in a controlled manner which is intentional. Use BigDecimal instead of double for accuracy since we are dealing with money.