Skip to content

Commit

Permalink
Split copy person as refrence in the diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluiexo committed Apr 15, 2024
1 parent 925165d commit 9494519
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
5 changes: 2 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,9 @@ The operations for adding and deleting meeting are handled by `AddMeetingCommand
5. `Logic Manager` executes the `AddMeetingCommand` or `DeleteMeetingCommand`, which handles adding/removing meeting from the `Person` respectively and updates the model with the new information.

Below is the sequence diagram for parsing inputs with `AddMeetingCommandParser` executing `meeting-add 2 d/Finals s/20/04/2024 15:00`:

<br>![AddMeetingCommandParser Sequence Diagram](images/AddMeetingParserSequenceDiagram.png)

<br>Below in the in-depth reference of how `AddMeetingCommandParser` utilise `ParseUtil` to parse the arguments:
<br>![Add Parser Reference Diagram](images/AddParserRefrenceDiagram.png)

<br> Similarly, the sequence diagram for parsing inputs with `DeleteMeetingCommandParser` executing `meeting-delete 1 i/1`:
<br>![DeleteMeetingCommandParser Sequence Diagram](images/DeleteMeetingParserSequenceDiagram.png)
<br><br>
Expand All @@ -370,6 +367,8 @@ After parsing, the commands are executed by the logic manager as show below. (Ex
<br>![AddMeetingCommand Sequence Diagram](images/AddMeetingSequenceDiagram.png)
<br> Similarly the sequence diagram for deleting meeting with `DeleteMeetingCommand`:
<br>![DeleteMeetingCommand Sequence Diagram](images/DeleteMeetingSequenceDiagram.png)
<br> Below is the sequence diagram of how both `AddMeetingCommand` and `DeleteMeetingCommand` copies the selected person from the model for editing:
<br>![Copy selectedPerson](images/MeetingCopyPerson.png)

#### What are the design considered:

Expand Down
12 changes: 1 addition & 11 deletions docs/diagrams/AddMeetingSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ skinparam ArrowFontStyle plain
box Logic LOGIC_COLOR_T1
participant "m:AddMeetingCommand" as AddMeetingCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "<<class>>\nPersonUtil" as PersonUtil LOGIC_COLOR
participant "editedPerson:Person " as editedPerson LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as Model MODEL_COLOR
participant ":Person" as Person MODEL_COLOR
end box


Expand All @@ -22,15 +20,7 @@ AddMeetingCommand -> Model : getSortedFilteredPersonList()
activate Model
return


AddMeetingCommand -> PersonUtil : copyPerson(selectedPerson)
activate PersonUtil

create Person
PersonUtil -> Person++
return copiedPerson

return copiedPerson
ref over AddMeetingCommand : copy selectedPerson

AddMeetingCommand -> editedPerson : addMeeting()
activate editedPerson
Expand Down
11 changes: 1 addition & 10 deletions docs/diagrams/DeleteMeetingSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ skinparam ArrowFontStyle plain
box Logic LOGIC_COLOR_T1
participant "d:DeleteMeetingCommand" as DeleteMeetingCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "<<class>>\nPersonUtil" as PersonUtil LOGIC_COLOR
participant "editedPerson:Person " as editedPerson LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as Model MODEL_COLOR
participant ":Person" as Person MODEL_COLOR
end box

[-> DeleteMeetingCommand : execute(model)
Expand All @@ -21,14 +19,7 @@ DeleteMeetingCommand -> Model : getSortedFilteredPersonList()
activate Model
return

DeleteMeetingCommand -> PersonUtil : copyPerson(selectedPerson)
activate PersonUtil

create Person
PersonUtil -> Person++
return copiedPerson

return copiedPerson
ref over DeleteMeetingCommand : copy selectedPerson

DeleteMeetingCommand -> editedPerson : removeMeeting()
activate editedPerson
Expand Down
26 changes: 26 additions & 0 deletions docs/diagrams/MeetingCopyPerson.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

mainframe **sd** copy selectedPerson

box Logic LOGIC_COLOR_T1
participant ":[Add/Delete]MeetingCommand" as MeetingCommand LOGIC_COLOR
participant "<<class>>\nPersonUtil" as PersonUtil LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Person" as Person MODEL_COLOR
end box

activate MeetingCommand
MeetingCommand -> PersonUtil : copyPerson(selectedPerson)
activate PersonUtil

create Person
PersonUtil -> Person++
return copiedPerson

return copiedPerson

@enduml
Binary file modified docs/images/AddMeetingSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/DeleteMeetingSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/MeetingCopyPerson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9494519

Please sign in to comment.