diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 1629b4b5adf..eb40792c22a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -104,7 +104,7 @@ The *Sequence Diagram* below shows how the components interact with each other f Each of the four main components (also shown in the diagram above), * defines its *API* in an `interface` with the same name as the Component. -* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding API `interface` mentioned in the previous point. +* implements its functionality using a concrete `{Component Name}Manager` class which follows the corresponding API `interface` mentioned in the previous point. For example, the `Logic` component defines its API in the `Logic.java` interface and implements its functionality using the `LogicManager.java` class which follows the `Logic` interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below. @@ -197,7 +197,7 @@ The `Person` component, * The `Person` component, * stores the Unique User ID or UUID of the person * stores any number of `Attribute` objects in the `Person` object in the hash map - * does not require to have any `Attribute` objects + * is not required to have any `Attribute` objects * The `Unique User ID` component, * acts as the unique identifier for a person * the UUID is generated by the system and is unique for each person @@ -208,10 +208,12 @@ The `Person` component, +**Attribute** is an abstract class that represents a detail about a `Person`. All other attribute classes extend from this class. + * The `Attribute` component, * is used to store details about a `Person` * each attribute has a `name` and a `value` - * stored `Attribute` objects in the `Person` object in the hash map + * stores `Attribute` objects in the `Person` object in the hash map * Has general types of attributes (`StringAttribute`, `IntegerAttribute`, `DateAttribute`) * `StringAttribute` - stores a string value * `IntegerAttribute` - stores an integer value @@ -219,8 +221,8 @@ The `Person` component, * Users are able to create their own attributes using the `StringAttribute` class * They will have their own `String` name and `String` value * Has specific types of attributes (e.g. `NameAttribute`, `PhoneNumberAttribute`) with unique constraints relevant to their validity - * `NameAttribute` - stores the name of the person - * `PhoneNumberAttribute` - stores the phone number of the person and must be an integer of less than 10 digits + * `NameAttribute` extends the `StringAttribute`- stores the name of the person + * `PhoneNumberAttribute` extends the `IntegerAttribute` - stores the phone number of the person and must be an integer of less than 10 digits * `GenderAttribute` - stores the gender of the person and must be either `Male` or `Female` * does not depend on the other components (as the `Attribute` are standalone stores of details about the `Person`) #### Model component - Relationship diff --git a/docs/diagrams/AddPersonSequenceDiagram.puml b/docs/diagrams/AddPersonSequenceDiagram.puml index b0a641c7352..2dea466e2cb 100644 --- a/docs/diagrams/AddPersonSequenceDiagram.puml +++ b/docs/diagrams/AddPersonSequenceDiagram.puml @@ -29,6 +29,7 @@ activate person PERSON_COLOR person --[PERSON_COLOR]> logic : return new Person deactivate person +person --[Hidden]> person : model destroy person logic -[LOGIC_COLOR]> model : addPerson(personToAdd) @@ -47,6 +48,7 @@ deactivate storage STORAGE_COLOR_T1 storage --[STORAGE_COLOR]> logic : save complete deactivate storage +storage --[Hidden]> storage : model destroy storage logic --[LOGIC_COLOR]> ui : CommandResult("New person added. Details: Name: Bob") diff --git a/docs/diagrams/AttributeAdditionSequenceDiagram.puml b/docs/diagrams/AttributeAdditionSequenceDiagram.puml index 10a934884b6..50fac447ac2 100644 --- a/docs/diagrams/AttributeAdditionSequenceDiagram.puml +++ b/docs/diagrams/AttributeAdditionSequenceDiagram.puml @@ -26,6 +26,7 @@ activate attribute ATTRIBUTE_COLOR attribute --[ATTRIBUTE_COLOR]> logic : return attribute deactivate attribute +attribute --[HIDDEN]> attribute : model destroy attribute logic -[LOGIC_COLOR]> model : person.addAttribute(attribute) @@ -44,6 +45,7 @@ deactivate storage STORAGE_COLOR_T1 storage --[STORAGE_COLOR]> logic : save complete deactivate storage +storage --[HIDDEN]> storage : model destroy storage logic --[LOGIC_COLOR]> ui : CommandResult("Attribute added successfully.") diff --git a/docs/diagrams/AttributeEditSequenceDiagram.puml b/docs/diagrams/AttributeEditSequenceDiagram.puml index 9bcdf72975e..bf47845c2d3 100644 --- a/docs/diagrams/AttributeEditSequenceDiagram.puml +++ b/docs/diagrams/AttributeEditSequenceDiagram.puml @@ -32,6 +32,7 @@ activate attribute ATTRIBUTE_COLOR attribute --[ATTRIBUTE_COLOR]> logic : return edited attribute deactivate attribute +attribute --[HIDDEN]> attribute : model destroy attribute logic -[LOGIC_COLOR]> model : person.updateAttribute(editedAttribute) @@ -50,6 +51,7 @@ deactivate storage STORAGE_COLOR_T1 storage --[STORAGE_COLOR]> logic : save complete deactivate storage +storage --[HIDDEN]> storage : model destroy storage logic --[LOGIC_COLOR]> ui : CommandResult("Attribute edited successfully.") diff --git a/docs/diagrams/ClearSequenceDiagram.puml b/docs/diagrams/ClearSequenceDiagram.puml index 973cc306e77..17e47c404c3 100644 --- a/docs/diagrams/ClearSequenceDiagram.puml +++ b/docs/diagrams/ClearSequenceDiagram.puml @@ -27,14 +27,17 @@ clearCommand -> model : resetRelationshipDescriptors() activate model model --> clearCommand : relationships reset deactivate model +model --[HIDDEN]> clearCommand destroy model clearCommand --> logic : CommandResult("Address book has been cleared!") deactivate clearCommand +clearCommand --[hidden]> logic destroy clearCommand logic --> ui : display "Address book has been cleared!" deactivate logic +logic --[hidden]> ui destroy logic ui --> user : show "Address book has been cleared!" diff --git a/docs/diagrams/ClearTerminalSequenceDiagram.puml b/docs/diagrams/ClearTerminalSequenceDiagram.puml index d4a0cb183dc..c9483722047 100644 --- a/docs/diagrams/ClearTerminalSequenceDiagram.puml +++ b/docs/diagrams/ClearTerminalSequenceDiagram.puml @@ -21,6 +21,7 @@ controller -> dialogContainer : getChildren().clear() activate dialogContainer dialogContainer --> controller deactivate dialogContainer +dialogContainer --[hidden]> controller : destroy dialogContainer controller -> imageContainer : setVisible(false) @@ -32,12 +33,14 @@ controller -> imageContainer : setManaged(false) activate imageContainer imageContainer --> controller deactivate imageContainer +imageContainer --[hidden]> controller : destroy imageContainer controller -> scrollPane : getHeight() activate scrollPane scrollPane --> controller : return height deactivate scrollPane +scrollPane --[hidden]> controller : destroy scrollPane alt if height <= 150 @@ -50,6 +53,7 @@ controller -> cliInput : setText("") activate cliInput cliInput --> controller : input cleared deactivate cliInput +cliInput --[hidden]> controller : destroy cliInput controller --> user : clear complete diff --git a/docs/diagrams/DeleteAttributeSequenceDiagram.puml b/docs/diagrams/DeleteAttributeSequenceDiagram.puml index fac2790791d..de979c0e4d3 100644 --- a/docs/diagrams/DeleteAttributeSequenceDiagram.puml +++ b/docs/diagrams/DeleteAttributeSequenceDiagram.puml @@ -33,6 +33,7 @@ loop for each attribute person --[PERSON_COLOR]> logic : attribute deleted deactivate person end +destroy person logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) activate storage STORAGE_COLOR @@ -44,6 +45,7 @@ deactivate storage STORAGE_COLOR_T1 storage --[STORAGE_COLOR]> logic : save complete deactivate storage +storage --[HIDDEN]> storage : destroy storage logic --[LOGIC_COLOR]> ui : CommandResult("Attributes deleted successfully.") diff --git a/docs/diagrams/DeletePersonSequenceDiagram.puml b/docs/diagrams/DeletePersonSequenceDiagram.puml index d77c29dff46..85e193e67ee 100644 --- a/docs/diagrams/DeletePersonSequenceDiagram.puml +++ b/docs/diagrams/DeletePersonSequenceDiagram.puml @@ -27,7 +27,13 @@ model --[MODEL_COLOR]> logic : return matching Person deactivate model logic -[LOGIC_COLOR]> model : deletePerson(personToDelete) +activate model MODEL_COLOR +model --[MODEL_COLOR]> logic : +deactivate model logic -[LOGIC_COLOR]> model : deleteRelationshipsOfPerson(targetUuid) +activate model MODEL_COLOR +model --[MODEL_COLOR]> logic : +deactivate model logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) activate storage STORAGE_COLOR diff --git a/docs/diagrams/FindSequenceDiagram.puml b/docs/diagrams/FindSequenceDiagram.puml index 3a903782121..d2710c11a61 100644 --- a/docs/diagrams/FindSequenceDiagram.puml +++ b/docs/diagrams/FindSequenceDiagram.puml @@ -31,13 +31,13 @@ activate parser ABPARSER_COLOR parser -[ABPARSER_COLOR]> findCommand : new FindCommand(keywords) activate findCommand FINDCOMMAND_COLOR deactivate parser -destroy parser findCommand -[FINDCOMMAND_COLOR]> predicate : new NameContainsKeywordsPredicate(keywords) activate predicate PREDICATE_COLOR predicate -[PREDICATE_COLOR]> findCommand : predicate deactivate predicate +predicate --[HIDDEN]> findCommand : destroy predicate findCommand -[FINDCOMMAND_COLOR]> model : updateFilteredPersonList(predicate) @@ -48,6 +48,7 @@ deactivate model findCommand -[FINDCOMMAND_COLOR]> logic : CommandResult("X persons found") deactivate findCommand +findCommand --[HIDDEN]> : destroy findCommand logic -[LOGIC_COLOR]> ui : display "X persons found" diff --git a/docs/diagrams/PersonClassDiagram.png b/docs/diagrams/PersonClassDiagram.png deleted file mode 100644 index c500a416e41..00000000000 Binary files a/docs/diagrams/PersonClassDiagram.png and /dev/null differ diff --git a/docs/images/AddPersonSequenceDiagram.png b/docs/images/AddPersonSequenceDiagram.png index a563e21ba01..68cc35dd78a 100644 Binary files a/docs/images/AddPersonSequenceDiagram.png and b/docs/images/AddPersonSequenceDiagram.png differ diff --git a/docs/images/AttributeAdditionSequenceDiagram.png b/docs/images/AttributeAdditionSequenceDiagram.png index e34f2fdd3d2..68a9d443171 100644 Binary files a/docs/images/AttributeAdditionSequenceDiagram.png and b/docs/images/AttributeAdditionSequenceDiagram.png differ diff --git a/docs/images/AttributeEditSequenceDiagram.png b/docs/images/AttributeEditSequenceDiagram.png index ea58e710346..a42672cba40 100644 Binary files a/docs/images/AttributeEditSequenceDiagram.png and b/docs/images/AttributeEditSequenceDiagram.png differ diff --git a/docs/images/ClearSequenceDiagram.png b/docs/images/ClearSequenceDiagram.png index d3439ba9710..c9912382496 100644 Binary files a/docs/images/ClearSequenceDiagram.png and b/docs/images/ClearSequenceDiagram.png differ diff --git a/docs/images/ClearTerminalSequenceDiagram.png b/docs/images/ClearTerminalSequenceDiagram.png index b5d55e2d028..b1cef3ac08c 100644 Binary files a/docs/images/ClearTerminalSequenceDiagram.png and b/docs/images/ClearTerminalSequenceDiagram.png differ diff --git a/docs/images/DeleteAttributeSequenceDiagram.png b/docs/images/DeleteAttributeSequenceDiagram.png index adb6d3847d0..c1ed5fd5606 100644 Binary files a/docs/images/DeleteAttributeSequenceDiagram.png and b/docs/images/DeleteAttributeSequenceDiagram.png differ diff --git a/docs/images/DeletePersonSequenceDiagram.png b/docs/images/DeletePersonSequenceDiagram.png index 420492a43f8..46133632d98 100644 Binary files a/docs/images/DeletePersonSequenceDiagram.png and b/docs/images/DeletePersonSequenceDiagram.png differ diff --git a/docs/images/FindSequenceDiagram.png b/docs/images/FindSequenceDiagram.png index 5d322133d22..6cc86bb1b45 100644 Binary files a/docs/images/FindSequenceDiagram.png and b/docs/images/FindSequenceDiagram.png differ