forked from nus-cs2103-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #98 from yorklim/DevGuide
Add addpolicy feature implementation to DevGuide
- Loading branch information
Showing
4 changed files
with
122 additions
and
10 deletions.
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
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 | ||
!include style.puml | ||
skinparam objectFontColor white | ||
|
||
object "<u>:AddPolicyCommand</u>" as AddPolicyCommand LOGIC_COLOR | ||
object "<u>:AddPolicyCommandParser</u>" as AddPolicyCommandParser LOGIC_COLOR | ||
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR | ||
object "<u>:Model</u>" as Model MODEL_COLOR | ||
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR | ||
object "<u>policyAddedPerson:Person" as Person1 LOGIC_COLOR | ||
object "<u>personToAddPolicy:Person" as Person2 LOGIC_COLOR | ||
object "<u>:ArgumentMultimap" as ArgumentMultimap LOGIC_COLOR | ||
object "<u>:ParserUtil" as ParserUtil LOGIC_COLOR | ||
|
||
AddressBookParser --> AddPolicyCommandParser : calls | ||
AddressBookParser --> AddPolicyCommand | ||
AddPolicyCommandParser -> AddPolicyCommand | ||
AddPolicyCommandParser --> ArgumentMultimap : instantiates | ||
ParserUtil --> ArgumentMultimap : parses | ||
AddPolicyCommand --> Person1 | ||
AddPolicyCommand --> Person2 | ||
AddPolicyCommand --> Model | ||
AddPolicyCommand -right-> CommandResult : outputs | ||
Model --> Person2 : Removes | ||
Model --> Person1 : Updates | ||
@enduml |
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,60 @@ | ||
@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 "a:AddPolicyCommand" as AddPolicyCommand 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("addpolicy 1 n/Travel i/1") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("addpolicy 1 n/Travel i/1") | ||
activate AddressBookParser | ||
|
||
create AddPolicyCommand | ||
AddressBookParser -> AddPolicyCommand : AddPolicyCommand(1, newPolicy) | ||
activate AddPolicyCommand | ||
|
||
AddPolicyCommand --> AddressBookParser | ||
deactivate AddPolicyCommand | ||
|
||
AddressBookParser --> LogicManager : a | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddPolicyCommand : execute() | ||
activate AddPolicyCommand | ||
|
||
AddPolicyCommand -> Model : setPerson(personToAddPolicy, policyAddedPerson) | ||
activate Model | ||
|
||
Model --> AddPolicyCommand | ||
deactivate Model | ||
|
||
AddPolicyCommand -> Model : setDisplayClient(policyAddedPerson) | ||
activate Model | ||
|
||
Model --> AddPolicyCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddPolicyCommand --> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddPolicyCommand | ||
deactivate CommandResult | ||
|
||
AddPolicyCommand --> LogicManager : result | ||
deactivate AddPolicyCommand | ||
AddPolicyCommand -[hidden]-> LogicManager : result | ||
destroy AddPolicyCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |