Overview
This Project Portfolio shows my contributions to the technical aspects and documentations of the project LIFE.
Project
LIFE - LifeStyle Improvement For Everyone
About the Project
This is a project based on the software engineering course CS2113T, and my team and I were tasked to enhance a basic addressbook
application.
The result was this desktop application called LIFE.
LIFE is an application meant to provide a comprehensive platform for all users to record their tasks, manage their expenditure, record their workout routines and to track their desired habits.
Features in LIFE include:
-
Task List
-
Expenditure List
-
Workout Tracker
-
Habit Tracker
Below is a screenshot of the user interface of the project, LIFE.
My Role
My main role in the team is to implement the Expenditure List feature.
In addition, I did necessary additions to the user guide and developer guide to ensure users can navigate around the application comfortably,
as well as to ensure incoming developers can adjust accordingly to the style of the project.
The following sections clearly illustrates my contributions to the enhancement of the project and the relevant documentations.
Summary of Contributions
This section presents a summary of the different contributions I did to the project, in terms of the implementation of codes for the Expenditure List feature, and also the relevant documentations in the user guide and developer guide.
-
Implementation of the
Expenditure List
feature.-
Purpose:
To aid people in managing their expenditure by providing a consolidated list of purchases with their corresponding prices, complemented with tags to categorise each purchase -
Functions available:
-
AddPurchase
function to add a new purchase, with its price and tag (category) to the list -
ClearExpList
function to clear the expenditure list and start with a new list with better management
-
-
-
Morphing of AddressBook into LIFE
-
Refactored classes of AddressBook into Contact List, as a sub-feature of LIFE
-
-
Project Management
-
Assisted in managing the team repository in terms of constant updates of issues and milestones, to ensure that the project stays on track with its functionality and timeline
-
Managed the release of v1.4
-
-
Documentation
-
Managed [README.adoc], on the main page of the team repository
-
Updates of different parts of User Guide and Developer Guide to ensure proper documentation of project
-
This link shows a rough estimation of the amount of contribution I have made. [Reposense] |
Contributions to User Guide
This section presents the various contributions I have committed to the team in terms of the User Guide, demonstrating my understanding of the project towards the target users.
Expenditure List
A list to help you keep track of all your expenses so that you can better manage your finances!
Adding a purchase: addpurchase
Adds a new purchase to the expenditure list
Format: addpurchase n/NAME pr/PRICE [t/TAG]…
Examples:
-
addpurchase pn/Ice cream pr/1.50
-
addpurchase pn/Bicycle rental pr/10.00 t/family t/eastcoastpark
Clearing expenditure list: clearexplist
Clears all past purchases recorded from the expenditure list.
Format: clearexplist
Listing all past expenditures: explist
Shows a list of all recorded purchases with the corresponding price in the expenditure list.
Format: explist
Deleting a purchase: deletepurchase
[coming in v2.0]
Deletes an existing purchase in the expenditure list.
Format: deletepurchase INDEX
Example:
-
explist
deletepurchase 2
Deletes the 2nd purchase in the expenditure list.
Calculating total expenditure for the day: totalexpday
[coming in v2.0]
Views total expenditure for the day
Format: totalexpday DATE
Example:
totalexpday 191218
Set spending limit: setlimit
[coming in v2.0]
Sets a spending limit for one day to control expenditure.
Format: setlimit VALUE
Example:
setlimit 20.00
Command Summary
This section provides a quick summary of the existing commands in the LIFE application, for easier reference.
General Commands
General commands for easier navigability within the application.
Function | Purpose | Command | Example |
---|---|---|---|
Shows you the user guide for reference in app |
|
|
|
Shows you a history of all commands used |
|
|
|
Undo your previous command [currently only available for contact list commands] |
|
|
|
Redo your undo [currently only available for contact list commands] |
|
|
Task List Commands
Commands to help you maximise utility of Task List:
Function | Purpose | Command | Example |
---|---|---|---|
Adds a new task |
|
|
|
Deletes a task off the task list |
|
|
|
Edits the task specified with the entered parameters |
|
|
|
Shows that a task has been completed |
|
|
|
Sorts the task list according to the deadline of each task |
|
|
Expenditure List Commands
Commands to help you use the expenditure list to manage your expenses:
Function | Purpose | Command | Example |
---|---|---|---|
Adds a new purchase |
|
|
|
Clears the existing expenditure list |
|
|
|
Shows list of purchases with the price |
|
|
Workout Tracker Commands
Commands to help you utilise the workout book:
Function | Purpose | Command | Example |
---|---|---|---|
Views the past 5 most recent workout |
|
|
|
Records a new workout and add into existing workout records |
|
|
Habit Tracker Commands
Commands to help you navigate about the habit list:
Function | Purpose | Command | Example |
---|---|---|---|
Adds a newly desired habit |
|
|
Contact List Commands
Commands to help you use the Contact List:
Function | Purpose | Command | Example |
---|---|---|---|
Adds a new person |
|
|
|
Shows all the people in the contact list |
|
|
|
Edits the contact details specified with the entered parameters |
|
|
|
Deletes a person off the contact list |
|
|
|
Finds and then show the people with names containing the keywords entered |
|
|
|
Selects a specified person |
|
|
Contributions to Developer Guide
This section shows the various contributions I have made to the team in terms of the Developer Guide.
This showcases my ability to do the necessary technical documentations and understanding of the project.
UI component
API : Ui.java
The UI consists of a MainWindow
that is made up of parts e.g.CommandBox
, ResultDisplay
, TaskListPanel
, PurchaseListPanel
, StatusBarFooter
, BrowserPanel
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class.
The UI
component uses JavaFx UI framework. The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder. For example, the layout of the MainWindow
is specified in MainWindow.fxml
The UI
component,
-
Executes user commands using the
Logic
component. -
Listens for changes to
Model
data so that the UI can be updated with the modified data.
The Model
,
-
stores a
UserPref
object that represents the user’s preferences. -
stores the LIFE application data.
-
exposes an unmodifiable
ObservableList<Purchase>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. -
exposes an unmodifiable
ObservableList<Task>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.
(There existsObservableList<Workout>
,ObservableList<Habit>
andObservableList<Person>
as well) -
does not depend on any of the other three components.
As a more OOP model, we can store a Tag list in Expenditure List , which Purchase can reference. This would allow Expenditure List to only require one Tag object per unique Tag , instead of each Purchase needing their own Tag object. An example of how such a model may look like is given below.(This goes the same for each Task , Workout , Habit and Person )
|
Storage component
API : Storage.java
The Storage
component,
-
can save
UserPref
objects in json format and read it back. -
can save the LIFE application data in json format and read it back.
Expenditure List Feature
This section describes the technical aspects of the Expenditure List
feature and the design considerations made for the feature.
Purchase
package
This section describes the inner dimensions of the Purchase
package.
Reason for implementation
LIFE is also a tool for helping students manage their finances and spendings, therefore it is important to have a feature to help them record their expenditure regularly.
Current Implementation
Each attribute of a Purchase, the purchase name and price are classes in the Purchase
package. Each class provides utility methods to check the correctness of the string to be stored and to retrieve the string that is stored.
The following classes are as such:
Class | Constructor | Remark |
---|---|---|
PurchaseName |
new PurchaseName("Ice cream") |
Stores a |
Price |
new Price("1.50") |
Stores a |
Tag |
new Tag() |
Stores a |
The purchase
package includes the Purchase
class which documents information about the a purchase. The Purchase
class provided utility methods to retrieve the different objects (e.g. Price
)
Class | Constructor | Remark |
---|---|---|
Purchase |
|
Stores |
Reasons for how it is implemented
Similar to the task
package, the purchase
package follows the model of the person
package in the Addressbook.
This made it easier for us to implement our features as we could follow the style of how the person
package was implemented, at the same time improving the modularity and organization.
Model
The ExpenditureList
is a separate feature as well, being one of the four features in the LIFE application.
Likewise, this would allow future enhancement of this ExpenditureList
to be built on with additional features such as finding a particular purchase without affecting the
other features due to the low coupling other features have with this feature.
The following is a model diagram of the ExpenditureList
component.
ExpenditureList
.
Add Purchase
The AddPurchaseCommand
will create an instance of the Purchase
class and store it in the ExpenditureList
Reason for implementation
To be able to track expenditure, students should be able to add the purchases bought, together with the prices.
Current Implementation
The AddPurchaseCommand
is created when the command word addPurchase
and the corresponding compulsory parameters are detected in the user input. Through the AddPurchaseCommand
, the user input will then be split into its separate components(e.g. PurchaseName
, Price
, Tag
) through ParserUtil
, creating a Purchase
instance and pass it from the logic
component to the model
component.
Given below is an example usage scenario and how the addpurchase
mechanism behaves at each step.
Step 1. The user launches the application for the first time. LIFE will initialize with the initial expenditure list state and the currentStatePointer pointing to that single purchase list state.
Step 2. The user executes the addpurchase
command with addpurchase pn/chickenrice pr/3.50
Step 3. This command goes through the AddPurchaseCommandParser to extract the values of the input string and to process it. It also searches for invalid input.
Step 4. Once valid, it passes the Purchase from the logic component to the model component into an ArrayList called ExpenditureList.
The following sequence diagram illustrates how the addpurchase
operation works.
Model
Given below is an example usage scenario and how the add mechanism behaves at each step.
Step 1. The user launches the application for the first time. LIFE will initialize with the initial expenditure list state.
Step 2. The user executes the addPurchase
command with addpurchase pn/Ice Cream pr/1.50
Step 3. This command goes through the AddPurchaseCommandParser
to extract the values of the input string and to process it. It also identifies invalid input.
Step 4. Once valid, it passes the purchase from the logic
component to the model
component into an ArrayList called ExpenditureList.
The following activity diagram illustrates an example with a user executing the addpurchase
command.
addpurchase
command
Clear Expenditure List
The ClearExpList
command will clear all the existing data shown in the expenditure list.
Reason for implementation
The Expenditure List is not just a platform to record spendings, it is also a feature to help manage finances. Hence, every week the list can be cleared to reset the data for the user to start over and better plan the spendings the following week.
Current implementation
The ClearExpList
command is called when the command word clearexplist
is detected in the user input. Through the CleapExpList
command, an empty expenditure list model will be set and committed as the new expenditure list.
Given below is an example usage scenario and how the ClearExpList
mechanism behaves at each step.
Step 1. The user has previously added purchases into the expenditure list. The current list is populated with one or more purchases with the corresponding prices.
Step 2. The user executes the clearexplist
command.
Step 3. resetData
method in ExpenditureList
class is used to reset the data in the expenditure list into a new clean slate.
Alternatives considered
-
Alternative 1 (current choice): Create a new Array List Object to store the purchases e.g.
purchaselist
.-
Pros: Using this simple data structure allows for manipulation of data such as sorting. Like how the existing
UniquePersonList
was implemented, we can implement thisPurchaseList
in the same way. Standardizing this format will also make the overall code more readable and the implementation to be much simpler. -
Cons: Some possible future operations may require the traversing of the list which require O(N) time complexity. For instance, a
findpurchase
command.
-
-
Alternative 2: Using a Hash Map to store the purchases
-
Pros: Future possible operations like
findpurchase
can be executed with O(1) time complexity. -
Cons: Implementation of Hash Map is a lot more complex than the implemented Array List, which our team currently lacks the expertise to implement.
-
Use Case: Clear Expenditure List
MSS
-
User requests to view Expenditure List
-
LIFE shows the Expenditure List
-
User requests to clear the Expenditure List
Use case ends.
Extensions
-
1a. Expenditure List is empty.
-
1a1. LIFE shows an error message.
Use case ends.
-
Extensions
-
1a. User did not start the stopwatch.
-
1a1. LIFE shows an error message.
Use case ends.
-
Instructions for Manual Testing
Adding a task
-
Adding a new task to the existing task list
-
Test case:
addtask n/CS2101 user guide d/100419 h/0930
Expected: New task added to the task list with a different index number. -
Test case:
addtask n/ST2334 tutorial 8! d/150419 t/1400
Expected: No new task added. Details of invalid command is reflected in the status message under the command bar. -
Other incorrect addtask commands to try:
addtask n/testtask d/219019 t/2020
,addtask
(without any inputs)
Expected: Similar to previous.
-
Deleting a task
-
Deleting an existing task in the task list
Refer to task list to check index number of a particular task -
Prerequisites: Index entered must available in the task list
-
Test case:
deletetask 1
Expected: Task with index number 1 will be removed from the task list. Subsequent tasks will be shifted up. -
Test case:
deletetask 0
Expected: No task will be deleted. Details of invalid command will be reflected in the status message under the status bar. -
Other incorrect deletetask commands to try:
delete task1
,deletetask
Expected: Similar to previous. === Adding a purchase
-
-
Adding a new purchase to the existing expenditure list
prefix of purchasename is 'pn' not 'n' -
Test case: 'addpurchase pn/chicken rice pr/3.50`
Expected: New purchase added to the expenditure list with a different index number. Timestamp in the status bar is updated. -
Test case:
addpurchase pn/ice cream pr/$2.70
Expected: No new purchase added. Details of invalid command is reflected in the status message under the command bar. -
Other incorrect addpurchase commands to try:
addpurchase pn/bicycle rental pr/10
,addpurchase n/movie tickets pr/23.00
Expected: No purchases will be added. Details of error will be reflected.
-
Clearing expenditure list
-
Clearing the existing populated expenditure list
-
Test case:
clearexplist
Expected: If existing expenditure list has data, the list will be cleared successfully. If existing expenditure list was already empty, invalid command will be shown.
-
Wrap Up and Lessons learnt
After one gruelling semester of coding, debugging, testing and documentation, I have picked up basic programming knowledge of Java, which I have not touched before previously. Implementing this knowledge in LIFE allowed me to hone my programming skills and developed my maturity in software engineering. This is also the first time I have worked on a developed software with a team, using an iterative model in the software development life cycle.