Overview
1. Project Background and Description
Club Hub is a desktop address book application designed for University interest group/club leaders as its primary users. This application aims to help these leaders better manage their members, finances, calendar, and inventory. The user interacts with the program using a Command Line Interface (CLI), and it has a Graphic User Interface (GUI) created with JavaFX. It is written in Java and has about 10 thousand lines of codes. |
2. Summary of Contributions
Function 1: adding or removing a ledger record.What it does: allows the user to easily add and remove ledgers according to the date in the format [DD/MM]. Justification: This function improves the management of finances in the club by allowing records to be add and removed via the date, to ensure maximum clarity and unambiguity when it comes to recording finances. Function 2: crediting or debiting balance from a ledger record.What it does: allows the user to credit or debit the amount on a specific date. Justification: This function improves the product significantly because a user can easily update their spending on a specific date or their contributions to the club with just one line of command. In addition, working directly with dates instead of indexes ensures maximum clarity in managing the finances. Highlights: This enhancement affects and manipulates existing data stored in the memory. It required an in-depth analysis of design considerations to allow mathematical operations to be performed on data stored in memory. The implementation too was challenging as it required comparison of string to find matching dates instead of simply extracting indexes as mentioned in the description for function 2. |
3. Code Contributed
Code: [Functional Code] To see more details of the code, extracts from the project’s developer and user guide are included below: 3.1 The User Guide shown here provides details on how the commands are used on the client’s side.
3.1.1 Accounts:The Club Account features a ledger column to record the spending of the club on any date in the form of DD/MM. There are 4 basic commands allowing the user to add or delete a ledger, and to credit or debit money from any date in the list of records.
3.1.2 Adding a ledger: addLedgerAdds a ledger to the ledger column. Format:
Example:
3.1.3 Deleting a ledger: deleteLedgerDeletes a ledger from the log. Format:
Example:
3.1.4 Crediting a ledger: creditIncrease the balance of a ledger on a date indicated. Format:
Example:
3.1.5 Debiting a ledger: creditDecrease the balance of a ledger on a date indicated. Format:
Example: 3.2 The Developer Guide shown here provides details on how the commands are implemented on the developers’ side.
3.2.1 LedgerAs of v1.3, the core commands dealing with Ledgers are addLedger, deleteLedger, credit and debit. In addition, the common commands such as undo and redo apply to manipulating the data in the Ledger.
Bugs: 1. Wrong exception thrown when not entering the correct value for balance fir credit and debit 2. Balance in ledgers not displaying '$' symbol and 2 decimal places for cents at the front of the amount of money.
3.2.2 Add/Remove Ledger featureCurrent Implementation The add/remove mechanism is facilitated by VersionedAddressBook. It extends AddressBook with an AddLedger and RemoveLedger method.
AddressBook#addLedger() — Adds a ledger object to the UniqueLedgerList.
AddressBook#removeLedger() — Removes a ledger object from the UniqueLedgerList.
These operations are exposed in the Model interface as Model#addLedger and Model#deleteLedger respectively.
Below is a scenario of how a user adds a ledger into the club book.
Step 1. The user inputs the command addLedger /d [date] /b [balance] into the command box.
Step 2. The commandBox ui will then create a Logic object which parses the command to ascertain that it is an addLedger command.
Step 3. The AddressBookParser will then parse the command to create a new addLedgerParser object.
Step 4. This addLedgerParser will parser the arguments of the command line and create a new AddLedger object.
Step 5. This will then be put into the model, into the versioned address book.
The Ledger class creates an object that instantiates a DateLedger object and an Account object. The multiple Ledger objects created will be stored in a UniqueLedgerList, where the uniqueness of every ledger is in its date.
This uniqueness is attained by comparing the DateLedger object in the ledger to be added and the ledgers already in the UniqueLedgerList using the getDateLedger() method in Ledger.
Perhaps instead of using a for loop to loop through the entire UniqueLedgerList, one could implement a more efficient method of finding duplicates while maintaining the function of searching using objects instead of index.
Remove Ledger uses the same concept ut instead starts with looking for the Ledger in the UniqueLedgerList instead.
3.2.3 Credit/Debit featureThe Credit/Debit mechanism is facilitated by CreditCommand and DebitCommand. They extend Command by overriding and implementing the execute method.
The unique way of implementing this feature is that instead of crediting or debiting the ledgers in the list using the index, we can directly perform these operations on the dates themselves.
This is done by implementing a for loop to loop through the UniqueLedgerList to get the date of the ledgers in the list, comparing them to find one to edit. |
4. Other Contributions
Technical LeadershipProvided technical guidance for the team, including debugging and implementing larger features. Project Management
|
5. Future Implementation
Future implementation includes
|