Skip to content

Commit

Permalink
Merge pull request #202 from McNaBry/refactor-UG
Browse files Browse the repository at this point in the history
Refactor UG
  • Loading branch information
McNaBry authored Nov 13, 2023
2 parents 0e8a46c + 2365fb5 commit bc8e2f3
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
8 changes: 4 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ Internally, whenever requested, the `AutocompleteGenerator`:
4. ranks them based on their relevance,
5. and finally returns a stream of autocompleted commands.

### Design Considerations
#### Design Considerations

When designing the Autocomplete feature, important considerations include the ability to flexibly define and craft new constraints based on heuristically determined rules.

Expand All @@ -433,15 +433,15 @@ By abstracting away all operations into simple components like sets and constrai
Most notably, it also allows for advanced rulesets to be specified in a human-readable fashion.
Take a look at [AddCommand#AUTOCOMPLETE_SUPPLIER](https://github.com/AY2324S1-CS2103T-W08-3/tp/blob/c484696fe4c12d514ad3fb6a71ff2dfea089fe32/src/main/java/seedu/address/logic/commands/AddCommand.java#L47).

#### Alternatives Considered
##### Alternatives Considered

##### Alternative 1: Using Hardcoded Rules in Java
###### Alternative 1: Using Hardcoded Rules in Java

One obvious alternative is to simply the possible autocompletion results for each command in standard Java. We may achieve this by manually checking against a command string for each command type, and using existing tokenization classes like `ArgumentTokenizer` and `ArgumentMultimap`.

While this would incur less overhead in initial development time, more explicit coding is required - it is neither quick to write nor scalable to tons of commands. This is especially important as autocomplete was developed in parallel with other new features being added to Jobby, which would require constant changes to the autocomplete rules.

##### Alternative 2: Using a Graph-based Approach
###### Alternative 2: Using a Graph-based Approach

A graph based approach, e.g., having a tree structure to define constraints and dependencies, may be more efficient than the current solution (which has to check against _all_ known rules every single time).

Expand Down
Loading

0 comments on commit bc8e2f3

Please sign in to comment.