In this project, you will design and implement a simple banking system. The main objectives are to apply the principles of encapsulation using getters and setters and to simplify the system interactions using the facade pattern. This will not only help in managing the complexities but also in protecting the data integrity of the banking operations.
For this task we will look at combining the "Requirements Definition" and "Determining Specifications" steps. Remember the former is "what" and the latter is "how", so we will create a table that represents this. Listen to Travis below, he has a program he wants you to build. If you're still not sure afterwards, you can chat with him using the chatbot below.
📖 Afterwards, write down at least five requirements into your workbook, in plain-English, that you think Travis wants you to include in the program. These should be ordered from highest priority (essential features) to lowest priority (nice to haves).
In the second column (specifications), write down how you think you will implement those requirements.
Design the full UML Class Diagram for your banking system. Include the relationship between the Bank and Accounts, as well as the inheritance from a base Account class to two derived classes.
The diagram on the right shows how class diagrams are officially specified in this course, and how you can expect to see them in the exam.
If you would like to add further detail to yours you may also add the '-' and '+' prefixes to further define private and public attributes and methods.
Accept this Assignment: Project 13 - Banking System
Write your code with attention to the OOP design principles you've learned in the past two projects:
Classes & Objects
Attributes & Methods
Generalisation, Inheritance, Polymorphism
Encapsulation: Ensure all data within the Account class is private and only accessible through public methods (getters and setters). This will protect the integrity of the data.
Facade Pattern: Use the BankManager class to handle all interactions with accounts. The outside world (in this case, the main.py script) should only interact with the BankManager and not directly with the Account objects. This will simplify the operations on the client side (user interface).
Data Validation: Make sure to include checks for valid deposits, withdrawals, and transfers (e.g., non-negative amounts, sufficient balance for withdrawals and transfers).
account.py
- Structure your base and derived account classes here
bank.py
- Structure your Bank Manager facade here
main.py
- This will be your main program file where an instance of BankManager will be used through an intuitive user interface
Unit testing involves isolating and testing individual components of a software system to ensure that each part functions correctly on its own.Â
In our banking system, unit testing might involve verifying that the Account class correctly handles methods like deposit() and withdraw(), ensuring each function performs as expected independently.
Subsystem testing examines the interactions between groups of related units to verify that they work together as intended within the larger system.Â
In our banking system, subsystem testing might involve checking how the BankManager class interacts with multiple Account instances to execute operations like transferring funds between accounts, ensuring that these inter-object interactions behave correctly.
Maintenance is a critical part of software development that involves ensuring the software continues to operate correctly over time and is understandable to others or your future self. Here are three key practices that you should implement during this program:
Commit your changes to the repository after every significant update or at the end of each work session. Each commit should have a clear, concise message that describes what was changed and why
Use comments to explain the purpose of complex code blocks, the reasoning behind critical decisions, and the functionality of methods and classes. Comments should be concise and relevant
Use clear, descriptive names for all methods, classes, and attributes. Choose names that reflect the role and functionality of each element. Avoid generic names like data or info, and instead use names that describe what the data or method pertains to.
I encourage you to use this multiple times to get feedback on how you can improve the program.Â