PROJECT: Plan²travel

This portfolio aims to document the contributions that I have made to the Plan²travel project.


Introduction

Plan²travel is a desktop travel planning application. The application is targeted at fellow university students who travel infrequently and would greatly benefit from an application that helps organize their travelling information when they plan their own itinerary. Plan²travel has the ability to store and display information such as activities, accommodations, contacts and an itinerary which comprises of a list of day. Each day is displayed with a list of activities that is scheduled.

The user interacts with the application using a Command Line Interface (CLI), and it has Graphical User Interface GUI created with JavaFX.

It is cross-platform and can be compiled for both Windows and Mac OS.

Below is a screenshot of our application:

Plan2TravelSS

Summary of contributions

Below is a summary of the contributions that I have made to the project.

Major enhancement:

  • Added and modified commands to facilitate trip management

    • What it does: allows the user to create new trips, load and rename existing trips, make copies of existing trips and also clear existing trip information.

    • Justification: This feature improves the product significantly because it allow users to plan for multiple trips. This removes the initial limitation of only being able to plan for a single trip at a time. Under the initial limitation, users would have had to constantly overwrite their trip plans and lose any previous plans that they have made.

  • Functional Code Contributed: Update 1 | Update 2 | Update 3 | Final Update

Other Contributions:

  • UI:

    • Morphed and improved upon the initial AB3 UI (#69, #81, #98)

  • Documentation:

    • Contributed to the User Guide and Developer Guide for this project. See below for more details.

  • Community:

Overall Code Contribution here

Contributions to the User Guide

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

Planning a new trip: new

Creates and loads a new empty trip with desired name.

Format: new n/NAME

  • Compulsory field, name, must be present.

  • Name cannot exceed 30 characters.

  • Name can only contain alphanumeric characters and spaces, and cannot be left empty.

  • Name of an existing saved trip cannot be used.

  • Name is reflected as itinerary name.

Examples:

  • new n/Iceland Trip

Creates a new, empty trip plan that has the name "Iceland Trip" and saves it.

Review an existing trip: load

Loads a saved trip with desired name.

Format: load n/NAME

  • Compulsory field, name, must be present.

  • Unsaved trip plans cannot be loaded.

  • The current trip plan cannot be reloaded.

  • Name is reflected as itinerary name.

Example:

  • load n/Greenland Trip

Loads an existing, saved trip plan that has the name "Greenland Trip".

Make a copy of an existing trip: copyto

Creates and loads a copy of current trip using desired name.

Format: copyto n/NAME

  • Compulsory field, name, must be present.

  • Name cannot exceed 30 characters.

  • Name can only contain alphanumeric characters and spaces, and cannot be left empty.

  • Name of an existing saved trip cannot be used.

  • Name is the only visible difference between the copy and the original trip plan.

  • Name is reflected as itinerary name.

Examples:

  • copyto n/London Trip

Creates a copy of the current viewable, saved trip plan. The trip plan copy will have the name "London Trip".

Clears existing trip: clear

Clears all current trip information except for name.

  • Name is reflected as itinerary name.

Format: clear

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.

Trip management

Plan²travel allows the user to create new trips, load and rename existing trips, make copies of existing trips and also clear existing trip information.

List of commands that helps with trip management:

  • new n/NAME  — Creates and loads a new empty trip with desired name

  • copyto n/NAME  — Creates and loads a copy of current trip using desired name

  • load n/NAME — Loads a saved trip with desired name

  • set n/NAME — Renames current trip to desired name

  • clear — Clears all current trip information except for name

Current Implementation

A trip (or trip plan) will have a name that is identical to the directory name which it represents. The directory will be accessible via the data/{Directory Name} directory path of the home folder which the plan2travel.jar is stored in.

For example, a trip named "Japan Trip" will represent a Japan Trip directory. This directory can be accessed using the data/Japan Trip directory path.

The directory will contain the accommodation.json, activity.json, contact.json and itinerary.json of the current saved trip.

The trip management mechanism is facilitated by UserPrefs where the desired directory path is stored internally as plannerFilePath.

Operations to access plannerFilePath are exposed in the Model interface as Model#getPlannerFilePath() and Model#setPlannerFilePath(Path) respectively.

Given below is the sequence diagram of how the load operation works:

LoadSequenceDiagram
Figure 1. Sequence diagram for load command
The lifeline for LoadCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.

The sequence diagram above can be described by the following sequence of events:

  1. LoadCommand is executed

  2. LoadCommand updates the UserPrefs plannerFilePath and the Itinerary nameProperty

  3. LogicManager updates the respective file paths (that have been updated due to changes in plannerFilePath) in the Storage component

  4. LogicManger updates the respective lists in the Model component based on the new file paths

  5. LogicManager saves the respective lists in json format in directory designated by plannerFilePath through the Storage component

The following activity diagram summarizes what happens when a user executes a copyto command.

CopyToActivityDiagram
Figure 2. Activity diagram for copyto command

Design Considerations

Aspect: How the Logic component executes set

  • Current Choice: Deletes current directory before saving new directory containing previous json files

    • Pros:

      • Uses File#delete() which is platform-independent and helps in ensuring the stability of the application.

    • Cons:

      • May seem less intuitive. Deletion methods are used instead of renaming methods (which may be more appropriate given that set helps to rename the current directory).

      • Likely to be more costly in terms of execution as it involves deleting the previous directory and saving a new one.

  • Alternative: Rename current directory and avoid saving over the updated directory.

    • Pros:

      • Likely to be less costly in terms of execution as it does not involve deletion and saving of directories.

    • Cons:

      • Uses File#renameTo() which is platform-dependent and may contribute to a less stable application.

Aspect: How the commands execute based on Java API methods

  • Current Choice: Uses methods from File such as File#delete() and File#exists()

    • Pros:

      • Methods used do not throw an IOException and may help ensure the stability of the application.

    • Cons:

      • It may be difficult to diagnose issues that may arise.

  • Alternative: Uses methods from Files such as Files#deleteIfExists() and Files#list(Path)

    • Pros:

      • Methods can throw an IOException which can help to diagnose issues.

    • Cons:

      • However, certain usages of these methods can result in an AccessDeniedException which contributes to a less stable application.

New

  • Creates and loads a new empty trip with desired name

    1. Prerequisites: Arguments are valid and no existing saved trips have the same name. A name must be provided.

    2. Test case: new n/Japan Trip
      Expected: Creates a new empty trip named "Japan Trip". The name is reflected as the itinerary name.

    3. Test case: new
      Expected: Planner name not specified

    4. Test case: new n/Iceland Trip, new n/Iceland Trip
      Expected: This planner already exists

Copyto

  • Creates and loads a copy of current trip using desired name

    1. Prerequisites: Arguments are valid and no existing saved trips have the same name. A name must be provided.

    2. Prerequisites: Populate a new trip using the following commands:

      1. new n/China v1

      2. add activity n/Visit QinShiHuang’s Tomb a/Xi An du/240 t/history

      3. add accommodation n/China World Hotel a/Beijing t/5star

    3. Test case: copyto n/China v2
      Expected: Creates a copy of the current trip named "China v2". The name is reflected as the itinerary name and is the only visible difference when compared to the original trip.

    4. Test case: copyto
      Expected: Planner name not specified

    5. Test case: copyto n/China v1
      Expected: This planner already exists

Load

  • Loads a saved trip with desired name

    1. Prerequisites: Arguments are valid and no existing saved trips have the same name. A name must be provided.

    2. Prerequisites: Populate 2 new trips using the following commands:

      1. new n/China

      2. add activity n/Visit QinShiHuang’s Tomb a/Xi An du/240 t/history

      3. add accommodation n/China World Hotel a/Beijing t/5star

      4. new n/Japan

      5. add accommodation n/Crowne Hotel a/Tokyo p/8137973142 t/5stars

      6. add activity n/Visit Aquarium a/Tokyo p/812487941 du/120 c/20.00 pr/3 t/marine

    3. Test case: load n/China
      Expected: Loads the existing trip that has the name "China". The name is reflected as the itinerary name.

    4. Test case: load
      Expected: Planner name not specified

    5. Test case: load n/China
      Expected: This planner has already been loaded