This is a project that aims to create a user-friendly money tracking application. The program allows users to manage their finances by recording transactions, categorizing expenses.
- Record transactions: Users can log daily expenses, deposits, or withdrawals.
- Categorize expenses: Transactions can be categorized based on type (e.g., groceries, entertainment, bills).
- Analyze spending patterns: The program provides insights into where the user's money is going, helping them make informed financial decisions.
Functionality
- AbstractAccountBuilder.cs: This class serves as a base for all account builders. It provides methods for setting an account name, account ID, and building the final account object.
- BankAccountBuilder.cs: This class inherits from
AbstractAccountBuilder
and overrides theBuild()
method to create a bank account. It also provides a static methodEmpty()
to create a new instance of the builder. - PersonAccountBuilder.cs: Similar to
BankAccountBuilder
, this class creates a person account by overriding theBuild()
method. This account type is meant to track loans, eg a person is loaning money from you. - TransactionBuilder.cs: This class demonstrates how to build transactions using the Builder pattern. It allows setting an account ID, transaction date, and building the final transaction object.
Builder Pattern
The Builder pattern is used extensively throughout the program. It separates the construction of a complex object from its representation, allowing for more flexibility and easier maintenance.
- Step-by-Step Construction: The builder classes provide methods to set individual properties (e.g., account name, ID) in a step-by-step manner.
- Fluent Interface: The builders use a fluent interface to allow chaining method calls, making the code more readable and concise.
- Final Product: The
Build()
method returns the final constructed object.
To use this project, clone it from the GitHub repository and follow the installation instructions provided in the README.md file.
- Clone the repository:
git clone https://github.com/PMC/MoneyTracker.git
- Navigate to the project directory:
cd MoneyTracker
- Install dependencies using dotnet CLI:
dotnet restore
After installing the necessary dependencies, you can run the program from the command line using dotnet run
.