This portfolio documents my contributions to a NUS Software Engineering project.

PROJECT: NSync


Overview

NSync is a desktop application with a command-line interface that helps NUS students resolve the problem of scheduling meetings (and inefficient notes downloading) between their peers, team mates and friends in a simple and fuss-free manner.

Summary of contributions

  • Main Feature Implemented: Feature to export and import user details.

    • What it does: Allows the user to export and import all the details of a particular contact. These details include the name, contact number, email, address and time-table of the contact.

    • Justification: Each user has to key in all of their contacts' individual details previously, which is a very time-consuming process. This time-saving feature allows the user and his/her contacts to key in their own details in a one-time fashion, before exporting their own details and exchanging it with each other for importing.

    • Highlights: This enhancement builds upon all of the existing user details, and requires an in-depth understanding of the workings of the Logic and Model components. The implementation required coalescing all of a user’s details during exporting, as well as decoding it into the respective fields subsequently during importing.

  • Code contributed: [Functional and test code]

  • Other contributions:

    • Minor Feature Implemented: Added the feature to find the next immediate free time-slot.

      • Allows the user to find the next immediate free time-slot for himself, and/or his contacts from the current time.

    • Project management:

      • Managed releases for NSync: v1.2, v1.3, v1.3(PE), v1.4 on GitHub

      • Bug reports of NSync reviewed (with non-trivial review comments): All issues from #99 to #135

    • Community:

Contributions to the User Guide

Given below are 3 sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Filters for next free time-slot: free

Want to meet up with your friends at the soonest opportunity? Or would you like to find out when is the next time you can take a break (with no scheduled activities)? free allows you to easily find the next available time-slot from the current time for one or more of your NSync contacts, giving you answers to these questions!

Format: free f/[SELF/INDEX] …​

SampleTimeTable

Example 1: free f/self
Running this command will show your next available time-slot (from current time).
With reference to the time-table found in the figure above, if the current day and time is Monday 3:00pm, your next available time-slot shown is Monday 4:00pm till 8:00pm. If the current day and time is Monday 4:34pm, your next available time-slot shown is Monday 4:34pm till 8:00pm.

Example 2: free f/1 f/7 f/9
Running this command will show the next available time-slot (from current time) for contacts whose indices are 1, 7 and 9 respectively.

Running this command outside the day window of Monday to Friday or beyond the time of 8pm will return a time-slot from the next weekday.

Export user data: export

Met a new acquaintence who would like to have your contact details and time-table to schedule a common meeting time? export allows you to export all of a user’s (or your own) details in each respective field into an encoded string. (Once you have sent the string to another NSync user, he/she can use import to retrieve the data within the encoded string - see import for more details)
Format: export PUBLIC/PRIVATE SELF/INDEX

  • Type 'public' if you would like the user who imports your contact to see the full contents of your time-table.

  • Type 'private' if you would like the user who imports your contact to see only your free and busy time-slots respectively (i.e. specific contents of your time-table are hidden!).

All examples shown below are with reference to the sample time-table shown in the figure above.

Example 1: export public self
The importing user will see your time-table in its entirety (i.e. the full contents of the time-table), exactly as shown in the sample time-table above.

Example 2: export private self
The importing user will see only the busy and free time-slots in your time-table, marked as black and white colored slots respectively, as seen in the figure below.

ExportPrivateView
The generated string from the command will be automatically copied for you (no manual selecting and copying required)! All you have to do is to send it in its entirety to a fellow NSync user who will import it.
When exporting a time-table with only free and busy time-slots (i.e. black and white slots), it does not matter if you select either the public or private option - the user who imports your generated string will see the same time-table.
Exporting more than 1 user’s details at a time or exporting a merged time-table is currently not available (but will be implemented in future releases!).

Import user data: import

Did you receive an encoded string from a fellow NSync user? Use import to transfer all of the data within the string into your copy of NSync!
Format: import [PASTE_YOUR_ENCODED_STRING_HERE]

Display Message 1: Import Successful!
If you have imported a valid contact who is currently not in your NSync (i.e. no contact with the same name), all of the imported user’s details will now be found in your NSync.

If you see only black and white colored slots in the time-table of the imported contact, it means that the exporting user could have chosen the private option during the export process. See export for more details.

Display Message 2: Import Successful! An existing contact has been found in NSync and has been overwritten.
If you have imported a valid contact who is currently already in your NSync (i.e. contact with the same name), all of the details found in the imported string will overwrite the existing ones found in your NSync, for that particular contact.

If you have unintentionally over-written the details of an existing contact, use undo to get back the original details of the contact!

Display Message 3: Import Failed!
If you have missed out a character, or accidentally modified one of the characters in the string, attempting to import the invalid string will result in an error displayed. Please obtain a valid string from the contact who passed it to you.

Contributions to the Developer Guide

Given below is a section I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Update Current Merged Feature

Current Implementation

Given the scenario where a user has created a merged time-table (i.e. a mergedPerson / Person with Tag-merged) of several contacts (i.e. a Person / Person with no Tag), and one or more contacts had updated their time-tables after the merged time-table had been created, the creator of the merged time-table would previously have to delete the existing merged time-table and manually create another merged time-table to accommodate the changes in the time-table(s).

With the update feature, users are able to update an existing mergedPerson, if there are any changes to the composition of the mergedPerson. Such changes include the update of one or more Person time-tables or deletions of Persons(s).

Given below is an example of a scenario where update is used and how the merge mechanism behaves at each step.

Step 1:
After the user inputs update, a list of mergedPerson is retrieved. This list (a.k.a. mergedPersonsList) is iterated through, updating each mergedPerson within mergedPersonsList.

UpdateCommand1

Step 2:
The Name of each mergedPerson is saved as groupName.

To find a desired Person for updating within mergedPerson, the Address of each mergedPerson is tokenized (i.e. split up), and the desired Person is searched against the names within Address. This is the same underlying mechanism as the find command.

If the desired Person for updating is found, the Person is added to an array called personsToMerge. Else, if the desired Person cannot be found, both groupName and mergedPerson are stored in removedPersons, which is a map of arrays. To find the corresponding mergedPerson in removedPersons, use groupName as the key (i.e. identifier).

UpdateCommand2

Step 3:
The merged Person is now updated, using the same underlying mechanism as the merge feature. If removedPersons is not empty, it returns a CommandResult showing the Person(s) removed and the affected merged Person(s).

UpdateCommand3

The following sequence diagram shows how the update function works.

UpdateCommand5

Design Considerations

Aspect: How update executes
  • Alternative 1 (current choice): Updates mergedPerson only when update is specifically executed by the user as a command. The Person s who are part of a mergedPerson are then retrieved using their names at the time of merging.

    • Pros: Faster execution time as NSync only needs to run the updating when update is specifically executed as a command by the user.

    • Cons: Could lead to a mis-match in information between individual Person s themselves, and the mergedPerson whom Person is part of. This mis-match may also persist if the Person 's name has been modified.

  • Alternative 2 (To be implemented in v2.0): Execute update in an under-lying call immediately whenever there is a relevant change (i.e. if a Person who is part of mergedPerson has edited their name or changed their time-table, or if a Person is no longer part of the mergedPerson).

    • Pros: Brings about more convenience for users, and it is more intuitive to them, since they have to only enter 1 command instead of 2. Prevents the bug caused by editing a Person 's name and then executing update, as mentioned under cons of current choice.

    • Cons: Overall execution time is slower if there are many mergedPerson s, and many edit s are done. This is because mergedPersonsList is iterated through each time edit is done, to examine each mergedPerson s.