Low Xi Zhi - Project Portfolio Page
Overview
WhenFree is a Command Line scheduler chatbot for NUS students to find common free time among them and their friends, using just the NUSMODS links to their school timetable.
Summary of Contributions
- Code contributed
-
Enhancement 1: added feature Display timetable of selected contacts
- What it does: Generates and displays a combined timetable from several contacts’ timetable.
- Justification: This feature is key to the functionality of WhenFree as it allows the user to see his/her common free slots with other contacts.
-
Enhancement 2: added feature Edit a contact’s timetable
- What it does: Overwrites a contact’s timetable to “busy” or “free” for a time slot.
- Justification: This feature enhances the usability of WhenFree as it allows the user to make amendments on top of their NUSMODS timetable (eg. empty tutorial slots, additional consultation sessions), allowing them to find free time slots more accurately.
- Highlights: This feature prevents overwriting any meetings scheduled.
-
UG documentation:
- Contributed to the Introduction and Quick Start sections.
- Wrote the main description as well as detailed notes for these features: List all contacts, Display timetable of selected contacts, Schedule a new meeting, List all meetings, Edit a contact’s timetable
- Contributed to FAQ for obtaining NUSMODS link from NUSMODS website.
- Contributed to Command Summary.
-
DG documentation:
- Framework: Made the framework for the Design and Implementation sections.
- Design Section: Wrote the UI component and the logic.schedulelogic component(of Logic component), including class diagram Fig 5.
- Implementation Section: Wrote the Display timetable of selected contacts and Edit a contact’s timetable features, including sequence diagrams Fig 12. Fig 14. Fig 15.
- Edited architecture diagram and class diagrams to be neat and consistent (labelling, colour-coding, aligning), captioned all diagrams, edited text referring to the diagrams to be consistent and edited the sentence structure to ensure flow of the Design and Implementation sections.
-
Team-based tasks:
- Refactor all commands into a single CommandHandler class.
- Refactor overlapping code in “Schedule a new meeting” and “Edit a contact’s timetable” features.
- Raised issues to bugs found in team members’ code.
- Allocating sections of UG and DG to be written by team members.
-
Review/mentoring:
- Suggested to a team member a better implementation of his “Delete a contact” feature, which he eventually used.
- Pointed a team member to resources to write assertions.
- Pointed out errors in team members’ class diagrams.
-
Contributions beyond the project team:
- Asked a question in the forum clarifying a module’s concept
- Raised issues to bugs in other team’s project. Example 1 Example 2
Example Contributions to the User Guide:
Edit a contact’s timetable: edit
There are 2 use cases illustrated below: to edit a contact’s timetable to “busy” for a specified time slot, and to edit a contact’s timetable to “free” for a specified time slot.
- You can edit the contact’s timetable for only the current week and the next week, for which your timetable can be displayed
with the
timetable <Contact Index>
andmore
commands - Hence,
<Start Date>
and<End Date>
represents the date number you wish to edit the timetable for, within the current week and the next week, from the current date onwards. For example, if the date today is 27 April:- You can edit the timetable on 29 April this week with
<Start Date>
and<End Date>
as29
. - You can edit the timetable on 6 May next week with
<Start Date>
and<End Date>
as6
. - You will not be able to edit the timetable with
<Start Date>
and<End Date>
as26
. Even though 26 April is within this week, the date has passed. The future date 26 May is also not within the current week and the next week.
- You can edit the timetable on 29 April this week with
-
<Start Time>
and<End Time>
should be in the 24-hour HH:MM format. For example, the time 3pm should be represented as15:00
.You can check
<Contact Index>
of the contact whose timetable you wish to edit, by listing all contacts usingcontacts
.
Use case 1: Edits a contact’s timetable to be “busy” for a specified time slot. You need to key in <Contact Index>
of the contact, and specify the time slot to be marked “busy” with <Start Date>
<Start Time>
<End Date>
<End Time>
.
Format:
edit busy <Contact Index> <Start Date> <Start Time> <End Date> <End Time>
Example of usage:
edit busy 0 11 09:00 11 10:00
Example output:
Use case 2: Edits a contact’s timetable to be “free” for a specified time slot. You need to key in <Contact Index>
of the contact, and specify the time slot to be marked “free” with <Start Date>
<Start Time>
<End Date>
<End Time>
.
Format:
edit free <Contact Index> <Start Date> <Start Time> <End Date> <End Time>
Example of usage:
edit free 0 11 09:00 11 10:00
Example output:
Example Contributions to the Developer Guide:
3.5 Edit a contact’s timetable
Fig 14. Sequence diagram of the implementation of the Edit a contact's timetable
feature
Fig 14. shows the sequence diagram of editing the schedule (timetable) of a selected contact at a given time slot.
It consists of 3 classes:LogicManager
Commandhandler
Contact
.
Given below is an example usage scenario of the Edit a contact's timetable
feature.
-
The user invokes the LogicManager by entering
edit <contact index> <time slot>
.The original user input formats for
EditCommand
are:edit busy <contact index> <start day> <start time> <end day> <end time>
andedit free <contact index> <start day> <start time> <end day> <end time>
,
for editing theContact
’s schedule to “busy” and “free” at the given time slot respectively. We generaliseedit busy
andedit free
asedit
in the sequence diagram as their execution are similar. We also represent<start day> <start time> <end day> <end time>
as<time slot>
in the sequence diagram to keep it concise. - The
LogicManager
requests to edit a contact’s schedule viaCommandHandler
. -
The
CommandHandler
retrievesContact
fromContactList
using the contact’s index passed into the command.This step is omitted in the sequence diagram to keep it concise.
- The
CommandHandler
callseditSchedule(time slot)
ofContact
. Ifedit busy
, the schedule ofContact
will be marked as “busy” for the given time slot. Ifedit free
, the schedule ofContact
will be marked as “free” for the given time slot.
The schedule of the Contact
is edited and saved in the application.
3.5.1 Design Considerations
Aspect 1: Clash of Meeting
’s time slot and EditContact
’s time slot when editing main user’s schedule
The implementation described above would allow the overwrite of any time blocks in the Contact
’s schedule. This
would be problematic when editing the main user’s schedule, which contains Meeting
s’ time slots. A possible problematic
scenario is if we edit over a Meeting
’s time slot and set the time slot to “free”, we would subsequently be able to schedule
another meeting at the same time slot. This results in multiple Meeting
s occupying the same time slot.
- Alternative 1(current choice): Disallow the overwrite of
Meeting
’s time slot. IfEditContact
’s time slot clashes with anyMeeting
’s time slot, throw error to discontinue edit of that time slot. - Alternative 2: Allow the overwrite of
Meeting
’s time slot. IfEditContact
’s time slot clashes with anyMeeting
’s time slot, remove theMeeting
fromMeetingList
.
We chose Alternative 1 for these reasons:
- The intended purpose of the edit function is to make amendments to schedules pulled from NUSMODS so that additional “busy” slots or “free” slots can be visualized in the timetable, not to edit over meetings.
- Editing of a
Meeting
’s time slot to be “free” will be equivalent to deleting theMeeting
, for which there is a dedicated feature implemented. This causes unnecessary overhead in functionality. - Alternative 1 is easier to implement. When a clash is detected, Alternative 1 requires only the throwing of exception,
whereas Alternative 2 requires the removal of
Meeting
fromMeetingList
.
Fig 15. Sequence diagram of checking if an edit is valid in the Edit a contact's timetable
feature
Fig 15. shows the sequence diagram illustrating the implementation of Alternative 1. Checking validity of
edit is done before editSchedule() of Contact
is called, as shown in Fig 14.
- This path is optional, and is only implemented if
Contact
the main user. -
CommandHandler
calls isValidEdit(time slot) of theContact
class. - isValidEdit(time slot) uses the
Contact
’s schedule to check if any of the time blocks within the time slot is a “meeting” time block. - If no “meeting” time block is detected within the time slot, the edit is valid. The program continues running and editSchedule() will be called.
-
If a “meeting” time block is detected within the time slot, the edit is invalid. An invalid exception is thrown by
Contact
, and the user will be informed that the edit is invalid.TextUI
andException
classes which are involved in generating the exception, and displaying the exception message to the user are omitted to keep the sequence diagram concise.