Project: Jalil Enterprises Stock List

1. Overview

1.1. Project Overview

This project was a part of the CS2113T (Software Engineering & Object-Oriented Programming) module, and our team was tasked to enhance the existing AddressBook application for a specific target audience group of our choice.

1.2. Product Overview

Morphed from AddressBook – Level 4 [link to AB4], Jalil Enterprises is a desktop inventory list application used for recording stocks in NUS Computer Engineering laboratories. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java and has ~10 kLoC.

Some key features of the Jalil Enterprises application are storing quantities and statuses of stocks, creating loan lists for loaning of equipment, and saving and viewing archives of the inventory on command.

2. Summary of contributions

For the project, I was responsible for the storage component of the application as well as the implementation of “saving and viewing a version of the stock list” feature.

  • Code contributed: Project Code Dashboard

  • Major enhancement: : Implemented a series of commands which allow the user to save and view past versions of the inventory.

    • What it does: allows the user to save the current inventory as a .xml file and open it anytime in a table format.

    • Justification: This feature improves the product significantly because a lab technician would need to save and review past inventory statuses monthly.

    • Highlights: This enhancement affects both storage and events management. It required an in-depth analysis of storage designs and XML transformations with XSLT. The implementation too was challenging as it required the creation of new commands.

  • Other contributions:

    • Project management:

      • Managed project releases V1.0V1.3 on GitHub

      • Responsible for milestone completion on GitHub

    • Enhancements to existing features:

      • Enhanced FindCommand to search for items with a partial keyword

        Example: find “ardui” -> returns Arduino item
      • Wrote tests for SaveCommand to increase coverage (Pull requests #112)

3. Contributions to the User Guide

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

3.1. Save current version of stock list : save

An xml file recording current stocks will be created and named.
Format: save NAME

Examples:

  • save ForAugust
    This would save the stock list at the time when the command is inputted, and the name for this xml file is ForAugust.xml, under a /versions/ folder in main.

3.2. Open and view a saved stock list : open

The .xml file specified will be opened and displayed in table format on the Browser Panel.
Format: open NAME

Examples:

  • open ForAugust
    This would open the saved stock list under /versions/ folder in main at the time when the command is inputted

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

4.1. Save/Open feature

4.1.1. Current Implementation

The save/open mechanism is facilitated by SaveCommand and OpenCommand. It extends Command and implements the following operation:

  • Command#SaveCommand() — Saves the current version of the stock list as an XML file in a /versions/ folder.

  • Command#OpenCommand() — Opens the saved XML file as a table in the browser panel.

The operation is exposed in the Model interface as Model#saveStockList().

Given below is an example usage scenario and how the saveCommand mechanism behaves at each step.

Step 1. The user executes save april_18 command to save the current version of the stock list as an xml file named april_18.xml.

Step 2. The save command calls Model#saveStockList(), which initiates a saveStockListVersionEvent. The fileName and ReadOnlyStockList are saved as public final variables in the event.

Step 3. The handleSaveStockListVersionEvent handler calls the saveStockListVersion() method from the StorageManager class.

The following sequence diagram shows how the save operation works:

SaveCommandSequenceDiagram
Figure 10. How save/open operation works

Step 4. The ReadOnlyStockList is saved as an xml file.

Step 5. The user executes open april_18 command to open the saved april_18.xml file.

Step 6. The open command calls Model#openStockList(), which initiates a openStockListVersionEvent. The fileName is saved as a public final variable in the event.

Step 7. The handleOpenStockListVersionEvent handler calls the loadFileAsPage() method from the BrowserPanel class.

Step 8. The loadFileAsPage() method takes in the fileName and passes the directories of the april_18.xml and template.xsl files into transformXml() method.

Step 9. The april_18.xml file is transformed with the template.xsl stylesheet into a table format and is displayed by the browser engine on the browser panel.

4.1.2. Design Considerations

Aspect: How save executes
  • Alternative 1 (current choice) Save as .xml file.

    • Pros: Able to display the inventory as a table by using XML transformation with XSLT. The .xml file can also be opened in Excel.

    • Cons: -

  • Alternative 2 Save as .csv file.

    • Pros: File can be imported or exported.

    • Cons: Unable to style the displayed table in the application.

Aspect: How open executes
  • Alternative 1 (current choice) Transform .xml file into a table with a .xsl stylesheet.

    • Pros: Able to display the inventory in a table format for ease of view.

    • Cons: A template.xsl file must be included in the application.

  • Alternative 2 Open the .xml file as it is

    • Pros: Does not require transforming the .xml file with XSLT.

    • Cons: The displayed inventory is in XML format and hard to decipher.

Use case: Save stocklist

MSS

  1. User requests to save stocklist

  2. StockList saves current inventory as .xml file with specified file name.

    Use case ends.

Extensions

  • 1a. The file name is invalid.

  • 1b. Stocklist shows an error message.

    Use case ends.

Use case: Open stocklist version

MSS

  1. User requests to open stocklist version

  2. StockList opens specified .xml file and displays as table.

    Use case ends.

Extensions

  • 1a. The file name is invalid.

  • 1b. Stocklist shows an error message.

    Use case ends.