Skip to content

Commit 6fd94ed

Browse files
authored
Update DeveloperGuide.adoc
1 parent 2bcb927 commit 6fd94ed

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/DeveloperGuide.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ image::SGTravel_newItinerary_Command_diagram.png[height="640" width="1400"]
462462

463463
Alternatively, the creation of itineraries can be facilitated by the Recommendations and AddListCommands in the Logic Component.
464464

465-
Given below is an example usage scenario and how the recommendation mechanism behaves and interacts in the Model :
465+
Given below is an example usage scenario and how the Recommendation mechanism behaves and interacts in the Model :
466466

467467
. The user calls the `RecommendationsCommand` with its relevant parameters. +
468468
e.g. `recommend itinerary between 23/04/20 and 24/04/20`
@@ -479,6 +479,24 @@ Given below is the sequence diagram of how the various components work in the `e
479479
.Sequence diagram for the execute() method in RecommendationsCommand
480480
image::SGTravel_recommend_command_diagram.png[height="950" width="1380"]
481481

482+
Given below is an example usage scenario and how the AddList mechanism behaves and interacts in the Model after a recommendation has been added :
483+
484+
. The user calls the `AddThisListCommand` with its relevant parameters. +
485+
e.g. `addThisList MyNewVacation`
486+
. The `LogicManager` parses the user input using the `Parser`.
487+
. The `Parser` returns a AddThisListCommand object and passes the relevant newName with it.
488+
. The `LogicManager` will call `execute()` on the `AddThisListCommand` object which return a `CommandResultText` Object containing the add itinerary in full.
489+
. During the `execute()` method the recent recommendation is received from storage. If no recent recommendation is present a `NoRecentItineraryException` is returned
490+
. The confirmRecentItinerary() method is called. This saves the current recommendation with the new name entered.
491+
. The recentItinerary (recomendation) is set to null such that the same recommendation cannot be added twice.
492+
. The method `save()` is invoked in the `Model`, and a `CommandResultText` object is created with an appropriate message to show the stored itinerary.
493+
494+
Given below is the sequence diagram of how the various components work in the `execute()` method of the `AddThisListCommand` command:
495+
496+
.Sequence diagram for the execute() method in RecommendationsCommand
497+
image::SGTravel_addList_command_diagram.png[height="950" width="1380"]
498+
499+
482500
Other helper commands such as list,show and doneItineraries have not been shown but are an important interface to the user.
483501

484502
==== Design Considerations

0 commit comments

Comments
 (0)