forked from nus-cs2103-AY2122S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from AY2122S1-CS2103-T14-1/ziqing-add-dg
Developer Guide: Update Delete Command and its diagrams
- Loading branch information
Showing
7 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml | ||
start | ||
:User inputs delete command; | ||
:Logic executes delete command; | ||
:DeleteCommandParser parses the command; | ||
|
||
if () then ([Delete index is with in the valid range]) | ||
if() then ([Visit flag is present]) | ||
if() then ([Person at specified index has a next visit]) | ||
:deleteVisit; | ||
else ([else]) | ||
:Throw CommandException; | ||
endif | ||
|
||
else ([else]) | ||
|
||
:deletePerson; | ||
endif | ||
|
||
else ([else]) | ||
:Throw ParseException; | ||
|
||
endif | ||
stop | ||
|
||
@enduml |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR | ||
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant ":Person" as Person MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("delete v/1") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("delete v/1") | ||
activate AddressBookParser | ||
|
||
create DeleteCommandParser | ||
AddressBookParser -> DeleteCommandParser | ||
activate DeleteCommandParser | ||
|
||
DeleteCommandParser --> AddressBookParser | ||
deactivate DeleteCommandParser | ||
|
||
AddressBookParser -> DeleteCommandParser : parse(" v/1") | ||
activate DeleteCommandParser | ||
|
||
create DeleteCommand | ||
DeleteCommandParser -> DeleteCommand | ||
activate DeleteCommand | ||
|
||
DeleteCommand --> DeleteCommandParser : d | ||
deactivate DeleteCommand | ||
|
||
DeleteCommandParser --> AddressBookParser : d | ||
deactivate DeleteCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
DeleteCommandParser -[hidden]-> AddressBookParser | ||
destroy DeleteCommandParser | ||
|
||
AddressBookParser --> LogicManager : d | ||
deactivate AddressBookParser | ||
|
||
alt no visit flag "v/" is present | ||
LogicManager -> DeleteCommand : execute() | ||
activate DeleteCommand | ||
|
||
DeleteCommand -> DeleteCommand : deletePerson(1) | ||
activate DeleteCommand | ||
|
||
DeleteCommand -> Model : deletePerson(1) | ||
activate Model | ||
|
||
Model --> DeleteCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
DeleteCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> DeleteCommand | ||
deactivate CommandResult | ||
|
||
DeleteCommand --> LogicManager : result | ||
deactivate DeleteCommand | ||
|
||
else visit flag "v/" is present | ||
LogicManager -> DeleteCommand : execute() | ||
activate DeleteCommand | ||
|
||
DeleteCommand -> DeleteCommand : deleteVisit(1) | ||
activate DeleteCommand | ||
|
||
create Person | ||
DeleteCommand -> Person | ||
activate Person | ||
|
||
Person --> DeleteCommand: editedPerson | ||
deactivate Person | ||
|
||
DeleteCommand -> Model: setPerson(1, editedPerson) | ||
activate Model | ||
|
||
Model --> DeleteCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
DeleteCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> DeleteCommand | ||
deactivate CommandResult | ||
|
||
DeleteCommand --> LogicManager : result | ||
deactivate DeleteCommand | ||
|
||
end | ||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.