You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments