Skip to content

Commit

Permalink
Merge branch 'alex-setyawan-developer-guide-3' into upstream
Browse files Browse the repository at this point in the history
* alex-setyawan-developer-guide-3:
  Edit diagram for deleteinfo command
  Fix format issues, add implementation of find and cluster commands
  Add sequence diagram images
  Add another update command sequence diagram
  Add cluster, find and update logic sequence diagrams

# Conflicts:
#	docs/DeveloperGuide.md
#	docs/diagrams/DeleteInfoModelDiagram.puml
#	docs/images/DeleteInfoModelDiagram.png
  • Loading branch information
laney0808 committed Apr 15, 2024
2 parents 17e71c9 + 791635f commit 57f51b6
Show file tree
Hide file tree
Showing 18 changed files with 419 additions and 61 deletions.
151 changes: 105 additions & 46 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Participant ":Storage" as storage STORAGE_COLOR
user -[USER_COLOR]> ui : "delete S1234567X"
activate ui UI_COLOR

ui -[UI_COLOR]> logic : execute("delete X1234567X")
ui -[UI_COLOR]> logic : execute("delete S1234567X")
activate logic LOGIC_COLOR

logic -[LOGIC_COLOR]> model : deletePerson(p)
Expand Down
63 changes: 63 additions & 0 deletions docs/diagrams/ClusterLogicModelDiagram.puml
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 ":ClusterCommandParser" as ClusterCommandParser LOGIC_COLOR
participant "c:ClusterCommand" as ClusterCommand 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("cluster 50 ...")
activate LogicManager
LogicManager -> ImmuniMateParser : parseCommand("cluster 50 ...")
activate ImmuniMateParser

create ClusterCommandParser
ImmuniMateParser -> ClusterCommandParser
activate ClusterCommandParser
ClusterCommandParser --> ImmuniMateParser
deactivate ClusterCommandParser
ImmuniMateParser -> ClusterCommandParser : parse("50 ...")
activate ClusterCommandParser

create ClusterCommand
ClusterCommandParser -> ClusterCommand
activate ClusterCommand
ClusterCommand --> ClusterCommandParser
deactivate ClusterCommand
ClusterCommandParser --> ImmuniMateParser : c
deactivate ClusterCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
ClusterCommandParser -[hidden]-> ImmuniMateParser
destroy ClusterCommandParser
ImmuniMateParser --> LogicManager : c
deactivate ImmuniMateParser
LogicManager -> ClusterCommand : execute(m)
activate ClusterCommand
ClusterCommand -> Model : updateFilteredPersonList(...)
activate Model
Model --> ClusterCommand
deactivate Model
ClusterCommand -> Model : getFilteredPersonList(...)
activate Model
Model --> ClusterCommand
deactivate Model

create CommandResult
ClusterCommand -> CommandResult
activate CommandResult
CommandResult --> ClusterCommand
deactivate
ClusterCommand --> LogicManager : r
deactivate ClusterCommand

[<--LogicManager : r
deactivate LogicManager
@enduml
16 changes: 11 additions & 5 deletions docs/diagrams/DeleteInfoModelDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ end box
[-> CreateCommand : execute()
activate CreateCommand

CreateCommand -> ModelManager : getFilteredPersonsList()
activate ModelManager

ModelManager --> CreateCommand : persons
deactivate ModelManager

CreateCommand -> ModelManager : hasPerson(...)
activate ModelManager

Expand All @@ -32,19 +38,19 @@ activate internalList
internalList -> p1 : isSamePerson(p1)
activate p1

p1 --> internalList
p1 --> internalList : true
deactivate p1

internalList --> UniquePersonList
internalList --> UniquePersonList : true
deactivate internalList

UniquePersonList --> ImmuniMate
UniquePersonList --> ImmuniMate : true
deactivate UniquePersonList

ImmuniMate --> ModelManager
ImmuniMate --> ModelManager : true
deactivate ImmuniMate

ModelManager --> CreateCommand
ModelManager --> CreateCommand : true
deactivate ModelManager

CreateCommand -> ModelManager : getFilteredPersonList()
Expand Down
9 changes: 8 additions & 1 deletion docs/diagrams/DeleteInfoSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ deactivate ImmuniMateParser
LogicManager -> DeleteInfoCommand : execute(m)
activate DeleteInfoCommand

DeleteInfoCommand -> Model : getFilteredPersonsList()
activate Model

Model --> DeleteInfoCommand : persons
deactivate Model

DeleteInfoCommand -> Model : hasPerson(...)
activate Model
Model --> DeleteInfoCommand : false

Model --> DeleteInfoCommand : true
deactivate Model

DeleteInfoCommand -> Model : getFilteredPersonList().filtered().get(0)
Expand Down
59 changes: 59 additions & 0 deletions docs/diagrams/FindLogicModelDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@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 ":FindCommandParser" as FindCommandParser LOGIC_COLOR
participant "f:FindCommand" as FindCommand 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("find ...")
activate LogicManager
LogicManager -> ImmuniMateParser : parseCommand("find ...")
activate ImmuniMateParser

create FindCommandParser
ImmuniMateParser -> FindCommandParser
activate FindCommandParser
FindCommandParser --> ImmuniMateParser
deactivate FindCommandParser
ImmuniMateParser -> FindCommandParser : parse("...")
activate FindCommandParser

create FindCommand
FindCommandParser -> FindCommand
activate FindCommand
FindCommand --> FindCommandParser
deactivate FindCommand
FindCommandParser --> ImmuniMateParser : f
deactivate FindCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
FindCommandParser -[hidden]-> ImmuniMateParser
destroy FindCommandParser
ImmuniMateParser --> LogicManager : f
deactivate ImmuniMateParser
LogicManager -> FindCommand : execute(m)
activate FindCommand
FindCommand -> Model : updateFilteredPersonList(...)
activate Model
Model --> FindCommand
deactivate Model

create CommandResult
FindCommand -> CommandResult
activate CommandResult
CommandResult --> FindCommand
deactivate
FindCommand --> LogicManager : r
deactivate FindCommand

[<--LogicManager : r
deactivate LogicManager
@enduml
7 changes: 3 additions & 4 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Package Model as ModelPackage <<Rectangle>>{
Class "<<interface>>\nReadOnlyAddressBook" as ReadOnlyAddressBook
Class "<<interface>>\nReadOnlyImmuniMate" as ReadOnlyImmuniMate
Class "<<interface>>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs
Class "<<interface>>\nModel" as Model
Class ImmuniMate
Class ModelManager
Class UserPrefs

Class UniquePersonList
Class Person
Class Address
Expand All @@ -37,11 +36,11 @@ Class I #FFFFFF
Class HiddenOutside #FFFFFF
HiddenOutside ..> Model

ImmuniMate .up.|> ReadOnlyAddressBook
ImmuniMate .up.|> ReadOnlyImmuniMate

ModelManager .up.|> Model
Model .right.> ReadOnlyUserPrefs
Model .left.> ReadOnlyAddressBook
Model .left.> ReadOnlyImmuniMate
ModelManager -left-> "1" ImmuniMate
ModelManager -right-> "1" UserPrefs
UserPrefs .up.|> ReadOnlyUserPrefs
Expand Down
8 changes: 4 additions & 4 deletions docs/diagrams/ParserClasses.puml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Class XYZCommand

package "Parser classes"{
Class "<<interface>>\nParser" as Parser
Class AddressBookParser
Class ImmuniMateParser
Class XYZCommandParser
Class CliSyntax
Class ParserUtil
Expand All @@ -19,12 +19,12 @@ Class Prefix
}

Class HiddenOutside #FFFFFF
HiddenOutside ..> AddressBookParser
HiddenOutside ..> ImmuniMateParser

AddressBookParser .down.> XYZCommandParser: <<create>>
ImmuniMateParser .down.> XYZCommandParser: <<create>>

XYZCommandParser ..> XYZCommand : <<create>>
AddressBookParser ..> Command : <<use>>
ImmuniMateParser ..> Command : <<use>>
XYZCommandParser .up.|> Parser
XYZCommandParser ..> ArgumentMultimap
XYZCommandParser ..> ArgumentTokenizer
Expand Down
71 changes: 71 additions & 0 deletions docs/diagrams/UpdateLogicDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@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 ":UpdateCommandParser" as UpdateCommandParser LOGIC_COLOR
participant "u:UpdateCommand" as UpdateCommand 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("update T0123456A ...")
activate LogicManager
LogicManager -> ImmuniMateParser : parseCommand("update T0123456A ...")
activate ImmuniMateParser

create UpdateCommandParser
ImmuniMateParser -> UpdateCommandParser
activate UpdateCommandParser
UpdateCommandParser --> ImmuniMateParser
deactivate UpdateCommandParser
ImmuniMateParser -> UpdateCommandParser : parse("T0123456A ...")
activate UpdateCommandParser

create UpdateCommand
UpdateCommandParser -> UpdateCommand
activate UpdateCommand
UpdateCommand --> UpdateCommandParser
deactivate UpdateCommand
UpdateCommandParser --> ImmuniMateParser : u
deactivate UpdateCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
UpdateCommandParser -[hidden]-> ImmuniMateParser
destroy UpdateCommandParser
ImmuniMateParser --> LogicManager : u
deactivate ImmuniMateParser
LogicManager -> UpdateCommand : execute(m)
activate UpdateCommand
UpdateCommand -> Model : getFilteredPersonList()
activate Model
Model --> UpdateCommand : lastShownList
deactivate Model
UpdateCommand -> Model : hasPerson(...)
activate Model
Model --> UpdateCommand : true
deactivate Model
UpdateCommand -> Model : setPerson(...)
activate Model
Model --> UpdateCommand
deactivate Model
UpdateCommand -> Model : updateFilteredPersonList(...)
activate Model
Model --> UpdateCommand
deactivate Model

create CommandResult
UpdateCommand -> CommandResult
activate CommandResult
CommandResult --> UpdateCommand
deactivate
UpdateCommand --> LogicManager : r
deactivate UpdateCommand

[<--LogicManager : r
deactivate LogicManager
@enduml
Loading

0 comments on commit 57f51b6

Please sign in to comment.