Skip to content

Commit

Permalink
Merge pull request #52 from tanhengyeow/v1.2-documentation
Browse files Browse the repository at this point in the history
Updated developer guide for find command
  • Loading branch information
tanhengyeow authored Mar 21, 2018
2 parents 2c4c038 + 01957c7 commit 806bc39
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,36 @@ image::UndoRedoActivityDiagram.png[width="650"]
** Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as `HistoryManager` now needs to do two * different things.
// end::undoredo[]

//tag::findcommand
=== Find Command

==== Current Implementation

The `find` command allows campus recruiters to search for students with exact keywords in `compulsory` fields of the student entry. This command is supported by the `FindCommandParser` class.

The `find` command will be supporting more compulsory fields that will be added in subsequent weeks.

The sequence diagram shown below illustrates how the `Logic` and `Model` component interacts when the `find` command is executed:

image::FindCommandSequenceDiagram.png[width="800"]

Execution of the `find` command comprises the following steps:

1. `LogicManager` invokes `parseCommand` method of `AddressbookParser`, taking user inputs as arguments.

2. During the `parseCommand` method call, an instance of `FindCommandParser` will be created.

3. `FindCommandParser` calls the `parseFindArgs` method of `FindUtil` and returns a `Predicate<Person>` object.

4. The `FindCommand` object is initialized with this `Predicate<Person>` object.

5. The `FindCommand` object calls the method `updateFilteredPersonList` with this `Predicate<Person>` object.

==== Design Considerations

In the current implementation, creating the `Predicate<Person>` object is done in the `FindUtil` class. As more predicates get added in the future, we may need to consider breaking up the utility methods into separate classes.
//end::findcommand

//tag::filtercommand
=== Filter Command

Expand Down
Binary file added docs/diagrams/FindCommandSequenceDiagram.pptx
Binary file not shown.
Binary file added docs/images/FindCommandSequenceDiagram.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 806bc39

Please sign in to comment.