Skip to content

Commit

Permalink
Merge pull request #260 from jiahui0309/edit-dg-implementation
Browse files Browse the repository at this point in the history
Fix DG features sequence diagrams
  • Loading branch information
jiahui0309 authored Apr 14, 2024
2 parents 8637fae + 7e78654 commit a16d989
Show file tree
Hide file tree
Showing 15 changed files with 297 additions and 65 deletions.
96 changes: 61 additions & 35 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

39 changes: 32 additions & 7 deletions docs/diagrams/AddCommandDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR
participant "d:AddCommand" as AddCommand LOGIC_COLOR
participant "p:Person" as Person 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

[-> LogicManager : execute("add n/John Doe p/12345678 \n e/[email protected] i/T0123456A ag/12 s/Male \n a/John street, block 123, #01-01")
note left of LogicManager
In the diagram, params refers to the following:
"n\John Doe p\12345678
e\[email protected] i\T0123456A ag\12 s\M
a\John street, block 123, #01-01"
end note

[-> LogicManager : execute("add params")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("add n/John Doe p/12345678 \n e/[email protected] i/T0123456A ag/12 s/Male \n a/John street, block 123, #01-01")
LogicManager -> AddressBookParser : parseCommand("add params")
activate AddressBookParser

create AddCommandParser
Expand All @@ -27,14 +35,21 @@ activate AddCommandParser
AddCommandParser --> AddressBookParser
deactivate AddCommandParser

AddressBookParser -> AddCommandParser : parse("add n/John Doe p/12345678 \n e/[email protected] i/T0123456A ag/12 s/Male \n a/John street, block 123, #01-01")
AddressBookParser -> AddCommandParser : parse("params")
activate AddCommandParser

create Person
AddCommandParser -> Person:
activate Person

Person --> AddCommandParser
deactivate Person

create AddCommand
AddCommandParser -> AddCommand
AddCommandParser -> AddCommand : new AddCommand(p)
activate AddCommand

AddCommand --> AddCommandParser :
AddCommand --> AddCommandParser : a
deactivate AddCommand

AddCommandParser --> AddressBookParser : a
Expand All @@ -49,7 +64,13 @@ deactivate AddressBookParser
LogicManager -> AddCommand : execute(m)
activate AddCommand

AddCommand -> Model : setPerson(T0123456A, \n new Person(John Doe, 12345678, ...))
AddCommand -> Model : hasPerson(p)
activate Model

Model --> AddCommand
deactivate Model

AddCommand -> Model : addPerson(p)
activate Model

Model --> AddCommand
Expand All @@ -65,6 +86,10 @@ deactivate CommandResult
AddCommand --> LogicManager : r
deactivate AddCommand

'Hidden arrow to position the destroy marker below the end of the activation bar.
AddCommand -[hidden]-> LogicManager
destroy AddCommand

[<--LogicManager
deactivate LogicManager
@enduml
69 changes: 60 additions & 9 deletions docs/diagrams/AddNoteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":AddNoteCommandParser" as AddNoteCommandParser LOGIC_COLOR
participant "n:AddNoteCommand" as AddNoteCommand LOGIC_COLOR
participant "i:IdentityCardNumberMatchesPredicate" as IdentityCardNumberPredicate LOGIC_COLOR
participant "n:Note" as Note LOGIC_COLOR
participant "a:AddNoteCommand" as AddNoteCommand LOGIC_COLOR
participant "p:Person" as Person 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("addnote \n i/T0123456A n/Covid")
note left of LogicManager
In the diagram, params refers to the following:
"T0123456A n\Covid"
end note

[-> LogicManager : execute("addnote params")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("addnote \n i/T0123456A n/Covid")
LogicManager -> AddressBookParser : parseCommand("addnote params")
activate AddressBookParser

create AddNoteCommandParser
Expand All @@ -27,29 +35,68 @@ activate AddNoteCommandParser
AddNoteCommandParser --> AddressBookParser
deactivate AddNoteCommandParser

AddressBookParser -> AddNoteCommandParser : parse("i/T0123456A n/Covid")
AddressBookParser -> AddNoteCommandParser : parse("params")
activate AddNoteCommandParser

create IdentityCardNumberPredicate
AddNoteCommandParser -> IdentityCardNumberPredicate:
activate IdentityCardNumberPredicate

IdentityCardNumberPredicate --> AddNoteCommandParser
deactivate IdentityCardNumberPredicate

create Note
AddNoteCommandParser -> Note:
activate Note

Note --> AddNoteCommandParser
deactivate Note

create AddNoteCommand
AddNoteCommandParser -> AddNoteCommand
AddNoteCommandParser -> AddNoteCommand : new AddNoteCommand(i, n, false)
activate AddNoteCommand

AddNoteCommand --> AddNoteCommandParser :
AddNoteCommand --> AddNoteCommandParser : a
deactivate AddNoteCommand

AddNoteCommandParser --> AddressBookParser : n
AddNoteCommandParser --> AddressBookParser : a
deactivate AddNoteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddNoteCommandParser -[hidden]-> AddressBookParser
destroy AddNoteCommandParser

AddressBookParser --> LogicManager : n
AddressBookParser --> LogicManager : a
deactivate AddressBookParser

LogicManager -> AddNoteCommand : execute(m)
activate AddNoteCommand

AddNoteCommand -> Model : setPerson(T0123456A, \n new Person(..., Covid, ...))
create Person
AddNoteCommand -> Person:
activate Person

Person --> AddNoteCommand
deactivate Person

AddNoteCommand -> Model : getPersonIfExists(...)
activate Model

Model --> AddNoteCommand
deactivate Model

AddNoteCommand -> Model : setPerson(...)
activate Model

Model --> AddNoteCommand
deactivate Model

AddNoteCommand -> Model : isPersonDisplayed(...)
activate Model

Model --> AddNoteCommand
deactivate Model

AddNoteCommand -> Model : setDisplayedNote(...)
activate Model

Model --> AddNoteCommand
Expand All @@ -65,6 +112,10 @@ deactivate CommandResult
AddNoteCommand --> LogicManager : r
deactivate AddNoteCommand

'Hidden arrow to position the destroy marker below the end of the activation bar.
AddNoteCommand -[hidden]-> LogicManager
destroy AddNoteCommand

[<--LogicManager
deactivate LogicManager
@enduml
22 changes: 20 additions & 2 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "p :IdentityCardNumberMatchesPredicate" as IdentityCardNumberMatchesPredicate LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box
Expand All @@ -30,11 +31,18 @@ deactivate DeleteCommandParser
AddressBookParser -> DeleteCommandParser : parse("S0123456A")
activate DeleteCommandParser

create IdentityCardNumberMatchesPredicate
DeleteCommandParser -> IdentityCardNumberMatchesPredicate
activate IdentityCardNumberMatchesPredicate

IdentityCardNumberMatchesPredicate --> DeleteCommandParser
deactivate IdentityCardNumberMatchesPredicate

create DeleteCommand
DeleteCommandParser -> DeleteCommand
DeleteCommandParser -> DeleteCommand : new DeleteCommand(p)
activate DeleteCommand

DeleteCommand --> DeleteCommandParser :
DeleteCommand --> DeleteCommandParser : d
deactivate DeleteCommand

DeleteCommandParser --> AddressBookParser : d
Expand All @@ -49,6 +57,12 @@ deactivate AddressBookParser
LogicManager -> DeleteCommand : execute(m)
activate DeleteCommand

DeleteCommand -> Model : getPersonIfExists(S0123456A)
activate Model

Model --> DeleteCommand
deactivate Model

DeleteCommand -> Model : deletePerson(S0123456A)
activate Model

Expand All @@ -65,6 +79,10 @@ deactivate CommandResult
DeleteCommand --> LogicManager : r
deactivate DeleteCommand

'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommand -[hidden]-> LogicManager
destroy DeleteCommand

[<--LogicManager
deactivate LogicManager
@enduml
57 changes: 50 additions & 7 deletions docs/diagrams/EditCommandDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@ box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":EditCommandParser" as EditCommandParser LOGIC_COLOR
participant "d:EditCommand" as EditCommand LOGIC_COLOR
participant "i:IdentityCardNumberMatchesPredicate" as IdentityCardNumberPredicate LOGIC_COLOR
participant "d:EditPersonDescriptor" as EditPersonDescriptor LOGIC_COLOR
participant "e:EditCommand" as EditCommand 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("edit T0123456A p/23456789")
note left of LogicManager
In the diagram, params refers to the following:
"T0123456A p\23456789"
end note

[-> LogicManager : execute("edit params")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("edit T0123456A p/23456789")
LogicManager -> AddressBookParser : parseCommand("edit params")
activate AddressBookParser

create EditCommandParser
Expand All @@ -27,14 +34,28 @@ activate EditCommandParser
EditCommandParser --> AddressBookParser
deactivate EditCommandParser

AddressBookParser -> EditCommandParser : parse("p/23456789")
AddressBookParser -> EditCommandParser : parse("params")
activate EditCommandParser

create IdentityCardNumberPredicate
EditCommandParser -> IdentityCardNumberPredicate:
activate IdentityCardNumberPredicate

IdentityCardNumberPredicate --> EditCommandParser
deactivate IdentityCardNumberPredicate

create EditPersonDescriptor
EditCommandParser -> EditPersonDescriptor:
activate EditPersonDescriptor

EditPersonDescriptor --> EditCommandParser
deactivate EditPersonDescriptor

create EditCommand
EditCommandParser -> EditCommand
EditCommandParser -> EditCommand : new EditCommand(i, d)
activate EditCommand

EditCommand --> EditCommandParser :
EditCommand --> EditCommandParser : e
deactivate EditCommand

EditCommandParser --> AddressBookParser : e
Expand All @@ -49,7 +70,25 @@ deactivate AddressBookParser
LogicManager -> EditCommand : execute(m)
activate EditCommand

EditCommand -> Model : setPerson(T0123456A, \n new Person(John Doe, 23456789, ...))
EditCommand -> Model : getPersonIfExists(...)
activate Model

Model --> EditCommand
deactivate Model

EditCommand -> Model : hasPerson(...)
activate Model

Model --> EditCommand
deactivate Model

EditCommand -> Model : setPerson(...)
activate Model

Model --> EditCommand
deactivate Model

EditCommand -> Model : updateFilteredPersonList(...)
activate Model

Model --> EditCommand
Expand All @@ -65,6 +104,10 @@ deactivate CommandResult
EditCommand --> LogicManager : r
deactivate EditCommand

'Hidden arrow to position the destroy marker below the end of the activation bar.
EditCommand -[hidden]-> LogicManager
destroy EditCommand

[<--LogicManager
deactivate LogicManager
@enduml
16 changes: 14 additions & 2 deletions docs/diagrams/FindSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR
participant "p :IdentityCardNumberMatchesPredicate" as IdentityCardNumberMatchesPredicate LOGIC_COLOR
participant "f:FindCommand" as FindCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box
Expand All @@ -30,11 +31,18 @@ deactivate FindCommandParser
AddressBookParser -> FindCommandParser : parse("S0123456A")
activate FindCommandParser

create IdentityCardNumberMatchesPredicate
FindCommandParser -> IdentityCardNumberMatchesPredicate
activate IdentityCardNumberMatchesPredicate

IdentityCardNumberMatchesPredicate --> FindCommandParser
deactivate IdentityCardNumberMatchesPredicate

create FindCommand
FindCommandParser -> FindCommand
FindCommandParser -> FindCommand : new FindCommand(p)
activate FindCommand

FindCommand --> FindCommandParser :
FindCommand --> FindCommandParser : f
deactivate FindCommand

FindCommandParser --> AddressBookParser : f
Expand Down Expand Up @@ -65,6 +73,10 @@ deactivate CommandResult
FindCommand --> LogicManager : r
deactivate FindCommand

'Hidden arrow to position the destroy marker below the end of the activation bar.
FindCommand -[hidden]-> LogicManager
destroy FindCommand

[<--LogicManager
deactivate LogicManager
@enduml
Loading

0 comments on commit a16d989

Please sign in to comment.