Skip to content

Commit

Permalink
Update DeleteCommandSequenceDiagram
Browse files Browse the repository at this point in the history
  • Loading branch information
marquestye committed Nov 14, 2023
1 parent 0c10941 commit b3eea45
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 31 deletions.
3 changes: 2 additions & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,10 @@ The format of the `delete` command can be found [here](https://ay2324s1-cs2103t-

<br>

The following activity diagram shows the logic of deleting a `Module` from the module plan:
The following activity diagrams show the logic of deleting a `Module` from the module plan:

<puml src="diagrams/DeleteCommandActivityDiagram.puml" width="600" />
<puml src="diagrams/DeleteCommandActivityDiagram2.puml" width="600" />

<br>

Expand Down
32 changes: 2 additions & 30 deletions docs/diagrams/DeleteCommandSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ModulePlanParser" as ModulePlanParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant "result:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Module" as Module MODEL_COLOR
participant "model:Model" as Model MODEL_COLOR
end box
[-> LogicManager : execute("delete CS3230")
activate LogicManager

Expand Down Expand Up @@ -49,34 +44,11 @@ deactivate ModulePlanParser
LogicManager -> DeleteCommand : execute(model)
activate DeleteCommand

DeleteCommand -> Model : checkDbValidModuleCode("CS3230")
activate Model

Model --> DeleteCommand
deactivate Model

DeleteCommand -> Model : getModule("CS3230")
activate Model

Model --> DeleteCommand : targetMod
deactivate Model

DeleteCommand -> Model : deleteModule(targetMod)
activate Model

Model --> DeleteCommand
deactivate Model

create CommandResult
DeleteCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteCommand
deactivate CommandResult
ref over DeleteCommand : Execute delete command

DeleteCommand --> LogicManager : result
deactivate DeleteCommand
DeleteCommand -[hidden]-> LogicManager : result
DeleteCommand -[hidden]-> LogicManager
destroy DeleteCommand

[<--LogicManager : result
Expand Down
46 changes: 46 additions & 0 deletions docs/diagrams/DeleteCommandSequenceDiagram2.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

mainframe sd Execute delete command

box Logic LOGIC_COLOR_T1
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant "result:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Module" as Module MODEL_COLOR
participant "model:Model" as Model MODEL_COLOR
end box
[-> DeleteCommand : execute(model)
activate DeleteCommand

DeleteCommand -> Model : checkDbValidModuleCode("CS3230")
activate Model

Model --> DeleteCommand
deactivate Model

DeleteCommand -> Model : getModule("CS3230")
activate Model

Model --> DeleteCommand : targetMod
deactivate Model

DeleteCommand -> Model : deleteModule(targetMod)
activate Model

Model --> DeleteCommand
deactivate Model

create CommandResult
DeleteCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteCommand
deactivate CommandResult

[<--DeleteCommand : result
deactivate DeleteCommand
@enduml

0 comments on commit b3eea45

Please sign in to comment.