forked from AY2324S2-CS2103T-T15-1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AY2324S2-CS2103T-T15-1#249 from alfaloo/debug
Add execute sequence diagrams
- Loading branch information
Showing
10 changed files
with
240 additions
and
1 deletion.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
docs/diagrams/AddPatientCommandExecuteSequenceDiagram.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":AddPatientCommand" as AddPatientCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Commons LOGGER_COLOR_T1 | ||
participant ":Logger" as Logger LOGGER_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> AddPatientCommand : execute() | ||
activate AddPatientCommand | ||
|
||
|
||
AddPatientCommand -> Logger: log(Level.INFO, "Duplicate") | ||
activate Logger | ||
Logger -> Logger: log | ||
Logger -> AddPatientCommand | ||
deactivate Logger | ||
|
||
|
||
alt model.hasPerson(toAdd) | ||
AddPatientCommand -> Model: hasPerson(toAdd) | ||
activate Model | ||
Model -> AddPatientCommand | ||
deactivate Model | ||
[<--AddPatientCommand: throw CommandException() | ||
else else | ||
AddPatientCommand -> Model : hasPerson(toAdd) | ||
activate Model | ||
|
||
Model --> AddPatientCommand | ||
|
||
AddPatientCommand -> Model : addPerson(toAdd) | ||
|
||
Model --> AddPatientCommand | ||
deactivate Model | ||
|
||
AddPatientCommand -> Logger: log(Level.INFO, "Success") | ||
activate Logger | ||
Logger -> Logger: log | ||
Logger -> AddPatientCommand | ||
deactivate Logger | ||
|
||
create CommandResult | ||
AddPatientCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddPatientCommand : result | ||
deactivate CommandResult | ||
|
||
[<--AddPatientCommand : result | ||
deactivate AddPatientCommand | ||
end | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":DeleteCommand" as DeleteCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Commons LOGGER_COLOR_T1 | ||
participant ":Index" as Index LOGGER_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> DeleteCommand : execute() | ||
activate DeleteCommand | ||
|
||
DeleteCommand -> Model: getFilteredPersonList() | ||
activate Model | ||
Model -> DeleteCommand | ||
deactivate Model | ||
|
||
alt index.getZeroBased() >= lastShownList.size() | ||
DeleteCommand -> Index: getZeroBased() | ||
activate Index | ||
Index -> DeleteCommand | ||
deactivate Index | ||
|
||
[<--DeleteCommand: throw CommandException() | ||
else else | ||
DeleteCommand -> Index: getZeroBased() | ||
activate Index | ||
Index -> DeleteCommand | ||
deactivate Index | ||
|
||
DeleteCommand -> Model : deletePerson(personToDelete) | ||
activate Model | ||
|
||
Model --> DeleteCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
DeleteCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> DeleteCommand : result | ||
deactivate CommandResult | ||
|
||
[<--DeleteCommand : result | ||
deactivate DeleteCommand | ||
end | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":EditCommand" as EditCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Commons LOGGER_COLOR_T1 | ||
participant ":Index" as Index LOGGER_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> EditCommand : execute() | ||
activate EditCommand | ||
|
||
EditCommand -> Model: getFilteredPersonList() | ||
activate Model | ||
Model -> EditCommand | ||
deactivate Model | ||
|
||
alt index.getZeroBased() >= lastShownList.size() | ||
EditCommand -> Index: getZeroBased() | ||
activate Index | ||
Index -> EditCommand | ||
deactivate Index | ||
|
||
[<--EditCommand: throw CommandException() | ||
else else | ||
EditCommand -> Index: getZeroBased() | ||
activate Index | ||
Index -> EditCommand | ||
deactivate Index | ||
|
||
EditCommand -> EditCommand: createEditedPerson(personToEdit, editPersonDescriptor) | ||
alt model.hasPerson(editedPerson) | ||
EditCommand -> Model: hasPerson(editedPerson) | ||
activate Model | ||
Model -> EditCommand | ||
deactivate Model | ||
[<--EditCommand: throw CommandException() | ||
else else | ||
EditCommand -> Model : hasPerson(editedPerson) | ||
activate Model | ||
|
||
Model --> EditCommand | ||
|
||
EditCommand -> Model : setPerson(personToEdit, editedPerson) | ||
|
||
Model --> EditCommand | ||
|
||
EditCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS); | ||
|
||
Model --> EditCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
EditCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> EditCommand : result | ||
deactivate CommandResult | ||
|
||
[<--EditCommand : result | ||
deactivate EditCommand | ||
end | ||
end | ||
|
||
@enduml |
44 changes: 44 additions & 0 deletions
44
docs/diagrams/QueryPatientCommandExecuteSequenceDiagram.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":QueryPatientCommand" as QueryPatientCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Commons LOGGER_COLOR_T1 | ||
participant ":Logger" as Logger LOGGER_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> QueryPatientCommand : execute() | ||
activate QueryPatientCommand | ||
|
||
QueryPatientCommand -> Model : updateFilteredPersonList(predicate) | ||
activate Model | ||
|
||
Model --> QueryPatientCommand | ||
|
||
deactivate Model | ||
|
||
QueryPatientCommand -> Logger: log(Level.INFO, "Success") | ||
activate Logger | ||
Logger -> Logger: log | ||
Logger -> QueryPatientCommand | ||
deactivate Logger | ||
|
||
create CommandResult | ||
QueryPatientCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> QueryPatientCommand : result | ||
deactivate CommandResult | ||
|
||
[<--QueryPatientCommand : result | ||
deactivate QueryPatientCommand | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters