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]
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]
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.
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
Deleting a relationship between two persons : deleteRelationship
Deletes the relationship between two persons from Intelli.
Format: delete INDEX_FROM_PERSON INDEX_TO_PERSON
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.
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
Removing a tag: removeTag
Removes the specific tag from Intelli.
Format: removeTag TAG
Example:
-
removeTag friend
Removes the tagfriend
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.
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