Project: Intelli

Intelli is a desktop relationship tracker used by private investigators (PI) to manage their information and leads. The PI interacts with it using a CLI, and it has a GUI created with JavaFX and GraphStream. It is written in Java, and has about 6 kLoC.

Code contributed: [Functional code] [Test code]

Enhancement Added: Add Relationships

External behavior


Start of Extract [from: User Guide]

Adding a relationship between two persons: addRelationship

Adds a relationship between two persons in Intelli.
Format: addRelationship FROM_INDEX TO_INDEX DIRECTION [n/NAME] [ce/CONFIDENCE_ESTIMATE]

  • The indexes of the persons are based on the most recent listing shown.

  • The direction of the relationship can only be directed or undirected. The direction is case-insensitive.

  • The order of the indexes matters only when the direction is directed, as the relationship points from the person with FROM_INDEX to the person with TO_INDEX.

  • At any point of time there will be at most 1 relationship between any two persons. If adding a different relationship from the existing one between two persons is attempted, upon the addition the previous relationship between these two persons will be removed.

  • NAME referring to the name of the relationship can only be alphanumeric.

  • CONFIDENCE_ESTIMATE refers to the confidence estimate the user gives to the relationship. CONFIDENCE_ESTIMATE can only be numbers from 0 to 100 inclusive.

Examples:

  • addRelationship 1 3 directed ce/12.32131 Adds a directed relationship from the 1st person to the 3rd person with the confidence estimate of 12.32131.

  • addRelationship 2 3 undirected n/husband and wife ce/100 Adds an undirected relationship between the 2nd and 2rd with the name being 'husband and wife' and confidence estimate of 100.

End of Extract


Justification

This feature allows the user to record information about relationships between the persons in the address book and puts all the persons into a network which can be displayed using a graph.

Implementation


Start of Extract [from: Developer Guide]

addRelationship command

The addRelationship command adds a directed or undirected relationship between two persons in the address book. Name and confidence estimate are the optional fields in this command. The user is able to view the changes in the relationships in the graph window.

Design Considerations

Aspect: Implementation for addRelationship command
Alternative 1 (current choice): The command is implemented by adding one additional attribute UniqueRelationshipList to each person.
Pros: Implementation is easier as it follows the same logic as having the UniqueTagList.
Cons: All the relationships in the address book are not organized into a single entity (e.g. an adjacency list) which is more intuitive when the implementation involves a graph.
Alternative 2: Organize all the relationships into a single entity, instead of making them into lists under persons in the address book.
Pros: It is more intuitive to organize all the relationships into a single entity when the implementation involves a graph.
Cons: Maintenance of this single entity of graph can be costly as it can become massive.
Cons: Currently a person is identified by his/her index in the most recent listing. As the indexes of persons change, matching the relationship to the correct persons involved will be a headache.


Aspect: Record of the relationship in the address book
Alternative 1 (current choice): A relationship between two persons are recorded in both persons' UniqueRelationshipList.
Pros: Easy search of the relationship in the address book as both parties involved in the relationship have record of it.
Cons: Maintenance of the relationships is troublesome as a single relationship has to be added, modified or deleted twice.
Alternative 2: A relationship between two persons are recorded in the fromPerson’s `UniqueRelationshipList, except that when the relationship is undirected, it is recorded twice under both parties.
Pros: Easy maintenance of the relationships.
Cons: More scenarios to consider when performing actions to the relationship. Hence, it will lead to more difficult implementation.

End of Extract


Enhancement Added: Delete Relationships

External behavior


Start of Extract [from: User Guide]

Deleting a relationship between two persons : deleteRelationship

Deletes the relationship between two persons from Intelli.
Format: delete INDEX_FROM_PERSON INDEX_TO_PERSON

  • Deletes the relationship between two persons as specified using the indexes.

  • The index refers to the index number shown in the most recent listing.

  • The index must be a positive integer 1, 2, 3, …​

Examples:

  • list
    deleteRelationship 1 2
    Deletes the relationship from the first to the 2nd person in Intelli.

End of Extract


Justification

This feature allows the user to remove a redundant or wrong relationship.

Implementation


Start of Extract [from: Developer Guide]

deleteRelationship command

The deleteRelationship command deletes a relationship between two persons in the address book. The user is able to view the disappearance of the relationship in the graph window.

Design Considerations

Aspect: Implementation for deleteRelationship command
Alternative 1 (current choice): The indexes of the persons specified in user input does not matter.
Pros: User only needs to remember the two parties involved in the relationship to be deleted, making this command more user friendly.
Cons: More memory needed for the double record of relationships under both parties involved.
Alternative 2: The indexes of the persons specified in user input matters.
Pros: Less memory needed for recording the relationship.
Cons: User has to know the specific information of the relationship, making this command not user-friendly.

End of Extract


Enhancement Added: Remove tags

External behavior


Start of Extract [from: User Guide]

Removing a tag: removeTag

Removes the specific tag from Intelli.
Format: removeTag TAG

  • Removes the tag TAG.

  • TAG must be alphanumeric a-z, A-Z, 0-9.

Example:

  • removeTag friend
    Removes the tag friend from all the persons in Intelli.

End of Extract


Justification

This feature allows the user to remove a specific tag from all persons in the address book within a single command.

Implementation


Start of Extract [from: Developer Guide]

removeTag command

The removeTag command removes a tag with the specified name from the address book. All the appearances of the tag in the address book are removed. This command is implemented in the style of the edit command and delete command.

Design Considerations

Aspect: Implementation for removeTag command
Alternative 1 (current choice): The command is implemented using methods which remove the tag from each person’s tag list.
Pros: Implementation is modular and less dependent on methods used for other commands.
Cons: More tedious to implement since it is not making use of the existing resources such as edit command.
Alternative 2: Adapt current edit command so that removing the tag is done by editing every person’s tag list.
Pros: Making use of existing resources and easier implementation.
Cons: More dependency between commands and the relationship between edit and remove is not clear.


Aspect: Type of command implemented
Alternative 1 (current choice): removeTag command extends UndoableCommand instead of Command.
Pros: Accidental removal of tags can be recovered.
Cons: Additional memory needed for recording the previous stage of the address book.
Alternative 2: removeTag command extends Command.
Pros: No additional memory needed for recording the previous stage of the address book.
Cons: As the removal of Tag is from all the persons in address book, an accidental removal can be disastrous if the user does not intend a complete removal.


Aspect: Removal of the tag from all instead of some by user’s choice
Alternative 1 (current choice): The command currently does not support the removal of a tag from persons specified in the user input.
Pros: Easier implementation since it does not deal with the parsing of more user input.
Cons: The user cannot remove the tags from a few specific people in one command.
Alternative 2: The command allows the user input to specify the persons from whom the tag should be removed.
Pros: The user can remove the tags from a few specific people in one command.
Cons: Implementation is more difficult as parsing of additional user input required. It is also unlikely for user to remove the tag from many persons at once, hence there is a function overlap with edit command.

End of Extract


Other contributions

  • Wrote additional tests to increase coverage from 78% to 83% (Pull requests #130, #133)