diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index b450caf7d5d..e278ec73f4a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -115,14 +115,16 @@ How the parsing works: * When called upon to parse a user command, the `CampusConnectParser` 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 `CampusConnectParser` 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. -Finally, here are the command classes in `Logic` used to represent the different types of commands: +Finally, the `Logic` contains the important `Command` classes. Some command classes from AB3 have been retained: + +However, there are new classes implemented for CampusConnect as well: -A few notes here: -* Since there are many types of Find Command classes with similar functionality, they all extend an abstract parent class `AbstractFindCommand`, used to contain most of the common methods. +The structure is simple: +* Each `Command` class (old and new) extends from the abstract `Command` class, which enforces the implementation of the `execute()` method. * Each `Command` class contains the respective `COMMAND_WORD` representing the name of the command and a `MESSAGE_USAGE` string to demonstrate how to use the respective command. -* Additionally, each Find Command class (`FindByNameCommand`, `FindByEmailCommand`, `FindByTagCommand` and `FindByPhoneCommand`) contains a respective `COMMAND_WORD` ("`n/`", "`e/`", "`t/`" and "`p/`" respectively) on top of the shared command word "`find`" to be used. +* They also contain their own respective error messages. ### Model component **API** : [`Model.java`](https://github.com/se-edu/CampusConnect/tree/master/src/main/java/seedu/address/model/Model.java) diff --git a/docs/diagrams/CommandClasses.puml b/docs/diagrams/CommandClasses.puml index 5e54bfe47b4..61caedf900e 100644 --- a/docs/diagrams/CommandClasses.puml +++ b/docs/diagrams/CommandClasses.puml @@ -8,68 +8,36 @@ Class "{abstract}\nCommand" as Command Class HiddenOutside #FFFFFF package "Command Classes" as CommandClasses { - together { - Class "SuperFindCommand" as AFC - Class "AddCommand" as AC - Class "ClearCommand" as CC - Class "DeleteCommand" as DC + package "Original AB3 Classes" as OAC { + } + + package "CampusConnect Classes" { + Class "AddTagCommand" as ATC + Class "CategorizeTagCommand" as CTC Class "DeleteTagCommand" as DTC - Class "EditCommand" as EdC - Class "ExitCommand" as ExC - Class "FindByEmailCommand" as FEC - Class "FindByNameCommand" as FNC - Class "FindByTagCommand" as FTC - Class "FindByPhoneCommand" as FPC - Class "HelpCommand" as HC - Class "ListCommand" as LC Class "UndoCommand" as UC Class "RedoCommand" as RC + Class "SuperFindCommand" as SFC } } HiddenOutside ..> Command -AFC -u-|> Command -AFC -[hidden]right- AC -FEC -u-|> AFC -FNC -u-|> AFC -FTC -u-|> AFC -FPC -u-|> AFC - -AC -u-|> Command -AC -[hidden]right- CC -FEC -[hidden]u- AC +ATC -u-|> Command +ATC -[hidden]right CTC -CC -u-|> Command -CC -[hidden]right- DC -FEC -[hidden]u- CC - -DC -u-|> Command -DC -[hidden]right- EdC -FEC -[hidden]u- DC +CTC -u-|> Command +CTC -[hidden]right DTC DTC -u-|> Command -FEC -[hidden]u- DTC - -EdC -u-|> Command -EdC -[hidden]right- ExC -FEC -[hidden]u- EdC - -ExC -u-|> Command -ExC -[hidden]right- HC -FEC -[hidden]u- ExC - -HC -u-|> Command -HC -[hidden]right- LC -FEC -[hidden]u- HC - -LC -u-|> Command -LC -[hidden]right UC -FEC -[hidden]u- LC +DTC -[hidden]right UC UC -u-|> Command UC -[hidden]right RC -FEC -[hidden]u- UC RC -u-|> Command -FEC -[hidden]u- RC +RC -[hidden]right SFC + +SFC -u-|> Command + +OAC -u|> Command @enduml diff --git a/docs/diagrams/CommandClassesOriginal.puml b/docs/diagrams/CommandClassesOriginal.puml new file mode 100644 index 00000000000..a3351d81b6a --- /dev/null +++ b/docs/diagrams/CommandClassesOriginal.puml @@ -0,0 +1,43 @@ +@startuml +!include style.puml + +skinparam arrowThickness 1.1 +skinparam arrowColor LOGIC_COLOR_T4 +skinparam classBackgroundColor LOGIC_COLOR + +Class "{abstract}\nCommand" as Command +Class HiddenOutside #FFFFFF + + +package "Original AB3 Classes" { + Class "AddCommand" as AC + Class "ClearCommand" as CC + Class "DeleteCommand" as DC + Class "EditCommand" as EdC + Class "ExitCommand" as ExC + Class "HelpCommand" as HC + Class "ListCommand" as LC +} + +HiddenOutside ..> Command + +AC -u-|> Command +AC -[hidden]right- CC + +CC -u-|> Command +CC -[hidden]right- DC + +DC -u-|> Command +DC -[hidden]right- EdC + +EdC -u-|> Command +EdC -[hidden]right- ExC + +ExC -u-|> Command +ExC -[hidden]right- HC + +HC -u-|> Command +HC -[hidden]right- LC + +LC -u-|> Command +@enduml