From e32be657eb924084d48ace9be5c72d1ada4c52b8 Mon Sep 17 00:00:00 2001 From: Kb-tay Date: Mon, 13 Nov 2023 23:31:13 +0800 Subject: [PATCH 1/2] Update DG design considerations for Complete --- docs/DeveloperGuide.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 111a776fc68..30961de9c1d 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -262,6 +262,26 @@ The following activity diagram illustrates how the complete operation is execute +**Design Considerations** + +Alternative 1 (Previous Design): Use a `CompleteCommandDescriptor` that has a `Date` and `Index` field wrapped by Java `Optional`. + +* Pros: + * Allows for clean, readable code without having to check for null values regardless of whether user inputs a date or index. + +* Cons: + * Have to check for both fields for at every step of the command which is inefficient. + +Alternative 2 (Current Choice): Make `CompleteCommand` an abstract class with the subclass `CompleteByIndex` and `CompletebyDate`. + +Pros: +* `LogicManager` can just execute `CompleteCommand` without needing to know if it is `CompleteByIndex` or `CompleteByDate`. +* Also eliminates the need to check for null fields, since each `CompleteCommand` subclass only has their required fields. +* This also increases the extensibility of the command, as a new subclass can just be added. + +Cons: +* Increases the amount of code written and testing required. + ### Gather Emails Feature The **Gather Emails** feature in our software system is designed to efficiently collect email addresses. This feature is facilitated by the `GatherCommand` and `GatherCommandParser`. Below is the class diagram of the gather emails feature. @@ -775,10 +795,10 @@ point for testers to work on; testers are expected to do more *exploratory* test 1. Prerequisites: List all persons using the `list` command. - 2. Test case: `add n/name p/987 a/address e/email@email nk/nokname nkp/654`
+ 2. Test case: `add n/name p/987 a/address e/email@email.com nk/nokname nkp/654`
Expected: New contact with the above details is added to the bottom of the list. - 3. Test case: `add n/invalidName! p/987 a/address e/email@email nk/nokname nkp/654`
+ 3. Test case: `add n/invalidName! p/987 a/address e/email@email.com nk/nokname nkp/654`
Expected: No person is added. Error details shown in the status message. Status bar remains the same. ### Editing a person From e3ea34aad9708634167a25df06ef8408f992d60f Mon Sep 17 00:00:00 2001 From: Kb-tay Date: Mon, 13 Nov 2023 23:32:58 +0800 Subject: [PATCH 2/2] UpdatePPP --- docs/team/kb-tay.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/team/kb-tay.md b/docs/team/kb-tay.md index 6510540d6fa..e14196e0095 100644 --- a/docs/team/kb-tay.md +++ b/docs/team/kb-tay.md @@ -11,7 +11,7 @@ UNOFAS is a desktop app for **Financial Advisors (FA)** to manage client’s con Given below are my contributions to the project. -* **New Feature**: Added the `ScheduleItem` class as a new field to Person +* **New Feature**: Added the `ScheduleItem` class as a new field to Person. * Justification: This feature provides users the ability to associate appointments with their clients. * Pull Request [#70](https://github.com/AY2324S1-CS2103T-F12-1/tp/pull/70)