Overview
Pet Store Helper (PSH) is a desktop application used for pet store owners to manage different aspects of their pet store including pet logging, scheduling and inventory management. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 15k LOC.
Summary of contributions
-
Major enhancement: added the ability to back up/load app data
-
What it does: allows the user to back up the current state of the app and load app data from any compatible JSON file
-
Justification: This feature improves the product significantly because a store should maintain backups of their system files so that data can be recovered in case of a system failure. It is also important to retain past data so that they can be extracted for analysis in the future.
-
Highlights: This enhancement does not affect existing commands, allowing it to integrate seamlessly with the rest of the app. However, this is reliant on the fact that currently the commands are only affected by the data of the app. If an undo/redo command is added, past and undone commands would also need to be saved to avoid errors arising from mismatch of commands and app data.
-
Credits: Code from Address Book Level 4 was referenced to set up temporary files for testing.
-
-
Minor enhancement: Updated Storage to allow saving of new/refactored classes to JSON format.
-
Code contributed: [Reposense]
-
Other contributions: Refactored Storage package and tests for Logic package
-
Project management:
-
Managed releases
v1.2.1
andv1.3.3
(2 releases) on GitHub
-
-
Enhancements to existing features:
-
Documentation:
-
Did cosmetic tweaks to existing contents of the Developer Guide: #90 (mainly adjusting the UML diagrams and removing references to AB3)
-
-
Community:
-
Tools:
-
Integrated multiple new Github plugins (AppVeyor, Coveralls, CircleCI and Netlify) to the team repo
-
-
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. |
Back Up and Load
The back up and load commands together allow data to be stored and managed directly.
Back up
To back up the current state of the pet store, enter the backup
command.
The file name is generated based on the current date and time and reported back.
It is stored in the same directory as the default data file.
Load
To load a file, enter the load
command followed by the file name.
The file should be stored in the same directory as the default data file.
For example, after removing a few pets and slots, the screen will be different from when we backed up previously.
In this case, entering load 20200413_20_23_57
restores the system to its backed-up state.
The file name can be any valid file name under the curent operating system and need not conform to the backup file naming scheme.
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. |
Storage component
Written by Chen Shenghao
The Storage
component,
-
can save
UserPref
objects in json format and read it back. -
can save the Pet Tracker data in json format and read it back.
Back up and load feature
Written by Chen Shenghao
Implementation
The back up/load mechanism is facilitated by Storage
.
Storage
is extended to implement the following operations:
-
savePetTracker#(ReadOnlyPetTracker, LocalDateTime)
— callssavePetTracker#(ReadOnlyPetTracker, Path)
after converting LocalDateTime to Path -
savePetTracker#(ReadOnlyPetTracker, Path)
— saves pet tracker data to specified path
The back up/load mechanism follows the exact same steps taken when data is saved after each operation and read at initialization. This ensures maximum compatibility and reduces the need for additional code.
backup
should never fail unless the saving of data after every operation also fails. For 'load', there are two additional caveats, the specified file should exist and be in the correct format. This is unlike the reading of data at initialization which simply resorts to an empty file instead if these issues occur.
The following sequence diagram shows how the backup operation works:
The following sequence diagram shows how the load operation works:
Design Considerations
Aspect: How back up & load executes
-
Alternative 1 (current choice): Executed by Command, following general pattern for Command
-
Pros: Easy to implement, able to rely on established pattern for Command.
-
Cons: Storage is exposed to classes in the
parser
package, which should not have access to its methods
-
-
Alternative 2: Executed by LogicManager, which already saves data to hard disk after every operation
-
Pros: Storage does not have to be passed to classes in the
parser
package -
Cons: Requires passing instruction back to LogicManager, actual operation performed after end of Command#execute(), unable to obtain reliable success/error message.
-
PROJECT: RTOS-Based Robotic Car
Under a computer engineering module, I am also currently involved in the development of RTOS-based software that allows a robotic car to be controlled for maze navigation via an Android app.