forked from nus-cs2103-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from JerryWang0000/branch-Find-DG
Add implementation details for `Find` feature in DeveloperGuide
- Loading branch information
Showing
7 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
start | ||
:User executes find command; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([command is non-empty]) | ||
if () then ([Person fulfils criteria]) | ||
:Show in list; | ||
else ([else]) | ||
:Not shown in list; | ||
endif | ||
else ([else]) | ||
:Show error message to User; | ||
endif | ||
stop | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
skinparam ParticipantPadding 0 | ||
|
||
Participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR | ||
Participant ":FindCommand" as FindCommand LOGIC_COLOR | ||
Participant "p:NameContainsKeywordsPredicate" as p LOGIC_COLOR | ||
|
||
|
||
[-> FindCommandParser : parse("Alex") | ||
create FindCommandParser | ||
activate FindCommandParser | ||
|
||
create p | ||
FindCommandParser -> p: new("Alex") | ||
activate p | ||
p --> FindCommandParser | ||
deactivate p | ||
|
||
create FindCommand | ||
FindCommandParser -> FindCommand: new(p) | ||
activate FindCommand | ||
|
||
FindCommand --> FindCommandParser | ||
deactivate FindCommand | ||
|
||
[<-- FindCommandParser | ||
deactivate FindCommandParser | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":StaffConnectParser" as StaffConnectParser LOGIC_COLOR | ||
participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR | ||
participant "f:FindCommand" as FindCommand 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("find Alex") | ||
activate LogicManager | ||
|
||
LogicManager -> StaffConnectParser : parseCommand("find Alex") | ||
activate StaffConnectParser | ||
|
||
create FindCommandParser | ||
StaffConnectParser -> FindCommandParser | ||
activate FindCommandParser | ||
|
||
FindCommandParser --> StaffConnectParser | ||
deactivate FindCommandParser | ||
|
||
StaffConnectParser -> FindCommandParser : parse("Alex") | ||
activate FindCommandParser | ||
|
||
create FindCommand | ||
FindCommandParser -> FindCommand: new(NameContainsKeywordsPredicate) | ||
activate FindCommand | ||
|
||
FindCommand --> FindCommand | ||
deactivate FindCommand | ||
|
||
FindCommand --> FindCommandParser : | ||
deactivate FindCommand | ||
|
||
FindCommandParser --> StaffConnectParser : f | ||
deactivate FindCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
FindCommandParser -[hidden]-> StaffConnectParser | ||
destroy FindCommandParser | ||
|
||
StaffConnectParser --> LogicManager : f | ||
deactivate StaffConnectParser | ||
|
||
LogicManager -> FindCommand : execute(m) | ||
activate FindCommand | ||
|
||
FindCommand -> Model : updateFilteredPersonList(NameContainsKeywordsPredicate) | ||
activate Model | ||
|
||
Model --> FindCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
FindCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> FindCommand | ||
deactivate CommandResult | ||
|
||
FindCommand --> LogicManager : r | ||
deactivate FindCommand | ||
|
||
[<-- LogicManager | ||
deactivate LogicManager | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.