Project: People.connect
People.connect is a desktop address book application. This application is catered to meet the requirements of a
businessman who wants to keep his business contacts at the same place and then access them quickly and efficiently. It
has a GUI but most of the user interactions happen using a CLI (Command Line Interface).
Code contributed: [Functional code] [Test code]
Enhancement Added: Photo attribute
External behavior
When a new user is added to the address book, for a person to be easily identified, a photo could be added. However, this field may be optional. The address book will still provide a default image so that the list will look consistent. In addition, a person can also edit a photo by just editing the photo file name of a person.
Justification
If a user were to associate a person in the address book with a photo, in the case of two people having the same name, the user can easily differentiate them.
Photo attribute
Person class consists of five different attributes: Name
, Address
, Phone
, Email
and Birthday
. Photo class has a very similar implementation compared to the other attribute classes. New instance of Photo is initialized by giving the constructor the parameter photo in String format. The parameter is optional and if a file is not in the correct location, a default photo will be loaded on the address book.
Validation
The valid form for a birthday string is template.jpg
, where both file name and file type must be valid. This validation is performed to prohibit the user from inputting something completely peculiar, for example a file name which only consists of numbers and a file type which is not an image.
Examples for a valid photo file name:
-
abc.jpg
-
JPG.png
-
EddyTan.jpg
Examples for a invalid photo file name:
-
.jpg
-
123.txt
-
EddyTan
End of Extract
Enhancement Added: Sort
External behavior
A user might have a long list of contacts and the sort command could be used to allow the address book to be more user-friendly as it will be sorted in alphabetical order.
Justification
If a user were to have a list of 100 persons it will be tough to find the 49 added person if the user could not remember the index. The user can just use the sort command and looking through a list in alphabetical order is much hassle free.
Sort mechanism
The sort mechanism is facilitated the AddressBookParser
where the sort command will be called.
When a sort command is executed, the sort command will conduct a sort on the current list
in the address book based on the full name in alphabetical order.
The following sequence diagram shows how the sort operation works:
The following activity diagram summarize what happens inside the Sort Command
when a user executes the command:
Design Considerations
Aspect: Implementation of SortCommand
Alternative 1 (current choice): Sort list by the sort command parser to sort the current ObservableList<ReadOnlyPerson> person list.
Pros: We will not make any changes to the current internalList
thus will not affect any other commands that we have implemented.
Cons: Hard for new developers to understand the way we sort the read only person list.
Alternative 2: Just sort the internalList
Pros: Does not involve the ObservableList
, easier for new developers to understand.
Cons: Changes made to the internalList
might affect other existing commands.
End of Extract
Enhancement Added: Locate
External behavior
A user has the address of each contact and the locate command could assist them to route from their current location to the chosen contacts address.
Justification
If we were to just locate the destination of the contacts address it would not benefit the user as much as routing the exact route the user could take from the origin to destination.
Locate mechanism
The locate mechanism is facilitated by an PersonPanelSelectionChangedEvent
which resides in Events
.
It supports locating an address on Google maps based on the person selected based on the index chosen.
The following sequence diagram shows how the locate operation works:
Design Considerations
Aspect: Implementation of LocateCommand
Alternative 1 (current choice): Add a new class LocateCommandParser
Pros: We will be able to provide arguments to locate a specific person
Cons: Hard for new developers to understand why we used locate
command instead of using mouse to select a specific person.
Alternative 2: No locate command parser class
Pros: Easier for new developers to understand
Cons: Increase mouse usage instead of making full use of the Command Line Interface(CLI)
End of Extract
Enhancement Proposed: Sort by birthday command sort birthday
Currently, the sort function only sorts the name. We could allow the user to sort by birthday so that the user can see upcoming birthdays shown at the top of the list.