From d5b1bd6eaa90c9d2af26254df8f3252fe87ac7a7 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Wed, 20 Mar 2024 18:47:41 +0800 Subject: [PATCH] Add Uml file (sequence diagram) for AddCommand --- docs/diagrams/AddSequenceDiagram.puml | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/diagrams/AddSequenceDiagram.puml diff --git a/docs/diagrams/AddSequenceDiagram.puml b/docs/diagrams/AddSequenceDiagram.puml new file mode 100644 index 00000000000..80d83b28ade --- /dev/null +++ b/docs/diagrams/AddSequenceDiagram.puml @@ -0,0 +1,70 @@ +@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 ":AddCommandParser" as AddCommandParser LOGIC_COLOR +participant "a:AddCommand" as AddCommand LOGIC_COLOR +participant "r:CommandResult" as CommandResult LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant "m:Model" as Model MODEL_COLOR +end box +'add parameters of add command here' +[-> LogicManager : execute("add") +activate LogicManager +'add parameters of add command here' +LogicManager -> AddressBookParser : parseCommand("add ") +activate AddressBookParser + +create AddCommandParser +AddressBookParser -> AddCommandParser +activate AddCommandParser + +AddCommandParser --> AddressBookParser +deactivate AddCommandParser +'add parameters of add command here; replace '1'' +AddressBookParser -> AddCommandParser : parse("1") +activate AddCommandParser + +create AddCommand +AddCommandParser -> AddCommand +activate AddCommand + +AddCommand --> AddCommandParser : +deactivate AddCommand + +AddCommandParser --> AddressBookParser : a +deactivate AddCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +AddCommandParser -[hidden]-> AddressBookParser +destroy AddCommandParser + +AddressBookParser --> LogicManager : a +deactivate AddressBookParser + +LogicManager -> AddCommand : execute(m) +activate AddCommand +'add parameters of add command here; replace '1'' +AddCommand -> Model : AddPerson(1) +activate Model + +Model --> AddCommand +deactivate Model + +create CommandResult +AddCommand -> CommandResult +activate CommandResult + +CommandResult --> AddCommand +deactivate CommandResult + +AddCommand --> LogicManager : r +deactivate AddCommand + +[<--LogicManager +deactivate LogicManager +@enduml