diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index b7f84ae004b..8808eccf0ad 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -370,7 +370,7 @@ In this section, we focus only on `FindCommand`, which is strictly the more comp The following class diagram shows all classes involved: -CLASS DIAGRAM GOES HERE +![FindCommandClassDiagram.png](images/FindCommandClassDiagram.png) To illustrate how everything works together, we trace the flow of execution as the user searches for `Tom / Sam`. Details involving `MainWindow` and `LogicManager` are ignored, especially since they are common across all commands. @@ -386,6 +386,9 @@ Step 5. `FindCommand` calls `updateFilteredPersonList` of the `Model`, which ref Step 6. The `list` command stops here, and execution is returned to the `LogicManager`, and then `MainWindow`. The `MainWindow` shows text feedback, together with the updated list of fosterers. + +The following diagram ignores details for `SearchPredicate`, which will be covered shortly: + ![FindCommandSequenceDiagram.png](images/FindCommandSequenceDiagram.png) diff --git a/docs/diagrams/FindCommandClassDiagram.puml b/docs/diagrams/FindCommandClassDiagram.puml new file mode 100644 index 00000000000..033a3de8922 --- /dev/null +++ b/docs/diagrams/FindCommandClassDiagram.puml @@ -0,0 +1,44 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam classBackgroundColor UI_COLOR + +package search <> { + Class FindCommandArgumentParser + Class SearchPredicate + Class "{abstract}\nSearchMatcher" as SearchMatcher + Class "{abstract}\nBinarySearchMatcher" as BinarySearchMatcher + Class AndSearchMatcher + Class OrSearchMatcher + Class NotSearchMatcher + Class SingleTextSearchMatcher + Class FieldRanges + Class Range +} + +package parser <> { + Class FindCommandParser +} + +package commands <> { + Class FindCommand +} + +FindCommandParser .> FindCommandArgumentParser +FindCommandParser .> FindCommand +FindCommandArgumentParser .> SearchPredicate + +FindCommand *--> SearchPredicate +SearchPredicate *--> SearchMatcher + +FieldRanges *-right-> Range + +SearchMatcher .> FieldRanges +SearchMatcher <|-- BinarySearchMatcher +SearchMatcher <|-- SingleTextSearchMatcher +SearchMatcher <|-- NotSearchMatcher + +BinarySearchMatcher <|-- AndSearchMatcher +BinarySearchMatcher <|-- OrSearchMatcher + +@enduml diff --git a/docs/images/FindCommandClassDiagram.png b/docs/images/FindCommandClassDiagram.png new file mode 100644 index 00000000000..5a429e6b1a0 Binary files /dev/null and b/docs/images/FindCommandClassDiagram.png differ