Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ParserClasses diagram #129

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ Here are the other classes in `Logic` (omitted from the class diagram above) tha

How the parsing works:
* When called upon to parse a user command, the `AddressBookParser` class creates an `XYZCommandParser` (`XYZ` is a placeholder for the specific command name e.g., `AddCommandParser`) which uses the other classes shown above to parse the user command and create a `XYZCommand` object (e.g., `AddCommand`) which the `AddressBookParser` returns back as a `Command` object.
* All `XYZCommandParser` classes (e.g., `AddCommandParser`, `DeleteCommandParser`, ...) inherit from the `Parser` interface so that they can be treated similarly where possible e.g, during testing.
* `FilterCommandParser` is explicitly shown as unlike other command parsers, `FilterCommandParser` performs an additional task: it creates multiple predicate classes, which are combined into a `CombinedPredicate`.
* All `XYZCommandParser` classes (e.g., `AddCommandParser`, `DeleteCommandParser`, ...) and `FilterCommandParser` inherit from the `Parser` interface so that they can be treated similarly where possible e.g, during testing.

### Model component
**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java)
Expand Down
20 changes: 20 additions & 0 deletions docs/diagrams/ParserClasses.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ skinparam classBackgroundColor LOGIC_COLOR

Class "{abstract}\nCommand" as Command
Class XYZCommand
Class FilterCommand
Class CombinedPredicate

package "Parser classes"{
Class "<<interface>>\nParser" as Parser
Class AddressBookParser
Class XYZCommandParser
Class FilterCommandParser
Class CliSyntax
Class ParserUtil
Class ArgumentMultimap
Expand All @@ -22,17 +25,34 @@ Class HiddenOutside #FFFFFF
HiddenOutside ..> AddressBookParser

AddressBookParser .down.> XYZCommandParser: <<create>>
AddressBookParser .down.> FilterCommandParser: <<create>>

XYZCommandParser ..> XYZCommand : <<create>>
FilterCommandParser ..> FilterCommand : <<create>>
FilterCommandParser ..> CombinedPredicate : <<create>>
AddressBookParser ..> Command : <<use>>
XYZCommandParser .up.|> Parser
XYZCommandParser ..> ArgumentMultimap
XYZCommandParser ..> ArgumentTokenizer
FilterCommandParser .up.|> Parser
FilterCommandParser ..> ArgumentMultimap
FilterCommandParser ..> ArgumentTokenizer
ArgumentTokenizer .left.> ArgumentMultimap
XYZCommandParser ..> CliSyntax
FilterCommandParser ..> CliSyntax
CliSyntax ..> Prefix
XYZCommandParser ..> ParserUtil
FilterCommandParser ..> ParserUtil
ParserUtil .down.> Prefix
ArgumentTokenizer .down.> Prefix
XYZCommand -up-|> Command
FilterCommand -up-|> Command

note right of FilterCommandParser
Internally creates and combines multiple predicates
(e.g., NameContainsSubstringPredicate,
IncomeComparisonPredicate, etc.) into a
CombinedPredicate.
end note

@enduml