Skip to content

Commit

Permalink
Merge pull request #249 from Pluiexo/branch-MeetingDGDiagrams
Browse files Browse the repository at this point in the history
Update DG on the implementation of Meeting
  • Loading branch information
iynixil authored Apr 15, 2024
2 parents eb35825 + 9494519 commit ff605c5
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 2 deletions.
86 changes: 84 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ This is to prevent `SortCommand` from taking on more responsibilities (Separatio
* Pros: Easy to implement, controlled and less likely to be used incorrectly. This increase ease of use for users.
* Cons: Limited sorting and lesser functionality.

### Meeting feature

### Meeting Feature

Meeting is feature that allows the user to keep track of any events they may have with the particular contact. It contains the description of the meeting event with the date and time it would occur.

Expand All @@ -346,7 +347,30 @@ is used to handle any valid date time values. Each of this meeting are stored in
contains each of the meetings related to each other stored in an ```ObservableList```. The ``` MeetingManager ``` is
used to manage any operations that require viewing or sorting of meetings from the ```MeetingList``` class.

#### What designs were considered:
The operations for adding and deleting meeting are handled by `AddMeetingCommand` and `DeleteMeetingCommand`, which are supported by `AddMeetingCommandParser` and `DeleteMeetingCommandParser` respectively.

1. The user enters `meeting-add 2 d/Finals s/20/04/2024 15:00` to add a meeting or `meeting-delete 1 i/1` to delete a meeting.
2. `Logic Manager` receives the user input which is parsed by `StaffConnectParser`.
3. After splitting the user input into `commandWord` and `arguments` based on the regex pattern of the user input, the `StaffConnectParser` invokes the `AddMeetingCommandParser`or`DeleteMeetingCommandParser` based on the `commandWord`. Calling the method `parse` with `arguments` as the method arguments, and getting supported by parsing methods from `ParsedUtil`.
4. `AddMeetingCommand` or `DeleteMeetingCommand` is created with the parsed values.
5. `Logic Manager` executes the `AddMeetingCommand` or `DeleteMeetingCommand`, which handles adding/removing meeting from the `Person` respectively and updates the model with the new information.

Below is the sequence diagram for parsing inputs with `AddMeetingCommandParser` executing `meeting-add 2 d/Finals s/20/04/2024 15:00`:
<br>![AddMeetingCommandParser Sequence Diagram](images/AddMeetingParserSequenceDiagram.png)
<br>Below in the in-depth reference of how `AddMeetingCommandParser` utilise `ParseUtil` to parse the arguments:
<br>![Add Parser Reference Diagram](images/AddParserRefrenceDiagram.png)
<br> Similarly, the sequence diagram for parsing inputs with `DeleteMeetingCommandParser` executing `meeting-delete 1 i/1`:
<br>![DeleteMeetingCommandParser Sequence Diagram](images/DeleteMeetingParserSequenceDiagram.png)
<br><br>
After parsing, the commands are executed by the logic manager as show below. (Execute in the diagrams below comes form the logic manager)
<br> Below is the sequence diagram for adding meeting with `AddMeetingCommand`:
<br>![AddMeetingCommand Sequence Diagram](images/AddMeetingSequenceDiagram.png)
<br> Similarly the sequence diagram for deleting meeting with `DeleteMeetingCommand`:
<br>![DeleteMeetingCommand Sequence Diagram](images/DeleteMeetingSequenceDiagram.png)
<br> Below is the sequence diagram of how both `AddMeetingCommand` and `DeleteMeetingCommand` copies the selected person from the model for editing:
<br>![Copy selectedPerson](images/MeetingCopyPerson.png)

#### What are the design considered:

**Aspect: How the meetings are stored :**

Expand Down Expand Up @@ -463,6 +487,7 @@ The following activity diagram summarizes what happens when a user executes a ne
* Pros: Will use less memory (e.g. for `delete`, just save the person being deleted).
* Cons: We must ensure that the implementation of each individual command are correct.


--------------------------------------------------------------------------------------------------------------------

## **Documentation, logging, testing, configuration, dev-ops**
Expand Down Expand Up @@ -621,6 +646,63 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case resumes at step 1.


**Use case: Add a meeting**

**MSS**

1. StaffConnect shows a list of persons
2. User requests to add a meeting to the specific person in the list
3. StaffConnect adds the meeting to the person with the provided details

Use case ends.

**Extensions**

* 1a. The list is empty.

Use case ends.

* 2a. The given index is invalid.

* 2a1. StaffConnect shows an error message.

Use case resumes at step 1.

* 3a. The given details for meeting is invalid.
* 3a1. StaffConnect shows an error message.
Use case resumes at step 1.


**Use case: Delete a meeting**

**Precondition:** The intended meeting to delete exists and has been added before.

**MSS**

1. StaffConnect shows a list of persons
2. User requests to delete a meeting of a specific person in the list
3. StaffConnect deletes the specified meeting

Use case ends.

**Extensions**

* 1a. The list is empty.

Use case ends.

* 2a. The given index for person is invalid.

* 2a1. StaffConnect shows an error message.

Use case resumes at step 1.

* 2a. The given index for meeting is invalid.
* 2a1. StaffConnect shows an error message.
Use case resumes at step 1.


### Non-Functional Requirements

1. The app should work on any _mainstream OS_ as long as it has Java `11` or above installed.
Expand Down
43 changes: 43 additions & 0 deletions docs/diagrams/AddMeetingParserSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":StaffConnectParser" as StaffConnectParser LOGIC_COLOR
participant ":AddMeetingCommandParser" as AddMeetingCommandParser LOGIC_COLOR
participant "m:AddMeetingCommand" as AddMeetingCommand LOGIC_COLOR


end box


[-> LogicManager : execute("meeting-add 2 d/Finals/20/04/2024 15:00")
activate LogicManager

LogicManager -> StaffConnectParser : parseCommand("2 d/Finals s/20/04/2024 15:00")
activate StaffConnectParser

create AddMeetingCommandParser
StaffConnectParser -> AddMeetingCommandParser
activate AddMeetingCommandParser

AddMeetingCommandParser --> StaffConnectParser
deactivate AddMeetingCommandParser


StaffConnectParser -> AddMeetingCommandParser : parse(arguments)
activate AddMeetingCommandParser
ref over AddMeetingCommandParser : parse arguments for meeting-add


create AddMeetingCommand
AddMeetingCommandParser -> AddMeetingCommand++
return

return m
destroy AddMeetingCommandParser
return m
return

@enduml
44 changes: 44 additions & 0 deletions docs/diagrams/AddMeetingSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant "m:AddMeetingCommand" as AddMeetingCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "editedPerson:Person " as editedPerson LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as Model MODEL_COLOR
end box


[-> AddMeetingCommand : execute(model)
activate AddMeetingCommand

AddMeetingCommand -> Model : getSortedFilteredPersonList()
activate Model
return

ref over AddMeetingCommand : copy selectedPerson

AddMeetingCommand -> editedPerson : addMeeting()
activate editedPerson
return

AddMeetingCommand -> editedPerson : updateSortedMeetingList(MEETING_DATE_THEN_DESCRIPTION_COMPARATOR);
activate editedPerson
return

AddMeetingCommand -> Model : setPerson(selectedPerson, editedPerson)
activate Model
return

create CommandResult
AddMeetingCommand -> CommandResult++
return

return r


@enduml
37 changes: 37 additions & 0 deletions docs/diagrams/AddParserRefrenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

mainframe **sd** parse arguments for meeting-add

box Logic LOGIC_COLOR_T1
participant ":AddMeetingCommandParser" as AddMeetingCommandParser LOGIC_COLOR
participant "<<class>>\nParserUtil" as ParserUtil LOGIC_COLOR
participant ":MeetingDescription" as MeetingDescription LOGIC_COLOR
participant ":MeetingDateTime" as MeetingDateTime LOGIC_COLOR
end box



AddMeetingCommandParser -> ParserUtil : parseIndex()
activate AddMeetingCommandParser
activate ParserUtil
return

AddMeetingCommandParser -> ParserUtil : parseDescription()
activate ParserUtil

create MeetingDescription
ParserUtil -> MeetingDescription++
return
return

AddMeetingCommandParser -> ParserUtil : parseDateTime()
activate ParserUtil
create MeetingDateTime
ParserUtil -> MeetingDateTime++
return
return


@enduml
48 changes: 48 additions & 0 deletions docs/diagrams/DeleteMeetingParserSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":StaffConnectParser" as StaffConnectParser LOGIC_COLOR
participant ":DeleteMeetingCommandParser" as deleteMeetingCommandParser LOGIC_COLOR
participant "<<class>>\nParserUtil" as ParserUtil LOGIC_COLOR
participant "d:DeleteMeetingCommand" as AddMeetingCommand LOGIC_COLOR
end box


[-> LogicManager : execute("meeting-delete 1 i/1")
activate LogicManager

LogicManager -> StaffConnectParser : parseCommand("meeting-delete 1 i/1")
activate StaffConnectParser

create deleteMeetingCommandParser
StaffConnectParser -> deleteMeetingCommandParser
activate deleteMeetingCommandParser

deleteMeetingCommandParser --> StaffConnectParser
deactivate deleteMeetingCommandParser

StaffConnectParser -> deleteMeetingCommandParser : parse("1 i/1")
activate deleteMeetingCommandParser


deleteMeetingCommandParser -> ParserUtil : parse person index
activate ParserUtil
return

deleteMeetingCommandParser -> ParserUtil : parse meeting index
activate ParserUtil
return

create AddMeetingCommand
deleteMeetingCommandParser -> AddMeetingCommand++
return

return d
destroy deleteMeetingCommandParser
return d
return

@enduml
42 changes: 42 additions & 0 deletions docs/diagrams/DeleteMeetingSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant "d:DeleteMeetingCommand" as DeleteMeetingCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
participant "editedPerson:Person " as editedPerson LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as Model MODEL_COLOR
end box

[-> DeleteMeetingCommand : execute(model)
activate DeleteMeetingCommand

DeleteMeetingCommand -> Model : getSortedFilteredPersonList()
activate Model
return

ref over DeleteMeetingCommand : copy selectedPerson

DeleteMeetingCommand -> editedPerson : removeMeeting()
activate editedPerson
return

DeleteMeetingCommand -> editedPerson : updateSortedMeetingList(MEETING_DATE_THEN_DESCRIPTION_COMPARATOR);
activate editedPerson
return

DeleteMeetingCommand -> Model : setPerson(selectedPerson, editedPerson)
activate Model
return

create CommandResult
DeleteMeetingCommand -> CommandResult++
return

return r

@enduml
26 changes: 26 additions & 0 deletions docs/diagrams/MeetingCopyPerson.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

mainframe **sd** copy selectedPerson

box Logic LOGIC_COLOR_T1
participant ":[Add/Delete]MeetingCommand" as MeetingCommand LOGIC_COLOR
participant "<<class>>\nPersonUtil" as PersonUtil LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Person" as Person MODEL_COLOR
end box

activate MeetingCommand
MeetingCommand -> PersonUtil : copyPerson(selectedPerson)
activate PersonUtil

create Person
PersonUtil -> Person++
return copiedPerson

return copiedPerson

@enduml
Binary file added docs/images/AddMeetingParserSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/AddMeetingSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/AddParserRefrenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/DeleteMeetingSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/MeetingCopyPerson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ff605c5

Please sign in to comment.