Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DG #280

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ Here's a (partial) class diagram of the `Logic` component:

<img src="images/LogicClassDiagram.png" width="550"/>

The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example.
The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("addschedule user type/cca en/table tennis h/monday 1400 1600")` API call as an example.

![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png)
![Interactions Inside the Logic Component for the `delete 1` Command](images/AddScheduleSequenceDiagram.png)

<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `AddScheduleCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
</div>

How the `Logic` component works:

1. When `Logic` is called upon to execute a command, it is passed to an `AddressBookParser` object which in turn creates a parser that matches the command (e.g., `DeleteCommandParser`) and uses it to parse the command.
1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `DeleteCommand`) which is executed by the `LogicManager`.
1. When `Logic` is called upon to execute a command, it is passed to an `AddressBookParser` object which in turn creates a parser that matches the command (e.g., `AddScheduleCommandParser`) and uses it to parse the command.
1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `AddScheduleCommand`) which is executed by the `LogicManager`.
1. The command can communicate with the `Model` when it is executed (e.g. to delete a person).
1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.

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

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":AddScheduleCommandParser" as AddScheduleCommandParser LOGIC_COLOR
participant "d:AddScheduleCommand" as AddScheduleCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("addschedule user type/cca en/table tennis h/monday 1400 1600")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("addschedule user type/cca en/table tennis h/monday 1400 1600")
activate AddressBookParser

create AddScheduleCommandParser
AddressBookParser -> AddScheduleCommandParser
activate AddScheduleCommandParser

AddScheduleCommandParser --> AddressBookParser
deactivate AddScheduleCommandParser

AddressBookParser -> AddScheduleCommandParser : parse("user type/cca en/table tennis h/monday 1400 1600")
activate AddScheduleCommandParser

create AddScheduleCommand
AddScheduleCommandParser -> AddScheduleCommand
activate AddScheduleCommand

AddScheduleCommand --> AddScheduleCommandParser : addCca
deactivate AddScheduleCommand

AddScheduleCommandParser --> AddressBookParser : addCca
deactivate AddScheduleCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddScheduleCommandParser -[hidden]-> AddressBookParser
destroy AddScheduleCommandParser

AddressBookParser --> LogicManager : d
deactivate AddressBookParser

LogicManager -> AddScheduleCommand : execute()
activate AddScheduleCommand

AddScheduleCommand -> Model : addCca(table tennis monday 1400 1600)
activate Model

Model --> AddScheduleCommand
deactivate Model

create CommandResult
AddScheduleCommand -> CommandResult
activate CommandResult

CommandResult --> AddScheduleCommand
deactivate CommandResult

AddScheduleCommand --> LogicManager : result
deactivate AddScheduleCommand

[<--LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/AddScheduleSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions docs/team/lululwtv.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=w12-4&sort=groupTitle
- Added guides for commands `cft`, `rmevent`, `addevent`, `addschedule`, `rmschedule` commands
- Fixed UG documentation to align with newer commands
- Updated UG to include expected features that may not be expected by users, such as:
-
- Informing users in the UG that event names will be changed to all caps even if they did not key it in caps
- Add sample code for the commands I have added

**Contributions to the Developer Guide (DG):**

[to be added later]
- Update DG on how addschedule command works
- Created sequence diagram for addschedule command
- Updated how Logic package works

**Contributions to team-based tasks:**

Expand Down