nus-cs2103-AY1718S1 / forum

Discussion Forum
5 stars 0 forks source link

DeleteByName Command #121

Open AceCentury opened 7 years ago

AceCentury commented 7 years ago

As the name suggests, this command allows users to delete with the person's name. The description shown below is for implementation v1.2. It can be found from this branch: https://github.com/AceCentury/addressbook-level4/tree/Add_DeleteByName_Command

More documentation can be found in the UG and DG respectively.

Format: deletebyname NAME

Examples: deletebyname John Doe Deletes John Doe in the address book, if the person exists.

Advantage(s) versus DeleteCommand:

Disadvantage(s) versus DeleteCommand:

In order to mitigate the disadvantages when compared to DeleteCommand, DeleteByNameCommand also suggests possible persons for deletion with similar names when no matching name is found in the Address Book. The Model is also updated to display the list of suggested persons, similar to FindCommand.

DeleteByNameCommand also updates the Model to list all persons with matching names if there is more than 1 person with the exact same name as the person to be deleted. This is an enhancement over the traditional FindCommand as it will not list any other persons whose names match part of the query. It will then prompt users to utilise the DeleteCommand.

For those interested in v1.1.5, you may refer to this commit: https://github.com/AceCentury/addressbook-level4/commit/836e702e5ada5ab494f80eeef6cae0e8c9793d90

v1.1.5 does not have exception handling of multiple persons with the same name (it will just delete the first person who matches that criteria, very bad implementation), neither will it suggest persons to delete.