forked from nus-cs2103-AY2324S2/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 #268 from tsulim/263-update-fav-unfav-dg
Update `fav`/`unfav` feature to be more specific in developer guide
- Loading branch information
Showing
17 changed files
with
276 additions
and
130 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,42 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant "f:FavCommand" as FavCommand LOGIC_COLOR | ||
participant "r:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":ModelManager" as Model MODEL_COLOR | ||
end box | ||
|
||
activate LogicManager | ||
|
||
LogicManager -> FavCommand : execute(model) | ||
activate FavCommand | ||
|
||
FavCommand -> Model : getSortedFilteredPersonList() | ||
activate Model | ||
return | ||
|
||
ref over FavCommand : create a favourite person | ||
|
||
FavCommand -> Model : setPerson(personToFav, favPerson) | ||
activate Model | ||
return | ||
|
||
FavCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS) | ||
activate Model | ||
return | ||
|
||
create CommandResult | ||
FavCommand -> CommandResult++ | ||
return | ||
|
||
return r | ||
[<- 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,42 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant "u:UnfavCommand" as UnfavCommand LOGIC_COLOR | ||
participant "r:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":ModelManager" as Model MODEL_COLOR | ||
end box | ||
|
||
activate LogicManager | ||
|
||
LogicManager -> UnfavCommand : execute(model) | ||
activate UnfavCommand | ||
|
||
UnfavCommand -> Model : getSortedFilteredPersonList() | ||
activate Model | ||
return | ||
|
||
ref over UnfavCommand : create an unfavourite person | ||
|
||
UnfavCommand -> Model : setPerson(personToUnfav, unfavPerson) | ||
activate Model | ||
return | ||
|
||
UnfavCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS) | ||
activate Model | ||
return | ||
|
||
create CommandResult | ||
UnfavCommand -> CommandResult++ | ||
return | ||
|
||
return r | ||
[<- 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,23 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
start | ||
:User executes fav command; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([index is valid]) | ||
if () then ([Person is favourite]) | ||
:Create new Person with same values but is a favourite; | ||
:Replace the original Person with the new one; | ||
:Refresh the list of Persons; | ||
else ([else]) | ||
:Show error message to user that person is already a favourite; | ||
endif | ||
else ([else]) | ||
:Show error message to user that index is invalid; | ||
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,31 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
mainframe **sd** create a favourite person | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant "f:FavCommand" as FavCommand LOGIC_COLOR | ||
participant FavCommand as FavCommand1 <<class>> LOGIC_COLOR | ||
participant "<<class>>\nPersonUtil" as PersonUtil LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Person" as Person MODEL_COLOR | ||
end box | ||
|
||
FavCommand -> FavCommand1 : createFavPerson(personToFav) | ||
activate FavCommand | ||
activate FavCommand1 | ||
|
||
FavCommand1 -> PersonUtil : createPersonWithFavouriteStatus(selectedPerson, favourite) | ||
activate PersonUtil | ||
|
||
create Person | ||
PersonUtil -> Person++ | ||
return createdPerson | ||
|
||
return favPerson | ||
return favPerson | ||
|
||
@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
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,23 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
start | ||
:User executes unfav command; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([index is valid]) | ||
if () then ([Person is favourite]) | ||
:Create new Person with same values but is not a favourite; | ||
:Replace the original Person with the new one; | ||
:Refresh the list of Persons; | ||
else ([else]) | ||
:Show error message to user that person is already not a favourite; | ||
endif | ||
else ([else]) | ||
:Show error message to user that index is invalid; | ||
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,33 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
skinparam ParticipantPadding 20 | ||
|
||
mainframe **sd** create an unfavourite person | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant "u:UnfavCommand" as UnfavCommand LOGIC_COLOR | ||
participant UnfavCommand as UnfavCommand1 <<class>> LOGIC_COLOR | ||
participant "<<class>>\nPersonUtil" as PersonUtil LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Person" as Person MODEL_COLOR | ||
end box | ||
|
||
|
||
UnfavCommand -> UnfavCommand1 : createUnfavPerson(personToUnfav) | ||
activate UnfavCommand1 | ||
|
||
UnfavCommand1 -> PersonUtil : createPersonWithFavouriteStatus(selectedPerson, favourite) | ||
activate PersonUtil | ||
|
||
create Person | ||
PersonUtil -> Person++ | ||
return createdPerson | ||
|
||
return unfavPerson | ||
return unfavPerson | ||
|
||
|
||
@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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.