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.

Ui
Figure 1. User Interface of 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]…​

  • Only Singapore Dollar(SGD) currency is supported.

  • You only have to input the value (see example)

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

  • Deletes the purchase at the specified INDEX.

  • The index refers to the index number shown in the displayed expenditure list.

  • The index must be a positive integer (1, 2, 3, …) .

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

DATE should be in the DDMMYY format

Example: totalexpday 191218

Set spending limit: setlimit [coming in v2.0]

Sets a spending limit for one day to control expenditure.
Format: setlimit VALUE

  • Only SGD currency is supported.

  • You only have to input the value (see example)

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

Help

Shows you the user guide for reference in app

help

help

History

Shows you a history of all commands used

history

history

Undo

Undo your previous command [currently only available for contact list commands]

undo

undo

Redo

Redo your undo [currently only available for contact list commands]

redo

redo

Task List Commands

Commands to help you maximise utility of Task List:

Function Purpose Command Example

Add Task

Adds a new task

addtask

addtask n/Complete CS2113T Assignment d/180319 h/2359

Delete Task

Deletes a task off the task list

deletetask

deletetask 1

Edit Task

Edits the task specified with the entered parameters

edittask

edittask 2 n/Banana

Tick Task

Shows that a task has been completed

ticktask

ticktask 5

Sort Task

Sorts the task list according to the deadline of each task

sorttask

sorttask

Expenditure List Commands

Commands to help you use the expenditure list to manage your expenses:

Function Purpose Command Example

Add Purchase

Adds a new purchase

addpurchase

addpurchase pn/Ice cream pr/1.50

Clear Expenditure List

Clears the existing expenditure list

clearexplist

clearexplist

Expenditure List

Shows list of purchases with the price

explist

explist

Workout Tracker Commands

Commands to help you utilise the workout book:

Function Purpose Command Example

Workout

Views the past 5 most recent workout

workout

workout

Record workout

Records a new workout and add into existing workout records

record

record e/Sit ups s/5 r/20 t/10

Habit Tracker Commands

Commands to help you navigate about the habit list:

Function Purpose Command Example

Add Habit

Adds a newly desired habit

addhabit

d/010119 n/SleepBefore12am a/Done

Contact List Commands

Commands to help you use the Contact List:

Function Purpose Command Example

Add Person

Adds a new person

add

add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01

List

Shows all the people in the contact list

list

list

Edit Person

Edits the contact details specified with the entered parameters

edit

edit 1 p/91234567 e/johndoe@example.com

Delete Person

Deletes a person off the contact list

delete

delete 1

Find Person

Finds and then show the people with names containing the keywords entered

find

find John

Select Person

Selects a specified person

select

select 2

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

UiClassDiagram
Figure 2. Structure of the 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 exists ObservableList<Workout>, ObservableList<Habit> and ObservableList<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)
ModelClassBetterOopDiagram

Storage component

StorageClassDiagram
Figure 3. Structure of the 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 String that represents the name of the purchase.

Price

new Price("1.50")

Stores a String that represents the price of the task. String stored has to be in the format of integers, followed by a decimal point then 2 integers.

Tag

new Tag()

Stores a String that acts as a tag to the new purchase. This field is optional.

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

new Purchase(PurchaseName, Price, Tag)

Stores PurchaseName, Price, Tag objects to document information of about a task.

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.

ExpenditureListModelComponentDiagram
Figure 4. Model Component of 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.

AddPurchaseSequenceDiagram
Figure 5. Add Purchase Sequence Diagram

 

The following activity diagram illustrates an example with a user executing the addpurchase command.

AddPurchaseActivityDiagram
Figure 6. Activity Diagram of user executing a 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 this PurchaseList 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

  1. User requests to view Expenditure List

  2. LIFE shows the Expenditure List

  3. 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

  1. Adding a new task to the existing task list

    1. Test case: addtask n/CS2101 user guide d/100419 h/0930
      Expected: New task added to the task list with a different index number.

    2. 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.

    3. Other incorrect addtask commands to try: addtask n/testtask d/219019 t/2020, addtask (without any inputs)
      Expected: Similar to previous.

Deleting a task

  1. Deleting an existing task in the task list

    Refer to task list to check index number of a particular task
    1. Prerequisites: Index entered must available in the task list

    2. Test case: deletetask 1
      Expected: Task with index number 1 will be removed from the task list. Subsequent tasks will be shifted up.

    3. 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.

    4. Other incorrect deletetask commands to try: delete task1, deletetask
      Expected: Similar to previous. === Adding a purchase

  2. Adding a new purchase to the existing expenditure list

    prefix of purchasename is 'pn' not 'n'
    1. 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.

    2. 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.

    3. 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

  1. Clearing the existing populated expenditure list

    1. 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.