PROJECT: ModuleBook


About the project

Our team consisting of 4 computer science students were tasked with enhancing a basic command line interface (CLI) desktop addressbook application for our Software Engineering project. We chose to morph the application into a study assistant application catering to NUS students called ModuleBook. ModuleBook is specially designed to help NUS students find and keep track of the modules they are taking each semester; add and maintain deadlines related to each module; keep a list of helpful and commonly used website links for easy access. This document presents my contributions to this project.

This is what our project looks like:

UiLabelledA
Figure 1. The graphical user interface for ModuleBook

Note the use of the following symbols and formatting in this document:

Words - phrases in this format indicates that this is a command that can be inputted into the command line and executed by the application, or they are referring to components, classes or objects in the architecture of the application.

This symbol indicates important information
Indicates a tip or advice

Summary of contributions

This section gives a summary of my contribution to the team project in terms of coding, documentation and other feature improvements.

  • Major enhancement: Added link feature to manage links in a TrackedModule.

    • What it does: The link command allows the user to manage a set of website links. The link command currently supports add, delete , edit, go and mark actions.

    • Justification: Some modules may have a module website, or the user may have found other academic websites that contain information helpful to their studies. In this case, the user can add the links to the specific module in ModuleBook and access it easily from the application.

    • Highlights: This feature checks for validity of links provided and ensures that the user does not entire the same name for links twice so it would be easier for the user to manage. This feature was designed with the user’s needs in mind. Commands has been simplified so each action can be done with minimal typing. Some commands can be done through the GUI as well.

    • Credit: A third-party library, Apache Commons, was imported to check for the validity of links provided.

  • Code contributed: [RepoSense]

  • Other contributions:

    • Documentation:

      • Created the general skeleton of the ModuleBook user guide (#12).

      • Updated User Guide and Developer Guide pertaining to link feature (#66, #79, #150)

    • Community:

      • Reviewed Pull Requests (with non-trivial review comments): #16, #57

      • Reported bugs and offered suggestions for other teams: PE Dry Run Repo

    • Tools:

      • Integrated a third-party library (Apache Commons) to the project: #40

Contributions to the User Guide

We had to update the original addressbook user guide to match our morphed application, ModuleBook. The following section are excerpts from my contribution to this task. They showcase my ability to write documentation targeting end-users.

Link commands are only available when viewing a module and only valid on currently displayed tracked modules.

Before you use any link command, make sure you are viewing your desired course module first.
If you happen to forget any of the url paired with the names you have entered, simply hover over the button and the information will be displayed.

You can use this command to add a link with the given name to a selected TrackedModule. This is useful if you manage to come across an important website related to a certain module you are currently taking and wish to note it down. A button will be created in ModuleBook with name you specified.

Suppose you are taking CS2103, and you will frequently visit the course website to check for new updates or tasks to complete by the next milestone. You wish to put the link somewhere so you can access it easily and also manage them effectively. You can do so using the following steps:

  1. Enter the command. Make sure you are viewing the CS2103 module.

][pdfwidth="50%"
  1. Press Enter. You should see a new button created in the Links section and a success message.

][pdfwidth="50%"

You can use this command to edit the name and/or url of an existing link.

Suppose the name "Nusmods Timetable" is too long and you want to change it to just "Nusmods". It is very simple to achieve:

  1. Enter the corresponding command

][pdfwidth="50%"
  1. Press Enter. The link should be updated with the new name and a success message should appear.

][pdfwidth="50%"

You can use this command to access a link in the default browser of your system.

If you are using any lesser known operating system, the app may not be able to detect it and this feature may not work as intended.

Now suppose you wish to access a link you provided previously (from the add command). Doing that is very simple:

  1. Enter the command link go n/Course Website

  2. The website should open in the default browser of your system and a success message should display.

Alternatively, you can access the link by clicking on it through the GUI as well.

Some links may be more important than others, and you may access them more frequently. To keep track of that, you can mark them using the mark feature.

Suppose you go to the course website of CS2103 very often and want to make sure you can identify the link immediately, mark it so it stays at the front all available links:

  1. Enter the command link mark n/Course Website

][pdfwidth="50%"
  1. Press Enter. The specified link will now be marked with a symbol and brought to the front of the list.

][pdfwidth="50%"

Contributions to the Developer Guide

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

The link management feature allows users to add and manage a set of website links that will be associated with a given module.

Implementation

Our application currently supports adding and managing of links specific to certain modules.

The link management feature is primarily facilitated by the following classes:

  • Link - represents a link object

  • TrackedModule - represents a module that was tracked. Stores the Link objects related to it.

  • LinkCommand - embodies the link command input given by the user and contains the necessary changes that will be made to the TrackedModule object.

  • LinkCommandParser - parses user input related to link commands and returns the corresponding LinkCommand to be executed.

Each link object is stored in an ArrayList<Link>, which in turn is stored in its corresponding TrackedModule.

In summary, the class diagram of how Link is implemented is shown as:

][pdfwidth="30%"
Figure 2. Class diagram for Link objects

The link feature currently recognizes and supports add, delete, edit and launch commands.

Link commands are parsed through the LinkCommandParser class, which in turn calls the respective XYZLinkCommandParser class (i.e. AddLinkCommandParser, EditLinkCommandParser). The XYZLinkCommandParser class parses and returns a corresponding XYZLinkCommand class, which calls execute() and the TrackedModule will be updated accordingly if the execution was successful.

The following activity diagram summarizes what happens when the link command is entered and executed:

][pdfwidth="40%"
Figure 3. Activity diagram for a LinkCommand execution

An example usage scenario of an add link operation is given below and the behavior of the link management feature is shown.

  1. The user launches the application with an existing save file. ModuleBook is initialized with existing TrackedModule.

  2. The user inputs link add n/LINK_NAME l/LINK_URL to add a link with name LINK_NAME, linked to LINK_URL to the TrackedModule with the corresponding MODULE_INDEX.

  3. LogicManager receives user input and parses it using ModuleBookParser#parseCommand(). ModuleBookParser reads the COMMAND_WORD and identifies the input as a Link related command and passes the input to LinkCommandParser.

  4. LinkCommandParser determines the add action required. It then proceeds to pass the relevant input to AddLinkCommandParser.

  5. AddLinkCommandParser checks for the validity of LINK_URL given by the user and creates the relevant Link and AddLinkCommand objects.

  6. AddLinkCommand calls Model#getDisplayedModule() to find the required module. If it does not exist or is not currently tracked, AddLinkCommand throws a CommandException. Otherwise, it then proceeds to call TrackedModule#hasLinkTitle(LINK_NAME) to check for an existing Link object with the same LINK_NAME.

  7. If such a Link object exists, AddLinkCommand aborts and throws a CommandException. Otherwise, the created Link will be added to the specified TrackedModule.

  8. If the operation is successful, a CommandResult with the success message will be returned.

AddLinkCommandSequenceDiagram
Figure 4. Sequence diagram for add link operation
][pdfwidth="50%"
Figure 5. Reference of add link to module function from sequence diagram shown above

Design Considerations

Aspect: Data structure used for link management

  • Alternative 1: All TrackedModule maintain a ArrayList<Link>. Adding Link objects will add to this ArrayList.

    • Pros: Easy to implement and edit for beginner programmers.

    • Cons: Accessing and editing existing Link might be less efficient. If number of Link objects maintained increases, ArrayList may not be optimal.

  • Alternative 2: Use HashSet<Link> to maintain Link in each TrackedModule

    • Pros: Reduces access time, since Link objects can be obtained by giving LINK_TITLE, rather than searching the list linearly for a matching object.

    • Cons: Difficult to add features. Future implmentations may add a Priority feature to Link objects. HashSet does not support any form of sorting and thus may pose a problem.

  • Solution (current implementation): Adopt alternative 1. Since from a user standpoint, the number of links added to any module should not be too large to affect performance of application.