Skip to content

Commit

Permalink
Add class diagram for find command
Browse files Browse the repository at this point in the history
  • Loading branch information
H1410101 committed Nov 13, 2023
1 parent 5717ba9 commit a9833cb
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)


Expand Down
44 changes: 44 additions & 0 deletions docs/diagrams/FindCommandClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam classBackgroundColor UI_COLOR

package search <<Rectangle>> {
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 <<Rectangle>> {
Class FindCommandParser
}

package commands <<Rectangle>> {
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
Binary file added docs/images/FindCommandClassDiagram.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 a9833cb

Please sign in to comment.