Lesson 17: OOP Principles, Part II (Slides)
Please review the following resources before lecture:
- Object-oriented Programming in 7 minutes | Mosh (Video)
- Naming Convention In Java Tutorial #77 (Video)
- Naming Conventions - Oracle (Article)
- Test-Driven Development (TDD): A Time-Tested Recipe for Quality Software (Article)
- Complete Applying SOLID principles exercise.
- Review OOP Project documentation and complete user stories.
Your task for this assignment is add enhancements to an ATM simulator. The BankAtm is at the center of the model, allowing us to add one or more CheckingAccount instances and make withdrawals or deposits via cash or check. You will need to implement at least two of the following functional enhancements to the BankAtm class WITHOUT adding a new method. Note that you can update existing methods, however.
- We want to support a
SavingsAccountthat works just like theCheckingAccount, but doesn't allow you to write checks against the account. - We want the
BankAtmclass to support the concept of aBusinessCheckingAccount. A business account requires that at least one of the owning accounts is a business. - In addition to supporting checks and cash, we also want to support the concept of another monetary instrument called a
MoneyOrder. Unlike aCheck, aMoneyOrderwithdraws funds from a source account immediately on creation for the purposes of this simulation.. - For traceability, all of the transactions in the
BankAtmclass should logged. Create anAuditLogclass that keeps a record of all debits and credits to any account and integrate it with theBankAtmclass. For thedepositFundsmethod that accepts a cash amount, we'd like the ability to deposit funds in a variety of currencies. Add a parameter that accepts a currency type and a new object that encapsulates the currency converter logic for converting a cash amount to the account currency type.
- You must integrate new features into the
BankAtmwithout adding a new public method. Existing public methods may be modified without breaking existing functionality. - You must update the
BankAtmtests and may modify or add other applicable tests. - Feel free to add the minimal number of classes, interfaces, or abstract classes needed to fulfill each requirement.
- You must update existing javadocs and may add new documentation for new types and methods you introduce.