diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 856c4b38ebc..dc4be5031fb 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -340,6 +340,10 @@ The activity diagram below demonstrates this error handling process in more deta * Step 6. The `execute` method in `FindCommand` executes and calls `updateFilteredPersonList` in model to get a filtered list of person entries, both `patient` and `doctor` entries can be displayed. * Step 7. A Success message gets printed onto the results display to notify user and the list of matching results is produced. +The sequence diagram below closely describes the interaction between the various components during the execution of the `DeleteAppointmentCommand`. + + + Alternative implementations considered 1. The following sections describes the behaviour of querying `doctor` and `patient` entries by separate commands by all of the entry's fields, both following a very similar logic to how the `find` command is implemented. We might consider using flags to be more precise with our searches, (e.g a -doctor or -patient flag to indicate we wish to search for only `doctor` and `patient` entries respectively) so as to avoid the need to create additional commands. However, we felt that this approach overloaded the `find` method too much, and overcomplicated the `find` command's usage. 2. Even if the `find` command was to be overloaded with flags, we foresaw that the creation of distinct commands to fit the flags parsed by the `find` command was unavoidable. As such, it was prudent to start with the implementation of the distinct commands first (as described in the following sections, each tied to a specific command), and leave the overloading of the `find` command as a later increment. diff --git a/docs/diagrams/FindPersonSequenceDiagram.puml b/docs/diagrams/FindPersonSequenceDiagram.puml new file mode 100644 index 00000000000..1d1c497b8d6 --- /dev/null +++ b/docs/diagrams/FindPersonSequenceDiagram.puml @@ -0,0 +1,65 @@ +@startuml +!include style.puml +skinparam ArrowFontStyle plain + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR +participant "e:FindCommand" as FindCommand LOGIC_COLOR +participant ":CommandResult" as CommandResult LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box + +[-> LogicManager : execute("find ...") +activate LogicManager + +LogicManager -> AddressBookParser : parseCommand("find ...") +activate AddressBookParser + +create FindCommandParser +AddressBookParser -> FindCommandParser +activate FindCommandParser + +create FindCommand +FindCommandParser -> FindCommand : : parse("find ...") +activate FindCommand + +FindCommand --> FindCommandParser +deactivate FindCommand + +FindCommandParser --> AddressBookParser +deactivate FindCommandParser + +'Hidden arrow to position the destroy marker below the end of the activation bar. +FindCommandParser -[hidden]-> AddressBookParser +destroy FindCommandParser + +AddressBookParser --> LogicManager +deactivate AddressBookParser + +LogicManager -> FindCommand : execute() +activate FindCommand + +FindCommand -> Model : find(person) +activate Model + +Model --> FindCommand +deactivate Model + +create CommandResult +FindCommand -> CommandResult +activate CommandResult + +CommandResult --> FindCommand : result +deactivate CommandResult + +FindCommand --> LogicManager : result +deactivate FindCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/images/FindPersonSequenceDiagram.png b/docs/images/FindPersonSequenceDiagram.png new file mode 100644 index 00000000000..f11a348a14d Binary files /dev/null and b/docs/images/FindPersonSequenceDiagram.png differ