PROJECT: Student Schedule Planner
1. Overview
This portfolio showcases the software engineering skills I acquired during my time of study in National University of Singapore (NUS).
Student Schedule Planner (SSP) is a desktop application created by my team T12-3 for CS2103T module. SSP aimed to aid university students to manage their tasks effectively. It is morphed from an existing product called Address Book (Level 4), with constraints such as command-line interface must be the main mode of user input.
My contributions to the project included adding task monitoring system which consists of firstday,
listday and listweek commands to aid the users in better monitoring of their tasks.
2. Summary of Contributions
-
Major enhancement: Added task monitoring system
-
What it does: This feature allows user to know what is the current academic week whenever they launch the application within the academic semester. It also allow users to know what tasks they have that are due on the current date or from the current date until the closest Sunday.
-
Justification: This feature allows user to monitor their tasks easier as they may know that they have certain tasks due on a particular week and could use this to plan their remaining time properly. Users could also easily know what tasks they have on the current week.
-
Highlights: This implementation was challenging as it required creating a new
modelandstoragefor saving and retrieving the data. It was also tedious and time consuming to conduct both system and manual tests for different dates due to the need to manipulate my device’s system date. -
Credits to Stack Overflow and The Java™ Tutorials - Oracle Docs: #1, #2, #3, #4, #5
-
-
Code contributed: RepoSense
-
Other contributions:
-
Project management:
-
Documentation:
-
Community:
-
Some parts of
listweekcommand andListWeekCommandTesttest cases I added was adopted by a classmate: #125, #212 -
Some parts of
ListDayCommandTesttest cases I added was adopted by a classmate: #201 -
Some parts of
DateSamePredicateTesttest cases I added was adopted by a classmate: #229 -
Reported bugs and suggestions for other teams in the class: #220, #224, #235, #238, #242, #248
-
Tools:
-
Integrated two Github plugins (AppVeyor, Coveralls) to the team repo
-
-
3. Contributions to the User Guide
Given below are sections I contributed to the User Guide to aid the user in using the application. |
3.1. Generating Academic Calendar
Generate the entire academic calendar based on the first academic day and stores it in storage.
Currently, the generated academic calendar is based on the academic calender of National University of Singapore (NUS). It may not be compatible with academic calendars from other institutions.
Whenever the application is launched within the academic calendar’s dates, the application title will append that
particular week’s description to the title of the application.
firstday DDMMYY
Example:
firstday 130818
The following diagram illustrates when you execute firstday 130818, and launch the application within 121118
- 181118 (Week 13 for NUS academic year 18/19 semester 1), the application title will be appended with "Week 13".
| There would not be any visible changes upon using the command. The changes are only reflected after relaunching the application. |
DDMMYY refers to the date format of day, month and year. It must fulfil the following criteria:
-
DDMMYYmust only be one set of value such as130818. Value such as130818 200818or130818 20will be rejected as they are considered as more than one set of date. -
DDMMYYmust be a valid date within 21st century. -
DDMMYYmust be a Monday.
3.3. Viewing Tasks Due This Week
List tasks due from current date till the end of the current week.
listweek
Example:
The following diagram illustrates the SSP when listweek is executed on the date 021118. Only tasks until
041118, which is the closest Sunday, will be displayed.
4. Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide that includes my technical documentation and depth to aid developer to understand how the application functions. |
4.1. Generate Academic Calendar Weeks
In order to enable users to better monitor their tasks in the schedule planner by knowing what is the current
academic week, firstday command was added.
firstday command will generate the weeks referencing to NUS academic calendar, and will append the week
description to the application title if the user launches the application within the academic calendar dates.
This allows the user to know the current academic week.
| Only 17 weeks are referenced from NUS academic calendar. More details at glossary. |
4.1.1. Current Implementation
firstday mechanism is facilitated by FirstDayCommand and implements the following operations:
-
FirstDayCommand#computeRangeOfWeek(firstDay)— It generate the academic calendar weeks data based onfirstDayparameter. -
FirstDayCommand#addDescriptionForWeeks— It appends description for each academic calendar weeks. -
FirstDayCommand#saveRangeOfWeeks(rangeOfWeek)— It save the academic calendar weeks data intorangeofweek.xml -
FirstDayCommand#createDefaultFileIfNotExist()— It creates the defaultrangeofweek.xmlif it does not exist. -
FirstDayCommand#createDefaultFileIfUnableConvert()— It creates the defaultrangeofweek.xmlif data is unable to convert to be used. -
FirstDayCommand#createDefaultFileIfSizeDiff()— It creates the defaultrangeofweek.xmlif the number of entries differ from the expected academic number of weeks. -
FirstDayCommand#createDefaultFileIfNull()— It creates the defaultrangeofweek.xmlif any data is null. -
FirstDayCommand#createDefaultFileIfInvalidDateOrRange()— It creates the defaultrangeofweek.xmlif date data in modified to be an invalid date or date range format. -
FirstDayCommand#computeAppTitle()— It computes the corresponding application title after checking if current system date is within academic calendar dates. -
FirstDayCommand#retrieveRangeOfWeeks(storeRangeOfWeeks)— It retrieves the saved academic calendar weeks data fromrangeofweek.xml -
FirstDayCommand#isWithinDateRange(firstDayOfSem, lastDayOfSem)— Check if current system date is withinfirstDayOfSemandlastDayOfSemand return true or false. -
FirstDayCommand#retrieveWeekDescription(rangeOfWeek)— It return the description of a particular week -
FirstDayCommand#isMonday(inputDate)— It checks ifinputDateis Monday and return true or false.
Given below is an example usage scenario and how firstday mechanism behaves at each steps:
Step 1. The user enter the command firstday 130818
Step 2. The command word firstday invoke LogicManager to invoke SchedulePlannerParser. SchedulePlannerParser
then invoke FirstDayCommandParser#parse(130818) which will then trim the argument 130818 into trimmedArgs.
Step 3. Methods onlyOneSetArgument(trimmedArgs), Date#isValidDate(trimmedArgs) and isMonday(trimmedArgs) are used
in sequential order to check if trimmedArgs is valid.
If either method in Step 3 failed, ParseException with respective message will be thrown to inform user what had
gone wrong. FirstDayCommand would then not be called.
|
Step 4. FirstDayCommandParser return a FirstDayCommand with the validated trimmedArgs as its
parameter.
Step 5. LogicManager then invoke FirstDayCommand#execute().
Step 6. FirstDayCommand#computeRangeOfWeeks(trimmedArgs) will be activated and generate the academic calendar weeks
. This method will further call FirstDayCommand#addDescriptionForWeeks to add description for each of the academic
calendar weeks. The academic calendar weeks will be stored in a 2D String array named rangeOfWeek.
Step 7. FirstDayCommand#saveRangeOfWeeks(rangeOfWeek) will be activated. It will create a
XmlSerializableRangeOfWeek object with rangeOfWeek as its parameter to allow rangeOfWeek data to be
converted into Xml format to be easily saved. Next, this method would call XmlFileStorage#saveWeekDataToFile to
save XmlSerializableRangeOfWeek object data into Xml format in rangeofweek.xml
CommandException will be thrown if rangeofweek.xml does not exist.
|
Step 8. After the data had been saved properly, should the current system date lies within the academic calendar
weeks, UI would display the corresponding week description to the user.
Step 9. When user launch the application,MainApp will create a FirstDayCommand object named fdc to utilise the
methods fdc#createDefaultFileIfNotExist, fdc#createDefaultFileIfUnableConvert, fdc#createDefaultFileIfDiffSize,
fdc#createDefaultFileIfNull and fdc#createDefaultFileIfInvalidDateOrRange.
If it is the first time the user launches the application or if user deleted rangeofweek.xml or invalidated data in
rangeofweek.xml, the application will record the log message and create a default rangeofweek.xml.
The following code snippet shows that with the extra layer of data verification and rectification, the user do not need to worry when they accidentally invalidated the storage file.
Step 10. MainApp will create a Config object named as updateConfig and then calls the method
updateConfig.setAppTitle(fdc.computeAppTitle()). fdc.computeAppTitle() would create a 2D String Array called
retrieveData for storing academic semester dates to operate FirstDayCommand#retrieveRangeOfWeeks(retrieveData) to
retrieve saved data.
It then check if system date is within the retrieveData by using FirstDayCommand#isWithinDateRange(x,y) where x
and y stands for the first academic and last academic day respectively. If it is within, it then generate the
corresponding application title by using FirstDayCommand#retrieveWeekDescription(retrieveData). Else it uses the
default application title. It would then return the result into updateConfig.setAppTitle() to update the
application title.
Step 11. MainApp then calls ConfigUtil#saveConfig(updateConfig, configFilePathUsed) to save the updated
configuration into the path configFilePathUsed where config.json is.
Step 12. MainApp would then retrieve the application title from config.json and display on UI.
CommandException will be thrown if data from rangeofweek.xml could not be converted or if rangeofweek.xml does
not exist.
|
The following sequence diagrams illustrates how the mechanism works:
4.1.2. Design Considerations
Aspect: How firstday command functions
-
Alternative 1 (current choice): Generate entire academic calendar weeks by input the first academic Monday date.
-
Pros: It would only need one set of date.
-
Cons: It would require many methods to validate, generate the data.
-
-
Alternative 2: Allow user to create their own academic calendar such as having customised number of weeks and description for each weeks.
-
Pros: It would allow customisation.
-
Cons: It would be time and effort consuming for the user and also to validate the data.
-
Aspect: Data structure to support storing of academic calendar weeks data
-
Alternative 1 (current choice):
2D String arrayis used.-
Pros: It would allow easy data retrieval for specific
index. -
Cons: It could cause confusion especially if magic numbers were used instead of constant.
-
-
Alternative 2:
ArrayListis used.-
Pros: It would not require sequential memory for storage.
-
Cons: It would not allow data retrieval at any specific
indexwhich requires traversing.
-
4.2. View Tasks Due Today/This Week
In order to enable users to better monitor their tasks in the schedule planner, Two variations of
list command were added.
listday command supports viewing tasks due on the current date, whereas listweek command supports viewing tasks
from the current date till the closest Sunday.
4.2.1. Current Implementation
listday/listweek utilises the same implementation used by list command:
-
Model#updateFilteredTaskList()— Takes in a predicate parameter and updates the model according to the predicate.
listday further implements the following operation:
-
DateSamePredicate— takes in asystemDateparameter.systemDateis aStringvalue after converting current system date intoDDMMYYformat.
listweek further implements the following operations:
-
numDaysTillSunday(dateName)— It compute the number of days from current date until closest Sunday (exclusive of Sunday) usingdateName.dateNameis the name of the current day. -
appendDateList(dateList, numDaysTillSunday(dateName))— It generates sequentialDDMMYYvalues based on the result ofnumDaysTillSunday(dateName)and inserts them intodateList.dateListis aList<String>object. -
DateWeekSamePredicate— It takes in adateListparameter.dateListis aList<String>object that contains the list of dates from current date to closest Sunday date inDDMMYYformat.
As both listday/listweek commands are similar, we will only illustrate how listweek works.
Given below is an example usage scenario and how listweek mechanism behaves at each steps:
Step 1. The user entered the command listweek.
Step 2. The command word listweek invoke LogicManger to invoke SchedulePlannerParser to return a
ListWeekCommand object. LogicManager then invoke ListWeekCommand#execute().
Step 3. ListWeekCommand#appendDateList(datelist, numDaysTillSunday(dateName)) will be activated. It helps to generates
values for dateList and the values are sequential dates in DDMMYY format after using the result from
numDaysTillSunday() method. numDaysTillSunday() will compute the number of days from current date till Sunday based on dateName,
the name of the current day.
Step 4. model.updateFilteredTaskList() will update the task list with DateWeekSamePredicate
as the parameter. DateWeekSamePredicate itself would take dateList in Step 3 as the parameter.
Step 5. The updated task list would be reflected on UI to be displayed to the user.
The following sequence diagram illustrates how the mechanism works:
4.2.2. Design Considerations
Aspect: How does listday and listweek function
-
Alternative 1 (current choice): Filter accordingly based on the command itself
-
Pros: It is easy to implement and use.
-
Cons: It restrict to view all tasks from current date or from current date till Sunday only.
-
-
Alternative 2: Allow the commands to receive argument for which date(s) to filter. E.g listday 130818 to view all tasks for 13 August 2018.
-
Pros: It allows viewing for different date(s).
-
Cons: It would cause inconvenience for entering the date(s) each time the command was to be used.
-