PROJECT: CoderLifeInsights
CoderLifeInsights is a CLI (Command Line Interface) driven desktop application that a programmer can use to record his or her social interactions with individual friends, or group of friends.
CoderLifeInsights gives the programmer insights into his or her social life, and provides suggestions to liven up their social life by analysing the social events recorded in CoderLifeInsight through the CLI.
My Role
I was tasked to implement the AddEventCommand with its relevant classes, namely the Time, PlaceList and ActivityList classes. I also made the inputs from the aforementioned command savable to the hard disk. This command and its implementation is the backbone of all our relevant features. I also made minor changes to the GUI displays, as well as contributions to the Developers' Guide and User Guide.
Listed in the table below are some notations that are used throughout the document.
Icon | Description |
---|---|
|
Command that can be executed, or a component, class or object in the architecture of the application |
|
Tips that might be helpful in navigating the application |
|
Important information that should be noted |
Useful information for a deeper understanding of the command |
As shown in Table 1, “Legend table”, these icons associated to their following descriptions, such as commands, tips, important information and useful information, enable greater clarity in understanding the document. Note that useful information will have text enclosed in its box.
Summary of contributions
Major enhancements:
-
Major enhancement #1: Implemented Add Event feature for a Person
-
What it does: It allows the user to add an event with a person. An event consists of an activity, a place, and a time. These relevant fields and information, namely the [ACTIVITY], [PLACE], and [TIME], are added to the person the event is created with and are saved to the hard disk.
-
Justification: This feature improves the product significantly as the user may add events with persons in CoderLifeInsights. The relevant information from the events added are used in other features. The information being saved to the hard disk allows the user to make use of features through different uses.
-
Highlights: This enhancement functions well with existing commands as it updates each Person with a Time, PlaceList and ActivityList variable that represents the time the user has spent with that person, the activities done with that person, and the places been to with that person respectively, in CoderLifeInsights which is displayed in each person’s details. It also saves the added information to the hard disk. Many improvements and features such as Insights and Suggest stem from the data recorded by this command in the Person and Group objects. It required an in-depth analysis of design alternatives.
This major enhancement took much effort as it required the implementation of 3 new classes. These 3 classes were used in the two entities, Person and Group. Also, the attributes added to the Person and Group class were also implemented in a way such that it would be saved to the Json file, as well as work with the import and exporting features. Significant architectural analysis was required to ensure these classes worked they way they were intended and did not break existing features of AB3 as they were integrated into the Person object. Furthermore, the data stored in these attributes were the backbone of a majority of all other features, which generated output through analysis of the data stored.
-
Minor enhancements:
-
Minor enhancement #1: Integrated the Add Event feature with the Import and Export feature.
-
What it does: This enhancement made the Add Event feature work with the Import and Export features, allowing the information added and saved by this command to be imported and exported.
-
Justification: This feature allows the user to not lose information from events added when switching computers.
-
Highlights: This enhancement functions well with existing commands. It required an in-depth analysis of design alternatives.
This allowed the Time, PlaceList and ActivityList of each person saved in the Json file to be converted successfully to the CSV file.
-
-
Minor enhancement #2: Made the Add Event feature function properly with groups.
-
What it does: This enhancement made the Add Event feature work with a Group object, and made information keyed in by users with the AddEventCommand function savable to the hard disk
-
Justification: This feature allows the user to add events with groups, on top of persons. The relevant information saved to the hard disk is required for other functions to generate their output.
-
Highlights: This enhancement functions well with existing commands. It required an in-depth analysis of design alternatives.
-
-
Minor enhancement #3: Implementation of Insights feature for groups
view_groups
[Refactored into the view command by @terencemah in PR: #173]-
What it does: This enhancement allows the user to view the places visited and the activities done with a particular group. It also lists the number of times been to each place and number of times each activity is carried out with the group.
-
Justification: This feature gives the user insights on the favourite places and activities of each group of friends in CoderLifeInsights.
-
Highlights: This enhancement functions well with existing commands. It required an in-depth analysis of design alternatives.
-
-
Minor enhancement #4: Integration of the PlaceList and ActivityList classes with the Group entity
-
What it does: This enhancement integrated the PlaceList and ActivityList into the Group object.
It allowed relevant information to be added to a Group object, as well as ensured that the relevant data was stored to the Group object and Json file as well. -
Highlights: This enhancement functions well with existing commands and features. It required an in-depth analysis of design alternatives.
-
-
Code contributed:[RepoSense]
-
Other contributions:
-
Project management:
-
Tasked to ensure deliverables were submitted and deadlines were met by all members of the group.
-
Tasked to test and discover potential bugs in the software.
-
Tasked to ensure documentation for all code is written, as well as ensuring that the User Guide is understandable and not confusing.
-
-
Enhancements to existing features:
-
Created the interim Event container class
-
Implemented the AddEventCommand which adds an Event( which consists of an Activity, a Place and a Time) to a Person
-
Created a Time variable and made it savable for each Person object through updates via the AddEventCommand
-
Created a PlaceList variable and made it savable for each Person object through updates via the AddEventCommand
-
Created an ActivityList variable and made it savable for each Person object through updates via the AddEventCommand
-
Added the PlaceList and ActivityList variables to groups and made them savable for each Group object through updates via the AddEventCommand
-
-
Documentation:
-
Community:
-
Tools:
-
Contributions to the User Guide
Shown below are the sections I contributed to in the User Guide. They showcase my ability to write documentation targeting end-users. |
Listing saved data : list
[written by: Ernest Lian Qi Quan]
Shows a list of recorded information in CoderLifeInsights.
Format: list_LIST_PARAMETER
Examples:
Example | Command | Result |
---|---|---|
Show all persons |
|
Returns a list of the saved persons in CoderLifeInsights. |
Show all groups |
|
Returns a list of the saved groups in CoderLifeInsights. |
Adding an Event: add_event
[written by: Ernest Lian Qi Quan]
Adds an event to a person or a group at the specified INDEX.
Format for adding to a person: add_event ACTIVITY_NAME place/PLACE_NAME time/TIME m/INDEX
Format for adding to a group: add_event ACTIVITY_NAME place/PLACE_NAME time/TIME g/INDEX
Remarks:
-
TIME has to be in entered in the format
HHMM
:
Input for a time of 1 hour and 5 minutes would be:time/105
Input for a time of 9 minutes would be:time/09
-
MM entered has to be between 00 and 60 (01 to 59).
-
The INDEX refers to the index number shown in the displayed person list. The INDEX must be a positive integer.
-
CoderLifeInsights uses 1-indexing.
Examples:
Example | Command | Result |
---|---|---|
Adding an event with a person from the fully listed persons list |
|
Creates an Event Date Night at MBS with a time spent of 3 hours and adds it to the second person in CoderLifeInsights. |
Adding an event with a group from the fully listed groups list |
|
Creates an Event Dancing lessons at Changi Country Club with a time spent of 1 hour and 30 minutes and adds it to the first group in CoderLifeInsights. |
Adding an event to a person after using the find function |
|
Creates an Event Date Night at MBS with a time spent of 3 hours and adds it to the first result returned by the |
Insights: view
[written by: Ernest Lian Qi Quan and Mah Cai Jun, Terence]
Displays various insights about the person’s, groups and events stored in Coder Life Insights. (You might need to enlarge the application window for the best view.)
This feature encompasses a range of functions which share the following format:
view INSIGHT_PARAMETER [m/PERSON_INDEX] [g/GROUP_INDEX]
Note that the application will only accept EITHER a person index OR a group index, never both.
Also, whether an index is required or possibly not allowed depends on the insight parameter.
Contributions to the Developer Guide
Shown below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Add Event Feature
[written by: Ernest Lian Qi Quan]
The add event feature allows users to add an event to a saved contact or group in CoderLifeInsights specified using the member m/
tag or the group g/
tag.
Implementation
Command: add_event ACTIVITY m/INDEX time/TIME place/PLACE
or add_event ACTIVITY g/INDEX time/TIME place/PLACE
Remarks:
-
TIME is the variable used to store the time the user has spent with a saved contact or group.
-
TIME parameter must contain at least 2 digits. For example: A time of 1 hour and 30 minutes will be input as
130
. -
An event added must have time of at least 1 minute. e.g. time/01
-
PLACE and ACTIVITY are case-sensitive
Example usage: add_event date night m/1 time/230 place/Gardens by the Bay
The command above will add the following to the Person whose index is 1
on the filtered or unfiltered list:
-
Activity
date night
into the Person’s activityList. -
Place
Gardens by the Bay
into the Person’s placeList. -
Time
230
which equals 2 hours and 30 minutes, will be added to the Person’s time.
It will also create an Event with the following attributes:
-
Activity:
date night
-
Place:
Gardens by the Bay
-
Time:
2h 30m
The sequence diagram below showcases how the command works with a valid input:
Depicted below is the class diagram of the Event class, displaying how the UniqueEventList and Event classes are associated to the AddressBook class:
The Event created is stored in an UniqueEventList, which is saved to the Json file as well. The Events saved are used to generate output for features.
The following class diagram shows how the Time, PlaceList and ActivityList are associated with a Person object. The Person class only displays relevant information to the Time, PlaceList and ActivityList classes:
The Time, ActivityList and PlaceList classes were implemented similar to a Person’s Name or Address. A Person’s Time is displayed on the GUI as well for users to know how much time they have spent with that Person.
The reason behind this implementation was to ensure that information added from the AddEventCommand would be saved through changes to Persons or Groups in CoderLifeInsights.
The pertinent information would then be used in following features which require these data to generate output.
A Group object also has the same implementation of Time, PlaceList and ActivityList and its class diagram is similar to the diagram above, with the Person class being substituted by the Group class.
These information are also saved for the Group object when an Event is added to a Group object.
The following activity diagram depicts the following scenario:
-
User enters
add_event date night m/1 time/230 place/Gardens by the Bay
into the command prompt. -
The
LogicManager
callsAddressBookParser#parseCommand()
. -
The method
AddressBookParser#parseCommand()
creates aAddEventCommandParser
and calls theAddEventCommandParser#parse()
method. -
AddEventCommandParser#parse()
checks if input is valid. -
AddEventCommandParser#parse()
then creates a new instance of anEvent
. -
AddEventCommandParser#parse()
then creates a new instance ofAddEventCommand
, with the createdEvent
as it’s parameter. -
AddEventCommand
calls theAddEventCommand#execute()
method. -
AddEventCommand#execute()
retrieves the filtered list with the call tomodel#getFilteredPersonList()
. -
AddEventCommand#execute()
then retrieves the Person object to be edited with the call tomodel#getFilteredPersonList()#get()
. -
AddEventCommand#execute()
then computes the new Time by retrieving the Person’s current Time with the call toperson#getTime()
,then adding it to the input Time. -
AddEventCommand#execute()
then creates a new ActivityList by retrieving the Person’s ActivityList with the call toperson#getActivityList2()
, followed byActivityList#addActivity()
, which returns a new ActivityList with the new activity added. -
AddEventCommand#execute()
then creates a new PlaceList by retrieving the Person’s PlaceList with the call toperson#getPlaceList2()
, followed byPlaceList#addPlace()
, which returns a new PlaceList with the new place added. -
AddEventCommand#execute()
then creates a new Person object with all the same attributes except for the Time, PlaceList, and ActivityList which is replaced by the new Time computed, the new PlaceList and the new ActivityList with the call to the Person constructor. -
AddEventCommand#execute()
then replaces the existing Person object with the new Person object with the call tomodel#setPerson()
. -
AddEventCommand#execute()
then updates the filtered list with the call tomodel#updateFilteredPersonList()
. -
AddEventCommand#execute()
then updates the UniqueEventList with the call tomodel#addEvent()
, which adds the createdEvent
to the UniqueEventList. -
AddEventCommand
returns theCommandResult
toAddressBookParser
. -
AddressBookParser
returns theCommandResult
toLogicManager
.
Justification
The Add Event feature and the relevant classes were added and implemented to add and store Events and relevant data that are used to generate output for other features such as insights.
Use case: Add an event with a person
[written by: Ernest Lian Qi Quan]
MSS
-
User wants to add an Event with the following details to the first person displayed on the Person List on CoderLifeInsights:
Activity:swimming
Place:pool
Time:1 hour and 30 minutes
-
User enters correct command with valid input and prefixes
-
Event is created and added to the Person
Use case ends
Extensions
-
2a. User enters incorrect command
-
2a1. Invalid command error is displayed
-
2a2. User re-enters valid command with valid input
Use case resumes at 3.
-
-
2b. User enters correct command but invalid input
-
2b1. Invalid command error is displayed
-
2b2. User re-enters valid and correct command with valid input
Use case resumes at 3.
-
-
2c. Person index specified is out of bounds
-
2c1. Invalid person index error message is displayed
-
2c2. User re-enters command with correct and valid person index
Use case resumes at 3.
-
Use case: Add an event with a group
[written by: Ernest Lian Qi Quan]
MSS
-
User wants to add an Event with the following details to the first group displayed on the Group List on CoderLifeInsights:
Activity:dancing
Place:dance studio
Time:1 hour and 30 minutes
-
User enters correct command with valid input and prefixes
-
Event is created and added to the Group
Use case ends
Extensions
-
2a. User enters incorrect command
-
2a1. Invalid command error is displayed
-
2a2. User re-enters valid command with valid input
Use case resumes at 3.
-
-
2b. User enters correct command but invalid input
-
2b1. Invalid command error is displayed
-
2b2. User re-enters valid and correct command with valid input
Use case resumes at 3.
-
-
2c. Group index specified is out of bounds
-
2c1. Invalid group index error message is displayed
-
2c2. User re-enters command with correct and valid group index
Use case resumes at 3.
-