- Developer Guide (7 Apr)
- Acknowledgements
- Get Started
- Design
- Implementation
- Git Workflow
- Appendix A: Product Scope
- Appendix B: User Stories
- Appendix C: Non-Functional Requirements
- Appendix D: Glossary
- Appendix E: Instructions for manual testing
- Documentation Standard
- Code Standard
ℹ️ This section is only for the developer who want to run the project locally, if you are not a developer, please refer to User Guide instead.
ℹ️ Logger information is hidden by default, if you wish to enable logger for debugging purpose, please pass argument
--verbosewhen running the jar file. ie java -jar VoyaTrip.jar --verbose
The architecture of the application is designed to be modular and easy to maintain.
Main Components:
ℹ️ The components referring here are not particular classes instead high level ideas or packages we can say
- Main: The entry point of the application, responsible for initializing the application and handle program specific parameters
- Ui: The user interface component, handle all the user inputs and program outputs
- Storage: The storage component, handle all the file reading and writing
- Logic: The logic component, handle all the actual execution of the commands
- Model: The model component, handle all the data structure and data manipulation
Simple diagram is included to show the relationship among these components.
The interaction for any command is similar to the following, for simplicity, we will use add trip as an example:
The main flow of the application whenever a command is entered by the user is as follows:
ℹ️ for simplicity here we use add trip as an illustration
This section describes some notable details on how certain features are implemented/going to be implemented.
-
This is implemented by using the
Storageclass, which is responsible for reading and writing data to and from the file system. -
Diagram is included at the end to show the relationship between the
Storageclass and other classes in the system.
ℹ️ The
Storageclass is implemented with external libraryorg.jsonto handle the JSON file format.
- The
Storageclass reads the JSON file from the file system. - It parses the JSON data into Java objects using the
org.jsonlibrary. - The parsed data is then passed into static fromJson() of
TripListwhich then invoke the same methods of relatedTrip,Day,Activity,TransportationandAccommodationclasses to create the corresponding objects recursively. - The created objects are then returned to the
Mainclass, and being assigned to thetripListvariable if needed.
⚠️ This method will return aOptional<TripList>object instead of the triplist directly.
TripListobject is passed into theStorageclass.- The
Storageclass then callstoJson()method ofTripListclass, which again invoke the same methods of the related objects to return a JSON object - The JSON object is then converted to string with indentation of 4 spaces for better json format
⚠️ This method will create/ overwrite the file if it does not exist, and will delete the files if the triplist object is empty.
The 'modify accommodation' feature is facilitated by calling modifyAccommodation in the Trip class, which is responsible
for updating the details of existing accommodation in the accommodations list, based on the modifications provided.
Here is the overview of the whole modification operation:
- Role of
Parser:
- The
Parserclass takes the input from the user and transforms it into aAccommodationCommandobject using theparsemethod.
- Role of
handleCommand:
- After receiving the
AccommodationCommandobject,handleCommand(command)is called within theExecutor, which determines the appropriate action (like invokingmodifyAccommodation).
- Role of
Trip:
- The
modifyAccommodation(...)method is called to perform the changes to the trip accommodation data.
UiFeedback:
- After all successful updates, the
Tripclass calls theprintModifyAccommodationMessagemethod on theUiclass to provide clear visual feedback to the user about the successful modification.
A trip named 'My Trip' has three accommodations stored in the accommodations list. We want to modify the second accommodation by:
- Changing its name to
"Courtyard Resort". - Updating its budget to
$500. - Leaving the booked days unchanged (
nullforaccommodationDays).
~/My Trip/Accommodation >
modify accom --index 2 --n Courtyard Resort --b 500
accommodationName != null: Updates the name to"Courtyard Resort"by callingsetNameof the accommodation.accommodationBudget != null: Updates the budget to500by callingsetBudgetof the accommodation.accommodationDays == null: Days remain unchanged.- After modifications,
Ui.printModifyAccommodationMessageis called to display a confirmation message.
The modify transportation feature is facilitated by calling executeModifyTransportation who in turns calls modifyTransportation.
This feature allows the user to modify the information of any given transportation from the transportation list of a given trip.
- The user is required to provide the associated transportation index and at least one parameter they wish to modify .
- The user may perform
list transportaion -- allto view all the transportations, and their associated index, contained in the current trip. - Logging messages are printed before and after modifying each desired parameter.
- If the user modifies the day parameter,
validateTransportationDayis called to verify that the day is within the trip duration and is greater than 1. If the day is not validated,InvalidDayExceptionis thrown
The list transportation feature is facilitated by calling the executeListTransportation who in turns calls listTransportation.
This listing feature allows the user to list a transportation information by simply inputting its associated index or by its name.
This feature also enables the user to list all the transportations and their index from a given trip.
- The user is required to provide the associated transportation index or name to list the transportation information.
- The user may provide
list transportation -- allto view all the transportations, and their associated index, contained in the current trip. - The user may perform
list transportaion -- allto view all the transportations, and their associated index, contained in the current trip. - Logging messages are printed before the operation and upon successful completion
- Prior to calling the
printListTransportationmethod, depending on the provided parameter, the program verifies if the transportation at a given index or name exists in the list of transportation. - If the transportation is not found,
InvalidIndexExceptionis thrown in the case that the index is invalid, TransportationNotFoundException in the case that the provided name does not exist
Please try to use consistent branch name style if applicable
- developing a new feature:
dev/<issueNumber>-<description>, ie `dev/8-add-delete-trip - fixing a bug:
fix/<issueNumber>-<description>, iefix/8-incorrect-output
This product is designed for exchange students whom
- has a desire to manage the important details of their trips, including budgeting
- prefer desktop program over other types
- is comfortable using the command-line interface (CLI)
- can type fast on a keyboard
This product provides a simple and efficient way for an exchange student to manage the important details of their trips which includes information on its itinerary, transportation, accommodation and budget.
| Version | As a ... | I want to ... | So that I can ... |
|---|---|---|---|
| v1.0 | user | add a trip | keep track of the trip information |
| v1.0 | user | add an activity | keep track of the activities |
| v1.0 | user | add a transportation | keep track on how I will be travelling |
| v1.0 | user | add an accommodation | keep track on where I will be staying during my trip |
| v1.0 | user | delete a trip | remove any cancelled trips |
| v1.0 | user | delete an activity | remove any cancelled activities |
| v1.0 | user | delete a transportation | remove any cancelled transportation |
| v1.0 | user | delete an accommodation | remove any cancelled accommodation |
| v2.0 | forgetful user | see the itinerary | view the itinerary of the trip and all related activities |
| v2.0 | user | see the accommodation | view the accommodations of a given trip |
| v2.0 | user | see the transportation | view thetransportation of a given trip |
| v2.0 | user | modify the accommodation | update it with any new information |
| v2.0 | user | modify the transportation | update it with any new information |
| v2.0 | user | modify the trip | update it with any new information |
| v2.0 | user | modify the activity | update it with any new information |
| v2.0 | user | include a day to my transportation | keep track of my transportation dates |
| v2.0 | forgetful user | include a day to my accommodation | keep track of accommodation dates |
| v2.1 | user | view the activities in a chronological order | organize my trip itinerary |
| v2.1 | user | see all my trips | keep track of all my trips and their related cost |
| v2.1 | forgetful user | save the trips | access my trips' information at anytime |
|
- Should work on any mainstream OS as long as it has Java
17or above installed - Should be packaged as a JAR file
- User should have an average typing speed
- Concise error messages are provided when wrong commands are entered
- Should handle unexpected inputs without crashing
- Should provide logging and debugging capabilities
- Multistep command - A feature which requires the user to go through several steps to complete.
This section provides instructions for manual testing. This manual testing will allow the user to test the add, delete, cd, list and modify features.
- Launch the program
- Download the jar file
- Open a terminal and run the following command
java -jar JAR_FILE_NAME.jar
- Enter the following test cases, one by one
-
add trip --n vietnam --s 1-2 --e 1-3 --b 1000 -
Expected: Display trip information
-
list trip --all -
Expected: Display the trip information and its index
-
cd trip --i 1 -
Expected: The current directory is now the newly added trip
-
add activity --n Sand Dunes --d 1 --t 6:00 -
Expected: Display the activity information
-
list --n all -
Expected: Display the itinerary for each day
-
add transportation --n Scoot --m air --d 1 --b 200 -
Expected: Display the transportation information
-
cd accommodation -
Expected: The current directory is now Accommodation
-
add --n Hotel M --s 1 --e 2 --b 100 -
Expected: Display the newly added accommodation information
-
list transportation --all -
Expected: Display all the transportation under current trip with their index
-
delete transportation --i 1 -
Expected: Display the information of the deleted transportation
-
modify accommodation --i 1 --n Hotel Mao -
Expected: Display the information of the newly modified accommodation
- Please don't remove the old documentation, but instead
strikethroughor append (deprecated) at the end - After update the documentation, please make sure to list the latest version on the table of contents
Please try to use consistent branch name style if applicable
- developing a new feature:
dev/<issueNumber>-<description>, ie `dev/8-add-delete-trip - fixing a bug:
fix/<issueNumber>-<description>, iefix/8-incorrect-output
PlantUML is the software/code we use to generate the uml diagram.
- Download the PlantUML plugin in your own IDE, it is available for both IntelliJ and VSCode
ℹ️ Make sure you have also download the graphviz Check it by typing
brew info graphvizin linux environment terminal Install it by typingbrew install graphvizin linux environment terminal
- Please refer to the official documents to start code it, you can check it here. It is a generally powerful and easy tool not only to general uml, you may check there main page for more information
- Make sure you end the uml document with
.pumlbut not.uml
Basically follow the same as cs2113 guideline yet here will have some more specific guideline if not found in cs2113 website.
ℹ️ This documentation will only add new thing from time to time, but will not change pre-defined standard, hence please check for any updates from time to time. (deprecated)
ℹ️ For easy workflow, this issue's name will ends with last updated date for the reference. And the latest update will be denoted by * in table of contents. (deprecated)
Please use encapsulated primitive type, ie Integer instead of integer
Please use the lambda style of switch statement to avoid the tedious break statement, ie
switch (x) {
case "a" -> System.out.println("a");
case "b" -> System.out.println("b");
default -> System.out.println("others");
}




