From ab872e9f08f02720c863b95437e90b426d46d552 Mon Sep 17 00:00:00 2001 From: KrashKart Date: Tue, 5 Nov 2024 14:16:03 +0800 Subject: [PATCH 1/5] Separate new and original command classes --- docs/diagrams/CommandClasses.puml | 64 +++++------------------ docs/diagrams/CommandClassesOriginal.puml | 43 +++++++++++++++ 2 files changed, 57 insertions(+), 50 deletions(-) create mode 100644 docs/diagrams/CommandClassesOriginal.puml diff --git a/docs/diagrams/CommandClasses.puml b/docs/diagrams/CommandClasses.puml index 5e54bfe47b4..c2724f4eb85 100644 --- a/docs/diagrams/CommandClasses.puml +++ b/docs/diagrams/CommandClasses.puml @@ -8,68 +8,32 @@ 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 "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 - -CC -u-|> Command -CC -[hidden]right- DC -FEC -[hidden]u- CC - -DC -u-|> Command -DC -[hidden]right- EdC -FEC -[hidden]u- DC +ATC -u-|> Command +ATC -[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..9e2fc68a9b3 --- /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 \ No newline at end of file From 89310990f401fc0fe99e96b3dbc759d2519c57ed Mon Sep 17 00:00:00 2001 From: KrashKart Date: Tue, 5 Nov 2024 14:23:41 +0800 Subject: [PATCH 2/5] Edit developer guide --- docs/DeveloperGuide.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index b450caf7d5d..2eb017eabe5 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()` * 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) From b0891b5014060d53d4ed3a0fc59cfa42d05eb2fd Mon Sep 17 00:00:00 2001 From: KrashKart Date: Tue, 5 Nov 2024 14:24:40 +0800 Subject: [PATCH 3/5] Add cattag to the command class diagram --- docs/diagrams/CommandClasses.puml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/diagrams/CommandClasses.puml b/docs/diagrams/CommandClasses.puml index c2724f4eb85..61caedf900e 100644 --- a/docs/diagrams/CommandClasses.puml +++ b/docs/diagrams/CommandClasses.puml @@ -13,6 +13,7 @@ package "Command Classes" as CommandClasses { package "CampusConnect Classes" { Class "AddTagCommand" as ATC + Class "CategorizeTagCommand" as CTC Class "DeleteTagCommand" as DTC Class "UndoCommand" as UC Class "RedoCommand" as RC @@ -22,7 +23,10 @@ package "Command Classes" as CommandClasses { HiddenOutside ..> Command ATC -u-|> Command -ATC -[hidden]right DTC +ATC -[hidden]right CTC + +CTC -u-|> Command +CTC -[hidden]right DTC DTC -u-|> Command DTC -[hidden]right UC From 10180c09ec900eb54809a6e6b2fc1a1f3ad6ea77 Mon Sep 17 00:00:00 2001 From: KrashKart Date: Tue, 5 Nov 2024 14:26:35 +0800 Subject: [PATCH 4/5] Add the stupid eof newline --- docs/diagrams/CommandClassesOriginal.puml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/diagrams/CommandClassesOriginal.puml b/docs/diagrams/CommandClassesOriginal.puml index 9e2fc68a9b3..a3351d81b6a 100644 --- a/docs/diagrams/CommandClassesOriginal.puml +++ b/docs/diagrams/CommandClassesOriginal.puml @@ -40,4 +40,4 @@ HC -u-|> Command HC -[hidden]right- LC LC -u-|> Command -@enduml \ No newline at end of file +@enduml From 9715b637b1ad91c8c3f4d8ac2b8df57a7fb5537d Mon Sep 17 00:00:00 2001 From: KrashKart Date: Tue, 5 Nov 2024 14:29:04 +0800 Subject: [PATCH 5/5] Correct typo --- docs/DeveloperGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 2eb017eabe5..e278ec73f4a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -122,7 +122,7 @@ However, there are new classes implemented for CampusConnect as well: The structure is simple: -* Each `Command` class (old and new) extends from the abstract `Command` class, which enforces the implementation of the `execute()` +* 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. * They also contain their own respective error messages.