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 #322 from ReflectiveObsidian/dg-implementation-person
Add implementation text for person commands
- Loading branch information
Showing
15 changed files
with
270 additions
and
28 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,24 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
skinparam ArrowFontStyle plain | ||
|
||
start | ||
|
||
:User enters command; | ||
|
||
:Parse command for attributes of person to add; | ||
|
||
if (Are there duplicate attribute names?) then (no) | ||
:Create a new person; | ||
:Add the attributes to the person; | ||
:Add the person to the model; | ||
:Save the address book containing the new person to storage; | ||
:Inform user: New person added. Details: ...; | ||
else (yes) | ||
:Inform user: Duplicate attributes found ...; | ||
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,57 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
Actor User as user USER_COLOR | ||
Participant ":UI" as ui UI_COLOR | ||
Participant ":Logic" as logic LOGIC_COLOR | ||
Participant ":Model" as model MODEL_COLOR | ||
Participant ":Person" as person PERSON_COLOR | ||
Participant ":Attribute" as attribute ATTRIBUTE_COLOR | ||
Participant ":Storage" as storage STORAGE_COLOR | ||
|
||
user -[USER_COLOR]> ui : "add /Name Bob" | ||
activate ui UI_COLOR | ||
|
||
ui -[UI_COLOR]> logic : execute("add /Name Bob") | ||
activate logic LOGIC_COLOR | ||
|
||
loop all attributes in command | ||
logic -[LOGIC_COLOR]> attribute : AttributeUtil.createAttribute(attributeName, attributeValue) | ||
activate attribute ATTRIBUTE_COLOR | ||
|
||
attribute --[ATTRIBUTE_COLOR]> logic : return new Attribute | ||
deactivate attribute | ||
end | ||
|
||
logic -[LOGIC_COLOR]> person : Person(attributesToAdd) | ||
activate person PERSON_COLOR | ||
|
||
person --[PERSON_COLOR]> logic : return new Person | ||
deactivate person | ||
destroy person | ||
|
||
logic -[LOGIC_COLOR]> model : addPerson(personToAdd) | ||
activate model MODEL_COLOR | ||
|
||
model --[MODEL_COLOR]> logic : return added Person | ||
deactivate model | ||
|
||
logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) | ||
activate storage STORAGE_COLOR | ||
|
||
storage -[STORAGE_COLOR]> storage : Save to file | ||
activate storage STORAGE_COLOR_T1 | ||
storage --[STORAGE_COLOR]> storage : file saved | ||
deactivate storage STORAGE_COLOR_T1 | ||
|
||
storage --[STORAGE_COLOR]> logic : save complete | ||
deactivate storage | ||
destroy storage | ||
|
||
logic --[LOGIC_COLOR]> ui : CommandResult("New person added. Details: Name: Bob") | ||
deactivate logic | ||
|
||
ui--[UI_COLOR]> user : display "New person added. Details: Name: Bob" | ||
deactivate ui | ||
@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,25 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
skinparam ArrowFontStyle plain | ||
|
||
start | ||
|
||
:User enters command; | ||
|
||
:Parse command for 4-character UUID; | ||
:Get full UUID; | ||
|
||
if (Does full UUID exist?) then (yes) | ||
:Get the corresponding person from address book; | ||
:Delete person from address book; | ||
:Delete person's relationships from address book; | ||
:Save updated address book with deleted person to storage; | ||
:Inform user: Deleted Person: Details: ...; | ||
else (no) | ||
:Inform user: The UUID provided 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,49 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
Actor User as user USER_COLOR | ||
Participant ":UI" as ui UI_COLOR | ||
Participant ":Logic" as logic LOGIC_COLOR | ||
Participant ":Model" as model MODEL_COLOR | ||
Participant ":Storage" as storage STORAGE_COLOR | ||
|
||
user -[USER_COLOR]> ui : "delete /0001" | ||
activate ui UI_COLOR | ||
|
||
ui -[UI_COLOR]> logic : execute("delete /0001") | ||
activate logic LOGIC_COLOR | ||
|
||
logic -[LOGIC_COLOR]> model : getFullUuid("0001") | ||
activate model MODEL_COLOR | ||
|
||
model --[MODEL_COLOR]> logic : return UUID object | ||
deactivate model | ||
|
||
logic -[LOGIC_COLOR]> model : person.getPersonbyUuid(targetUuid) | ||
activate model MODEL_COLOR | ||
|
||
model --[MODEL_COLOR]> logic : return matching Person | ||
deactivate model | ||
|
||
logic -[LOGIC_COLOR]> model : deletePerson(personToDelete) | ||
logic -[LOGIC_COLOR]> model : deleteRelationshipsOfPerson(targetUuid) | ||
|
||
logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) | ||
activate storage STORAGE_COLOR | ||
|
||
storage -[STORAGE_COLOR]> storage : Save to file | ||
activate storage STORAGE_COLOR_T1 | ||
storage --[STORAGE_COLOR]> storage : file saved | ||
deactivate storage STORAGE_COLOR_T1 | ||
|
||
storage --[STORAGE_COLOR]> logic : save complete | ||
deactivate storage | ||
destroy storage | ||
|
||
logic --[LOGIC_COLOR]> ui : CommandResult("Deleted Person: Details: ...") | ||
deactivate logic | ||
|
||
ui--[UI_COLOR]> user : display "Deleted Person: Details: ..." | ||
deactivate ui | ||
@enduml |
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.
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
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