forked from nus-cs2103-AY2324S1/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 #138 from Cleon2/feature_improved_ug
add uml diagrams for star and unstar commands
- Loading branch information
Showing
6 changed files
with
232 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
|
||
start | ||
:User enters star command; | ||
|
||
if () then ([Valid Index]) | ||
if () then ([Date is not starred]) | ||
:Apply star on date; | ||
else ([Else]) | ||
:Command exception is thrown; | ||
endif | ||
else ([Else]) | ||
:Command exception is thrown; | ||
endif | ||
|
||
stop | ||
@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,77 @@ | ||
@startuml | ||
!include Style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":LoveBookParser" as LoveBookParser LOGIC_COLOR | ||
participant ":StarCommandParser" as StarCommandParser LOGIC_COLOR | ||
participant "d:StarCommand" as StarCommand 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("star 1") | ||
activate LogicManager | ||
|
||
LogicManager -> LoveBookParser : parseCommand("star 1") | ||
activate LoveBookParser | ||
|
||
create StarCommandParser | ||
LoveBookParser -> StarCommandParser | ||
activate StarCommandParser | ||
|
||
StarCommandParser --> LoveBookParser | ||
deactivate StarCommandParser | ||
|
||
LoveBookParser -> StarCommandParser : parse("star 1") | ||
activate StarCommandParser | ||
|
||
create StarCommand | ||
StarCommandParser -> StarCommand | ||
activate StarCommand | ||
|
||
StarCommand --> StarCommandParser : d | ||
deactivate StarCommand | ||
|
||
StarCommandParser --> LoveBookParser : d | ||
deactivate StarCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
StarCommandParser -[hidden]-> LoveBookParser | ||
destroy StarCommandParser | ||
|
||
LoveBookParser --> LogicManager : d | ||
deactivate LoveBookParser | ||
|
||
LogicManager -> StarCommand : execute() | ||
activate StarCommand | ||
|
||
StarCommand -> Model : setPerson(dateToStar, starredDate) | ||
activate Model | ||
|
||
|
||
Model --> StarCommand | ||
deactivate Model | ||
|
||
StarCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS) | ||
activate Model | ||
|
||
Model --> StarCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
StarCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> StarCommand | ||
deactivate CommandResult | ||
|
||
StarCommand --> LogicManager : result | ||
deactivate StarCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@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,21 @@ | ||
|
||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
|
||
start | ||
:User enters unstar command; | ||
|
||
if () then ([Valid Index]) | ||
if () then ([Date is starred]) | ||
:Apply unstar on date; | ||
else ([Else]) | ||
:Command exception is thrown; | ||
endif | ||
else ([Else]) | ||
:Command exception is thrown; | ||
endif | ||
|
||
stop | ||
@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,77 @@ | ||
@startuml | ||
!include Style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":LoveBookParser" as LoveBookParser LOGIC_COLOR | ||
participant ":UnstarCommandParser" as UnstarCommandParser LOGIC_COLOR | ||
participant "d:UnstarCommand" as UnstarCommand 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("unstar 1") | ||
activate LogicManager | ||
|
||
LogicManager -> LoveBookParser : parseCommand("unstar 1") | ||
activate LoveBookParser | ||
|
||
create UnstarCommandParser | ||
LoveBookParser -> UnstarCommandParser | ||
activate UnstarCommandParser | ||
|
||
UnstarCommandParser --> LoveBookParser | ||
deactivate UnstarCommandParser | ||
|
||
LoveBookParser -> UnstarCommandParser : parse("unstar 1") | ||
activate UnstarCommandParser | ||
|
||
create UnstarCommand | ||
UnstarCommandParser -> UnstarCommand | ||
activate UnstarCommand | ||
|
||
UnstarCommand --> UnstarCommandParser : d | ||
deactivate UnstarCommand | ||
|
||
UnstarCommandParser --> LoveBookParser : d | ||
deactivate UnstarCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
UnstarCommandParser -[hidden]-> LoveBookParser | ||
destroy UnstarCommandParser | ||
|
||
LoveBookParser --> LogicManager : d | ||
deactivate LoveBookParser | ||
|
||
LogicManager -> UnstarCommand : execute() | ||
activate UnstarCommand | ||
|
||
UnstarCommand -> Model : setPerson(dateToStar, starredDate) | ||
activate Model | ||
|
||
|
||
Model --> UnstarCommand | ||
deactivate Model | ||
|
||
UnstarCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS) | ||
activate Model | ||
|
||
Model --> UnstarCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
UnstarCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> UnstarCommand | ||
deactivate CommandResult | ||
|
||
UnstarCommand --> LogicManager : result | ||
deactivate UnstarCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@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