forked from nus-cs2103-AY1920S1/addressbook-level3
-
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.
Update developer guide suggest feature (#111)
* Update Developer's Guide for Suggest feature * Update DG
- Loading branch information
1 parent
8d5bd26
commit 656a318
Showing
6 changed files
with
146 additions
and
1 deletion.
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,24 @@ | ||
@startuml | ||
skinparam activityShape rectangle | ||
|
||
start | ||
:Entered suggest command; | ||
:check if suggest type is valid; | ||
if() then ([Valid suggest type]) | ||
|
||
if() then ([suggest type == "basic"]) | ||
:updates list to show basic exercises; | ||
else ([suggest type == "possible"]) | ||
if() then ([valid arguments]) | ||
:Form predicate; | ||
:updates list to show exercises with matching predicate; | ||
else ([Invalid arguments]) | ||
:show invalid arguments message; | ||
endif | ||
endif | ||
else ([Invalid suggest type]) | ||
:show invalid suggest type message; | ||
endif | ||
-> Program resumes; | ||
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,76 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":ExerciseBookParser" as ExerciseBookParser LOGIC_COLOR | ||
participant ":SuggestCommandParser" as SuggestCommandParser LOGIC_COLOR | ||
participant "s:SuggestPossibleCommand" as SuggestPossibleCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("suggest s/possible m/Leg") | ||
activate LogicManager | ||
|
||
LogicManager -> ExerciseBookParser : parseCommand("suggest s/possible m/Leg") | ||
activate ExerciseBookParser | ||
|
||
create SuggestCommandParser | ||
ExerciseBookParser -> SuggestCommandParser | ||
activate SuggestCommandParser | ||
|
||
SuggestCommandParser --> ExerciseBookParser | ||
deactivate SuggestCommandParser | ||
|
||
ExerciseBookParser -> SuggestCommandParser : parse("s/possible m/Leg") | ||
activate SuggestCommandParser | ||
|
||
create SuggestPossibleCommand | ||
SuggestCommandParser -> SuggestPossibleCommand : (muscles, customProperties) | ||
activate SuggestPossibleCommand | ||
|
||
SuggestPossibleCommand --> SuggestCommandParser : s | ||
deactivate SuggestPossibleCommand | ||
|
||
SuggestCommandParser --> ExerciseBookParser : s | ||
deactivate SuggestCommandParser | ||
|
||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
SuggestCommandParser -[hidden]-> ExerciseBookParser | ||
destroy SuggestCommandParser | ||
|
||
ExerciseBookParser --> LogicManager : s | ||
deactivate ExerciseBookParser | ||
|
||
LogicManager -> SuggestPossibleCommand : execute() | ||
activate SuggestPossibleCommand | ||
|
||
SuggestPossibleCommand --> SuggestPossibleCommand : getPredicate() | ||
activate SuggestPossibleCommand | ||
|
||
SuggestPossibleCommand --> SuggestPossibleCommand :p | ||
deactivate SuggestPossibleCommand | ||
|
||
SuggestPossibleCommand -> Model : updateSuggestedExerciseList(p) | ||
activate Model | ||
|
||
Model --> SuggestPossibleCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
SuggestPossibleCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> SuggestPossibleCommand : result | ||
deactivate CommandResult | ||
|
||
SuggestPossibleCommand --> LogicManager : result | ||
deactivate SuggestPossibleCommand | ||
|
||
[<--LogicManager : result | ||
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.