forked from AY2324S2-CS2103T-T08-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-T08-1#232 from laney0808/dg
DG: Lan Yu
- Loading branch information
Showing
11 changed files
with
277 additions
and
106 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":ImmuniMateParser" as ImmuniMateParser LOGIC_COLOR | ||
participant ":CreateCommandParser" as CreateCommandParser LOGIC_COLOR | ||
participant "c:CreateCommand" as CreateCommand 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 | ||
|
||
[-> LogicManager : execute("create ...") | ||
activate LogicManager | ||
LogicManager -> ImmuniMateParser : parseCommand("create ...") | ||
activate ImmuniMateParser | ||
|
||
create CreateCommandParser | ||
ImmuniMateParser -> CreateCommandParser | ||
activate CreateCommandParser | ||
CreateCommandParser --> ImmuniMateParser | ||
deactivate CreateCommandParser | ||
ImmuniMateParser -> CreateCommandParser : parse("...") | ||
activate CreateCommandParser | ||
|
||
create CreateCommand | ||
CreateCommandParser -> CreateCommand | ||
activate CreateCommand | ||
CreateCommand --> CreateCommandParser | ||
deactivate CreateCommand | ||
CreateCommandParser --> ImmuniMateParser : c | ||
deactivate CreateCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
CreateCommandParser -[hidden]-> ImmuniMateParser | ||
destroy CreateCommandParser | ||
ImmuniMateParser --> LogicManager : c | ||
deactivate ImmuniMateParser | ||
LogicManager -> CreateCommand : execute() | ||
activate CreateCommand | ||
CreateCommand -> Model : hasPerson(...) | ||
activate Model | ||
Model --> CreateCommand : false | ||
deactivate Model | ||
CreateCommand -> Model : addPerson(...) | ||
activate Model | ||
Model --> CreateCommand : add person in the model | ||
deactivate Model | ||
|
||
create CommandResult | ||
CreateCommand -> CommandResult | ||
activate CommandResult | ||
CommandResult --> CreateCommand | ||
deactivate | ||
CreateCommand --> LogicManager : r | ||
deactivate CreateCommand | ||
|
||
[<--LogicManager : r | ||
deactivate LogicManager | ||
@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
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,76 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
box Logic LOGIC_COLOR_T1 | ||
participant "l:Logic" as Logic LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":ModelManager" as ModelManager MODEL_COLOR | ||
participant ":ImmuniMate" as ImmuniMate MODEL_COLOR | ||
participant ":UniquePersonList" as UniquePersonList MODEL_COLOR | ||
participant "internalList: ObservableList<Person>" as internalList MODEL_COLOR | ||
participant "p:Person" as p MODEL_COLOR | ||
end box | ||
|
||
[-> Logic : execute() | ||
activate Logic | ||
|
||
Logic -> ModelManager : hasPerson(p) | ||
activate ModelManager | ||
|
||
ModelManager -> ImmuniMate: hasPerson(p) | ||
activate ImmuniMate | ||
|
||
ImmuniMate --> UniquePersonList : contains(p) | ||
activate UniquePersonList | ||
|
||
UniquePersonList -> internalList : stream().anyMatch(p::isSamePerson) | ||
activate internalList | ||
|
||
internalList -> p : isSamePerson(p) | ||
activate p | ||
|
||
p --> internalList | ||
deactivate p | ||
|
||
internalList --> UniquePersonList | ||
deactivate internalList | ||
|
||
UniquePersonList --> ImmuniMate | ||
deactivate UniquePersonList | ||
|
||
ImmuniMate --> ModelManager | ||
deactivate ImmuniMate | ||
|
||
ModelManager --> Logic | ||
deactivate ModelManager | ||
|
||
Logic -> ModelManager : deletePerson(p) | ||
activate ModelManager | ||
|
||
ModelManager -> ImmuniMate: deletePerson(p) | ||
activate ImmuniMate | ||
|
||
ImmuniMate -> UniquePersonList : remove(p) | ||
activate UniquePersonList | ||
|
||
UniquePersonList -> internalList : remove(p) | ||
activate internalList | ||
|
||
internalList --> UniquePersonList | ||
deactivate internalList | ||
|
||
UniquePersonList --> ImmuniMate | ||
deactivate UniquePersonList | ||
|
||
ImmuniMate --> ModelManager | ||
deactivate ImmuniMate | ||
|
||
ModelManager --> Logic | ||
deactivate ModelManager | ||
|
||
[<--Logic | ||
deactivate Logic | ||
|
||
@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
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 |
---|---|---|
|
@@ -157,3 +157,4 @@ private boolean personsAreUnique(List<Person> persons) { | |
return true; | ||
} | ||
} | ||
|