Skip to content

Commit

Permalink
Merge pull request #354 from mfjkri/update-dg-diagrams
Browse files Browse the repository at this point in the history
Update sequence diagrams
  • Loading branch information
dishenggg authored Nov 13, 2023
2 parents 7fa960b + 9c6a9a9 commit 58c233e
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 54 deletions.
8 changes: 8 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,18 @@ The `Storage` component,
Classes used by multiple components are in the `seedu.addressbook.commons` package.

<div style="page-break-after: always;"></div>

## **Implementation**

This section describes some noteworthy details on how certain features are implemented.

<div markdown="span" class="alert alert-info">

:information_source: **Note:**
For simplicity, some details such as parsing (`parseIndex`, `parseName`, etc) have been omitted from the implementation details below.

</div>

### Add tutor feature

The "Add Tutor" feature allows users to add a new tutor to the address book. Below, we provide an example usage scenario and a detailed description of how the add tutor mechanism behaves at each step.
Expand Down
7 changes: 3 additions & 4 deletions docs/diagrams/AddScheduleSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":AddSchedule\nCommandParser" as AddScheduleCommandParser LOGIC_COLOR
participant "add-s:AddSchedule\nCommand" as AddScheduleCommand LOGIC_COLOR
participant "result:CommandResult" as CommandResult LOGIC_COLOR

participant "s:Schedule" as Schedule MODEL_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "s:Schedule" as Schedule MODEL_COLOR
end box
[-> LogicManager : execute("add-s 1\nst/2023-09-15T09:00\n et/2023-09-15T11:00")
activate LogicManager
Expand All @@ -36,7 +35,7 @@ create AddScheduleCommand
AddScheduleCommandParser -> AddScheduleCommand
activate AddScheduleCommand

AddScheduleCommand -> AddScheduleCommandParser
AddScheduleCommand --> AddScheduleCommandParser : add-s
deactivate AddScheduleCommand


Expand All @@ -46,7 +45,7 @@ deactivate AddScheduleCommandParser
AddScheduleCommandParser -[hidden]-> AddressBookParser
destroy AddScheduleCommandParser

AddressBookParser --> LogicManager
AddressBookParser --> LogicManager : add-s
deactivate AddressBookParser

LogicManager -> AddScheduleCommand : execute()
Expand Down
8 changes: 4 additions & 4 deletions docs/diagrams/AddTutorSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":AddTutorCommandParser" as AddTutorCommandParser LOGIC_COLOR
participant "person:Person" as Person MODEL_COLOR
participant "d:AddTutorCommand" as AddTutorCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
Expand Down Expand Up @@ -67,12 +67,12 @@ create CommandResult
AddTutorCommand -> CommandResult
activate CommandResult

CommandResult --> AddTutorCommand
CommandResult --> AddTutorCommand : r
deactivate CommandResult

AddTutorCommand --> LogicManager : result
AddTutorCommand --> LogicManager : r
deactivate AddTutorCommand

[<--LogicManager
[<--LogicManager : r
deactivate LogicManager
@enduml
10 changes: 5 additions & 5 deletions docs/diagrams/ChangeThemeSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
!include style.puml
skinparam ArrowFontStyle plain
box Ui UI_COLOR_T1
participant ":MainWindow" as Ui UI_COLOR
participant ":Ui" as Ui UI_COLOR
end box

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":ThemeCommandParser" as ThemeCommandParser LOGIC_COLOR
participant "c:ThemeCommand" as ThemeCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

[-> Ui :
Expand Down Expand Up @@ -55,13 +55,13 @@ create CommandResult
ThemeCommand -> CommandResult
activate CommandResult

CommandResult --> ThemeCommand : result
CommandResult --> ThemeCommand : r
deactivate CommandResult

ThemeCommand --> LogicManager : result
ThemeCommand --> LogicManager : r
deactivate ThemeCommand

LogicManager --> Ui : result
LogicManager --> Ui : r
deactivate LogicManager

Ui -> Ui : handle\nChange\nTheme()
Expand Down
32 changes: 22 additions & 10 deletions docs/diagrams/EditScheduleSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":EditSchedule\nCommandParser" as EditScheduleCommandParser LOGIC_COLOR
participant "e:EditSchedule\nDescriptor" as EditScheduleDescriptor LOGIC_COLOR
participant "d:EditSchedule\nCommand" as EditScheduleCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "s:Schedule" as EditedSchedule MODEL_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "editedSchedule:Schedule" as EditedSchedule MODEL_COLOR
end box

[-> LogicManager : execute("edit-s 1\n st/2023-09-15T09:00")
Expand Down Expand Up @@ -58,28 +58,40 @@ deactivate AddressBookParser
LogicManager -> EditScheduleCommand : execute()
activate EditScheduleCommand

EditScheduleCommand -> Model ++ : getFilteredPersonList()
return

create EditedSchedule
EditScheduleCommand -> EditedSchedule ++
return s
EditScheduleCommand -> Model ++ : hasSchedule(s)
return
EditScheduleCommand -> Model ++ : hasSchedule(editedSchedule)

EditScheduleCommand -> Model ++ : getAddressBook()
return
EditScheduleCommand -> Model ++ : setSchedule(scheduleToEdit, editedSchedule)

loop number of schedules in model
EditScheduleCommand -> EditedSchedule : isClashing(s)
activate EditedSchedule
EditedSchedule --> EditScheduleCommand
deactivate EditedSchedule
end

EditScheduleCommand -> Model ++ : setSchedule(scheduleToEdit, s)
return
EditScheduleCommand -> Model ++ : updateFilteredScheduleList()
deactivate Model

deactivate Model
return

create CommandResult
EditScheduleCommand -> CommandResult
activate CommandResult

CommandResult --> EditScheduleCommand
CommandResult --> EditScheduleCommand : r
deactivate CommandResult

EditScheduleCommand --> LogicManager : result
EditScheduleCommand --> LogicManager : r
deactivate EditScheduleCommand

[<--LogicManager
[<--LogicManager : r
deactivate LogicManager
@enduml
12 changes: 6 additions & 6 deletions docs/diagrams/EditTutorSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":EditTutorCommandParser" as EditTutorCommandParser LOGIC_COLOR
participant "d:EditTutorCommand" as EditTutorCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "e:Person" as EditedPerson MODEL_COLOR
end box

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

[-> LogicManager : execute("edit-t 1 n/New Name")
Expand Down Expand Up @@ -52,7 +52,7 @@ activate EditTutorCommand

create EditedPerson
EditTutorCommand -> EditedPerson ++
return
return e

EditTutorCommand -> Model ++ : hasPerson(e)
return
Expand All @@ -73,12 +73,12 @@ create CommandResult
EditTutorCommand -> CommandResult
activate CommandResult

CommandResult --> EditTutorCommand
CommandResult --> EditTutorCommand : r
deactivate CommandResult

EditTutorCommand --> LogicManager : result
EditTutorCommand --> LogicManager : r
deactivate EditTutorCommand

[<--LogicManager
[<--LogicManager : r
deactivate LogicManager
@enduml
8 changes: 4 additions & 4 deletions docs/diagrams/FindTutorSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":FindTutorCommandParser" as FindTutorCommandParser LOGIC_COLOR
participant "e:NameContains\nKeywordsPredicate" as NameContainsKeywordsPredicate LOGIC_COLOR
participant "d:FindTutor\nCommand" as FindTutorCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
Expand Down Expand Up @@ -66,12 +66,12 @@ create CommandResult
FindTutorCommand -> CommandResult
activate CommandResult

CommandResult --> FindTutorCommand
CommandResult --> FindTutorCommand : r
deactivate CommandResult

FindTutorCommand --> LogicManager : result
FindTutorCommand --> LogicManager : r
deactivate FindTutorCommand

[<--LogicManager
[<--LogicManager : r
deactivate LogicManager
@enduml
14 changes: 7 additions & 7 deletions docs/diagrams/MarkScheduleSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":MarkScheduleCommandParser" as MarkScheduleCommandParser LOGIC_COLOR
participant "d:MarkScheduleCommand" as MarkScheduleCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "e:Schedule" as EditedSchedule MODEL_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "edited:Schedule" as EditedSchedule MODEL_COLOR
end box

[-> LogicManager : execute("mark 1 m/1")
Expand Down Expand Up @@ -53,9 +53,9 @@ activate MarkScheduleCommand

create EditedSchedule
MarkScheduleCommand -> EditedSchedule ++
return
return e

MarkScheduleCommand -> Model ++ : setSchedule(scheduleToEdit, editedSchedule)
MarkScheduleCommand -> Model ++ : setSchedule(scheduleToEdit, e)
return

MarkScheduleCommand -> Model ++ : updateFilteredScheduleList()
Expand All @@ -67,12 +67,12 @@ create CommandResult
MarkScheduleCommand -> CommandResult
activate CommandResult

CommandResult --> MarkScheduleCommand
CommandResult --> MarkScheduleCommand : r
deactivate CommandResult

MarkScheduleCommand --> LogicManager : result
MarkScheduleCommand --> LogicManager : r
deactivate MarkScheduleCommand

[<--LogicManager
[<--LogicManager: r
deactivate LogicManager
@enduml
8 changes: 4 additions & 4 deletions docs/diagrams/ShowCalendarSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":ShowCalendarCommandParser" as ShowCalendarCommandParser LOGIC_COLOR
participant "d:ShowCalendarCommand" as ShowCalendarCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
Expand Down Expand Up @@ -61,12 +61,12 @@ create CommandResult
ShowCalendarCommand -> CommandResult
activate CommandResult

CommandResult --> ShowCalendarCommand
CommandResult --> ShowCalendarCommand : r
deactivate CommandResult

ShowCalendarCommand --> LogicManager : result
ShowCalendarCommand --> LogicManager : r
deactivate ShowCalendarCommand

[<--LogicManager
[<--LogicManager : r
deactivate LogicManager
@enduml
19 changes: 9 additions & 10 deletions docs/diagrams/UnmarkScheduleSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":UnmarkScheduleCommandParser" as UnmarkScheduleCommandParser LOGIC_COLOR
participant "d:UnmarkScheduleCommand" as UnmarkScheduleCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "e:Schedule" as EditedSchedule MODEL_COLOR

end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "edited:Schedule" as EditedSchedule MODEL_COLOR
end box

[-> LogicManager : execute("unmark 1")
Expand Down Expand Up @@ -52,24 +53,22 @@ activate UnmarkScheduleCommand

create EditedSchedule
UnmarkScheduleCommand -> EditedSchedule ++
return
UnmarkScheduleCommand -> Model ++ : setSchedule(scheduleToEdit, edited)
return e
UnmarkScheduleCommand -> Model ++ : setSchedule(scheduleToEdit, e)
return
UnmarkScheduleCommand -> Model ++ : updateFilteredScheduleList()
deactivate Model

deactivate Model
return

create CommandResult
UnmarkScheduleCommand -> CommandResult
activate CommandResult

CommandResult --> UnmarkScheduleCommand
CommandResult --> UnmarkScheduleCommand: r
deactivate CommandResult

UnmarkScheduleCommand --> LogicManager : result
UnmarkScheduleCommand --> LogicManager : r
deactivate UnmarkScheduleCommand

[<--LogicManager
[<--LogicManager: r
deactivate LogicManager
@enduml
Binary file modified docs/images/AddScheduleSequenceDiagram.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/AddTutorSequenceDiagram.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/ChangeThemeSequenceDiagram.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/EditScheduleSequenceDiagram.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/EditTutorSequenceDiagram.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/FindTutorSequenceDiagram.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/MarkScheduleSequenceDiagram.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/ShowCalendarSequenceDiagram.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/UnmarkScheduleSequenceDiagram.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 58c233e

Please sign in to comment.