Skip to content

Commit 698fe25

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#78 from Licheng-Wu/branch-Update-DG
Update Developer Guide to include Find Exercises feature
2 parents ad02978 + 7610cf7 commit 698fe25

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

docs/DeveloperGuide.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,20 @@ _{more aspects and alternatives to be added}_
217217

218218
_{Explain here how the data archiving feature will be implemented}_
219219

220+
### Find exercises
221+
222+
The find exercises feature is implemented using `FindExercisesCommandParser`, as well as the following command:
223+
* `FindExercisesCommand`, to be executed when the user inputs the command into fitNUS
224+
225+
`FindExercisesCommandParser` takes in the user input and parses them to return a FindExercisesCommand containing the
226+
corresponding predicate for finding the exercises. When executed, `FindExercisesCommand` will set the predicate of
227+
the respective `FilteredList` for exercises in `ModelManager` such that only exercises matching the predicate will be
228+
displayed in the list.
229+
230+
Given below is the Sequence Diagram for interactions within the Logic component for the execute("find_exercises bench")
231+
API call.
232+
![FindExercisesSequenceDiagram](images/FindExercisesSequenceDiagram.png)
233+
220234

221235
--------------------------------------------------------------------------------------------------------------------
222236

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
@startuml
2+
!include style.puml
3+
4+
box Logic LOGIC_COLOR_T1
5+
participant ":LogicManager" as LogicManager LOGIC_COLOR
6+
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
7+
participant ":FindExercisesCommandParser" as FindExercisesCommandParser LOGIC_COLOR
8+
participant "f:FindExercisesCommand" as FindExercisesCommand LOGIC_COLOR
9+
participant ":CommandResult" as CommandResult LOGIC_COLOR
10+
end box
11+
12+
box Model MODEL_COLOR_T1
13+
participant ":Model" as Model MODEL_COLOR
14+
end box
15+
16+
[-> LogicManager : execute("find_exercises bench")
17+
activate LogicManager
18+
19+
LogicManager -> AddressBookParser : parseCommand("find_exercises bench")
20+
activate AddressBookParser
21+
22+
create FindExercisesCommandParser
23+
AddressBookParser -> FindExercisesCommandParser
24+
activate FindExercisesCommandParser
25+
26+
FindExercisesCommandParser --> AddressBookParser
27+
deactivate FindExercisesCommandParser
28+
29+
AddressBookParser -> FindExercisesCommandParser : parse("bench")
30+
activate FindExercisesCommandParser
31+
32+
create FindExercisesCommand
33+
FindExercisesCommandParser -> FindExercisesCommand
34+
activate FindExercisesCommand
35+
36+
FindExercisesCommand --> FindExercisesCommandParser : f
37+
deactivate FindExercisesCommand
38+
39+
FindExercisesCommandParser --> AddressBookParser : f
40+
deactivate FindExercisesCommandParser
41+
'Hidden arrow to position the destroy marker below the end of the activation bar.
42+
FindExercisesCommandParser -[hidden]-> AddressBookParser
43+
destroy FindExercisesCommandParser
44+
45+
AddressBookParser --> LogicManager : f
46+
deactivate AddressBookParser
47+
48+
LogicManager -> FindExercisesCommand : execute()
49+
activate FindExercisesCommand
50+
51+
FindExercisesCommand-> Model : updateFilteredExerciseList(predicate)
52+
activate Model
53+
54+
Model --> FindExercisesCommand
55+
deactivate Model
56+
57+
create CommandResult
58+
FindExercisesCommand -> CommandResult
59+
activate CommandResult
60+
61+
CommandResult --> FindExercisesCommand
62+
deactivate CommandResult
63+
64+
FindExercisesCommand --> LogicManager : result
65+
deactivate FindExercisesCommand
66+
67+
[<--LogicManager
68+
deactivate LogicManager
69+
@enduml
60.8 KB
Loading

0 commit comments

Comments
 (0)