From fcc61e91cbe13cefd65270ecda09a7813b8abf5e Mon Sep 17 00:00:00 2001 From: KrashKart Date: Mon, 21 Oct 2024 00:33:05 +0800 Subject: [PATCH 1/4] Remove Address from all UML diagrams Let's, * remove Address as a field from all UML diagrams * add multiplicities to UML diagrams as approppriate --- docs/diagrams/BetterModelClassDiagram.puml | 7 +++---- docs/diagrams/ModelClassDiagram.puml | 11 ++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/diagrams/BetterModelClassDiagram.puml b/docs/diagrams/BetterModelClassDiagram.puml index eb630665c94..7a3978c03d0 100644 --- a/docs/diagrams/BetterModelClassDiagram.puml +++ b/docs/diagrams/BetterModelClassDiagram.puml @@ -14,8 +14,7 @@ UniquePersonList -right-> Person Person -up-> "*" Tag -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address +Person *--> "1" Name +Person *--> "1" Phone +Person *--> "1" Email @enduml diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index 3f3bf579251..0de49091dbc 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -14,7 +14,6 @@ Class UserPrefs Class UniquePersonList Class Person -Class Address Class Email Class Name Class Phone @@ -37,18 +36,16 @@ UserPrefs .up.|> ReadOnlyUserPrefs CampusConnect *--> "1" UniquePersonList UniquePersonList --> "~* all" Person -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address +Person *--> "1" Name +Person *--> "1" Phone +Person *--> "1" Email Person *--> "*" Tag Person -[hidden]up--> I UniquePersonList -[hidden]right-> I Name -[hidden]right-> Phone -Phone -[hidden]right-> Address -Address -[hidden]right-> Email +Phone -[hidden]right-> Email ModelManager --> "~* filtered" Person @enduml From 3261f04260a52029db126baf46e529c772fab9f5 Mon Sep 17 00:00:00 2001 From: KrashKart Date: Mon, 21 Oct 2024 00:33:59 +0800 Subject: [PATCH 2/4] Add Command Classes UML diagram Let's, * Replace XYZCommand class to a Command Class package in all UML diagrams * Add the Command Class UML file --- docs/diagrams/CommandClasses.puml | 61 ++++++++++++++++++++++++++++ docs/diagrams/LogicClassDiagram.puml | 8 ++-- docs/diagrams/ParserClasses.puml | 7 ++-- 3 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 docs/diagrams/CommandClasses.puml diff --git a/docs/diagrams/CommandClasses.puml b/docs/diagrams/CommandClasses.puml new file mode 100644 index 00000000000..036c083d1a2 --- /dev/null +++ b/docs/diagrams/CommandClasses.puml @@ -0,0 +1,61 @@ +@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 "Command Classes" as CommandClasses { + together { + Class "{abstract}\nAbstractFindCommand" as AFC + Class "AddCommand" as AC + Class "ClearCommand" as CC + Class "DeleteCommand" as DC + 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 + } +} +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 + +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 +FEC -[hidden]u- LC +@enduml \ No newline at end of file diff --git a/docs/diagrams/LogicClassDiagram.puml b/docs/diagrams/LogicClassDiagram.puml index 58b4f602ce6..9700eab4506 100644 --- a/docs/diagrams/LogicClassDiagram.puml +++ b/docs/diagrams/LogicClassDiagram.puml @@ -8,7 +8,8 @@ package Logic as LogicPackage { package "Parser Classes" as ParserClasses{ } -Class XYZCommand +package "Command Classes" as CommandClasses{ +} Class CommandResult Class "{abstract}\nCommand" as Command @@ -29,9 +30,9 @@ HiddenOutside ..> Logic LogicManager .right.|> Logic LogicManager -right->"1" ParserClasses -ParserClasses ..> XYZCommand : <> +ParserClasses ..> CommandClasses : <> -XYZCommand -up-|> Command +CommandClasses -up-|> Command LogicManager .left.> Command : <> LogicManager --> Model @@ -39,7 +40,6 @@ LogicManager --> Storage Storage --[hidden] Model Command .[hidden]up.> Storage Command .right.> Model -note right of XYZCommand: XYZCommand = AddCommand, \nFindCommand, etc Logic ..> CommandResult LogicManager .down.> CommandResult diff --git a/docs/diagrams/ParserClasses.puml b/docs/diagrams/ParserClasses.puml index 4e756fe94c0..7ba2b420cfd 100644 --- a/docs/diagrams/ParserClasses.puml +++ b/docs/diagrams/ParserClasses.puml @@ -5,7 +5,8 @@ skinparam arrowColor LOGIC_COLOR_T4 skinparam classBackgroundColor LOGIC_COLOR Class "{abstract}\nCommand" as Command -Class XYZCommand +package "Command Classes" as CommandClasses { +} package "Parser classes"{ Class "<>\nParser" as Parser @@ -23,7 +24,7 @@ HiddenOutside ..> CampusConnectParser CampusConnectParser .down.> XYZCommandParser: <> -XYZCommandParser ..> XYZCommand : <> +XYZCommandParser ..> CommandClasses : <> CampusConnectParser ..> Command : <> XYZCommandParser .up.|> Parser XYZCommandParser ..> ArgumentMultimap @@ -34,5 +35,5 @@ CliSyntax ..> Prefix XYZCommandParser ..> ParserUtil ParserUtil .down.> Prefix ArgumentTokenizer .down.> Prefix -XYZCommand -up-|> Command +CommandClasses -up-|> Command @enduml From bb8a472bef0d9574fa287682d3e458fe01f0022f Mon Sep 17 00:00:00 2001 From: KrashKart Date: Mon, 21 Oct 2024 00:34:32 +0800 Subject: [PATCH 3/4] Edit DG Let's, * add the new Command Class UML to the Developer Guide * add some description to the Developer Guide about the new UML --- docs/DeveloperGuide.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 14afada2618..7ff640c346a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -115,6 +115,15 @@ 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: + + + +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. +* 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. + ### Model component **API** : [`Model.java`](https://github.com/se-edu/CampusConnect/tree/master/src/main/java/seedu/address/model/Model.java) From b4b70c3bd941c1996aa1cf77b3d0cd9a0a6ab209 Mon Sep 17 00:00:00 2001 From: KrashKart Date: Mon, 21 Oct 2024 00:38:53 +0800 Subject: [PATCH 4/4] Add newline at the end of CommandClasses.puml --- docs/diagrams/CommandClasses.puml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/diagrams/CommandClasses.puml b/docs/diagrams/CommandClasses.puml index 036c083d1a2..eb4815c67e6 100644 --- a/docs/diagrams/CommandClasses.puml +++ b/docs/diagrams/CommandClasses.puml @@ -58,4 +58,4 @@ FEC -[hidden]u- HC LC -u-|> Command FEC -[hidden]u- LC -@enduml \ No newline at end of file +@enduml