Lin Qing's Project Portfolio Page
Objectives
A software Engineering project focusing on the implementation of a Brown Field Project with an empahsis on Team work with different team members that adopts a software iterative approach to development.
Overview
Project: Police address book
A Police Address Book (PAB) is a desktop app. It is meant for Police Investigation Officers, optimized for use via a Command Line Interface (CLI) with a Graphical User Interface (GUI). This app helps to manage their investigative cases by having people’s detailed information, assisting in sending case detail emails to colleagues or call notification emails to people in the contact list and able to remind them to follow up on the case
Summary of Contributions
- Code contributed: RepoSense link
Enhancements implemented:
- Add NRIC#12
- Add or update AddCommand, EditCommand, NRIC Testcase#12
- Show NRIC in the display app#11
- Replace IC code to NRIC and fix addCommand message#37
- Fix NRIC to valid NRIC format in Singapore#63
- Fix NRIC to be capital letter#83
- Check NRIC, phone number or email for duplicated instead of Name#65
- Add followUp testcase and description testcase#134
- Update AddCommandParserTest, CommandTestUtil and the test related the NRIC#83
- Debug the date, description and remark in editCommand feature#85
Contribution to Documentation:
User Guide:
Did cosmetic tweaks to existing documentation of features and Contribute to documents regarding the NRIC, help feature image, remark feature, adding a person feature, editing a person feature, find feature and command summary.#12,#40, #37,#63,#93,#11#29
Developer Guide:
- Update ModelClassDiagram, BetterModelClassDiagram#83,#91
- Add AddCommandActivityDIagram,AddCommandSequenceDiagram #83,#91
- Add Implementation for add feature and all documents for addCommand feature.
- Add Design consideration regarding how to add command executes and how to delete command executes #91
- Add some of the user stories #47
- Add use case for delete a person, edit a person and send email to the person#63
- Did cosmetic tweaks to existing documentation.
Contributions to team-based tasks:
- Setting up tools e.g., Github webpage, assertion-enabled in build.gradle
- Maintaining the issue tracker to create issue in version 1.1, 1.3, 1.4 and close issue tacker in version 1.1, 1.2, 1.2b, 1.3, and put a label on it.
- Maintaining the milestone to create milestone with deadline in version 1.2, 1,3, 1.4 and close the milestone in version 1.1, 1.2, 1.3.
- Updating developer docs that are not specific to a feature such as. documenting some user stories, use case for delete a person, edit a person and send email to person
- Updating developer docs that are not specific to a feature such as command summary
- Delete irrelevant picture(png) in our project
Community:
- PRs reviewed (with non-trivial review comments): #107, #18, #36
- Reported bugs and suggestions: #129,#128,#127,#126,#124
Contributions to the Developer Guide (Extracts):
Add feature:
The AddCommand
feature allows the user to add a new person and save it to the address book.
Implementation
Given below is the Sequence Diagram for interactions within the Logic
component for the execute("add n/John Doe d/22-02-2021 i/S2731125H p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 de/This man stole 3 times r/shop theft t/NeverCalled")
API call.
AddCommandSequenceDiagram
AddCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
The following activity diagram summarizes what happens when a user executes addCommand feature:
The add
command facilitated by AddClaimCommand
which extends the Command
class and the AddCommandParser
class, which implements the Parser
class.
This operation takes in a String input from the user that will create Person
objects based on the following prefixes and parameters:
n/name
, d/date
, f/followUp
, i/nric
, p/phone
, e/email
, a/address
, de/description
, r/remark
, t/tag
.
Meanwhile, the r/remark
and t/tag
are not compulsory to include.
A regex validation check will be imposed upon the creation. Any checks that fails the validation would display an error message to guide the user.
Parameters will be checked whether they are valid:
-
name
usesName#isValidName()
to ensure that name only contain alphanumeric characters and spaces, and it should not be blank. -
nric
usesNric#isValidNric()
to ensure that nric only contain a capital letter,it should start with S, T, F or G,followed by 7 numerical numbers and a capital letter with alphabetical character. It should not be blank. -
date
usesDate#isValidDate()
to ensure that date should follow date format ‘dd-mm-yyyy’, and it should be a valid calendar date. -
phone
usesPhone#isValidPhone()
to ensure that phone numbers should only contain numbers, and it should be 3-15 digits long. -
email
usesEmail#isValidEmail()
to ensure correct email format. -
followUp
usesFollowUp#isValidFollowUp()
to ensure that FollowUp should only contain positive integers, and it should not be blank.
Upon receiving a user command that has add
as the first word, the following object interactions will occur, resulting in the instantiation of an AddCommand
object:
-
MainWindow
object callsLogicManager#execute(input)
, whereinput
is the user’s input string; -
LogicManager
object callsAddressBookParser#parseCommand(commandText)
to parse the user command, wherecommandText
is the user’s input string; -
AddressBookParser#parseCommand()
callsAddCommandParser#parse(arguments)
, wherearguments
are the parameters incommandText
such asi/NRIC
; In this case,AddClaimCommandParser#parse()
is being created, and the user’s input will be passed in as a parameter. -
AddCommandParser#parse()
will do a validation check on the user’s input before creating and returning aAddCommand
object withPerson
as its attribute.calls
Next, the following object interactions will occur to save the new person information to the Model
object;
-
LogicManager
object callsAddCommand#execute(model)
, wheremodel
is theModel
object and checking whether there is an existing Person -
AddCommand#execute()
callsModel#addPerson(toAdd)
to add the newPerson
, wheretoAdd
is thePerson
object to be stored. It will return aCommandResult
to theLogicManager
that will return to user.
Design consideration:
Aspect: How add command executes
-
Alternative 1 (current choice): unique NRIC, phone number or email to the entire address book.
- Pros: Since each person have unique NRIC, phone number or email, it can easily be retrieved from
UniquePersonList
. This will reduce coupling when the person is to be updated. - Cons: Every time we retrieve a person using his
Nric
,phone number
oremail
, we have to search through the wholeUniquePersonList
to find the associated person. As the list gets bigger, this may take more time.
- Pros: Since each person have unique NRIC, phone number or email, it can easily be retrieved from
-
Alternative 2 : unique name to the entire address book
- Pros: Since each person have unique name, it can easily be retrieved from
UniquePersonList
. - Cons: There may be a person that have the same name in the world.Therefore, it will have “fake” duplicate issue.
We have decided to opt for the first option primarily because it reduces the number of potential bugs such as “fake” duplication issue and the complexities involved. Moreover, the implementation is still fast enough for small-scale organisations to pick up our app and use it, minimising the cons. - Pros: Since each person have unique name, it can easily be retrieved from
Aspect: How delete command executes
-
Alternative 1 (current choice): deleting by index
- Pros: Since each person’s information has a unique index, any deletion by the index is less prone to bugs and easier to implement.
- Cons: User will have to scroll the list for the data entry and look for its index which can be inconvenient.
-
Alternative 2 : deleting by NRIC
- Pros: Since each person have unique NRIC, any deletion by the NRIC is less prone to bugs.
- Cons: User will need to remember the specific person’s NRIC, it is very inconvenient to user.
We have decided to opt for the first option primarily because it is more convenient to the user as compare to alternative 2.