Project: 3W

3W is a desktop address book and task book application designed for University students, business people and all those who have a busy daily schedule. The user interacts with it using a CLI, and it has a GUI created with JavaFX.

Code contributed: [functional code][test code]

Enhancement Added:

External behavior


Start of Extract [from: User Guide]

Adding a new task : addTask

Adds a new task to the task book
Format: addTask/at
Details: addTask n/TaskName d/Description s/startDateTime f/finishDateTime c/priority [t/TAG]…​

A task can have any number of tags (including 0), the tag mechanism is the same as that for person. A task has a special field called priority (ranges from 1 to 5, with 1 being the most important). If a priority is not specified during adding of this task, a normal (3) priority wil be set by default.

Examples:

  • addTask n/picnic d/have fun at Botanic Garden s/1/1/2017 12:00pm f/1/1/2017 15:00pm c/3 t/friends

Listing all tasks : listTask/

Shows a list of all tasks in the task book,including all completed tasks, which are with green click .
Format: listTask/lt

Clearing all tasks : clearTask

Clears all entries from the task book.
Format: clearTask/ct

Locating tasks by name: findTask

Finds tasks whose names or description contain any of the given keywords.
Format: findTask/ft
Details: find KEYWORD [MORE_KEYWORDS]

  • The search is case insensitive. e.g Picnic will match picnic

  • The order of the keywords matters. e.g. final exam will not match exam final

  • Only the name/description are searched.

  • Full words are not need for matching e.g. meet will match meeting

  • Tasks matching at least one keyword will be returned (i.e. OR search). e.g. final/meet will return CS2103 final, CS2101 meeting

Examples:

  • find picnic
    Returns any task having name/description picnic

  • find picnic/meeting
    Returns any task having name/description picnic or meeting ==== Selecting a task : selectTask

Selects the task identified by the index number used in the last task listing.
Format: selectTask/st
Details: selectTask INDEX

  • Selects the task and display the task at the specified INDEX.

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

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

Examples:

  • select 2
    Selects the 2nd task in the task book.

Editing a new task : editTask

Edits an existing task in the address book
Format: editTask/edt
Details: editTask INDEX [n/TaskName] [d/Description] [s/startDateTime] [f/finishDateTime] [t/TAG]…​

  • Edits the task at the specified INDEX. The index refers to the index number shown in the last task listing. The index must be a positive integer 1, 2, 3, …​

  • At least one of the optional fields must be provided.

  • Existing values will be updated to the input values.

Examples:

  • editTask 1 n/picnic d/have fun at Botanic Garden s/1/1/2017 12:00pm f/1/1/2017 15:00pm t/friends Edits the name, description, start time, finish time ad tag of the 1st task to be picnic, have fun at Botanic Garden, 1/1/2017 12:00pm, 1/1/2017 15:00pm and friends respectively.

  • editTask 2 t/teammates Edits the tag of the 2nd task to be teammates only and others remain same.

Exporting a task to a string of addTask command: exportTask

Export the details of the task by the index number
Format: exportTask/ept
Details: exportTask INDEX

  • Exports the task at the specified INDEX, selects the task.

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

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

Examples:

  • export 1 in the default setting
    Returns `addTask n/picnic d/have fun at Botanic Garden s/1/1/2099 12:00pm e/1/1/2099 15:00pm t/friends `

Deleting a task : deleteTask

Deletes the specific task from the task book.
Format: deleteTask/dt
Details: deleteTask IDNEX

  • Deletes the task at the specified INDEX.

  • 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

  • deleteTask 1
    Deletes the 1st task in the task book.

Marking a task : markTask

Marks the specific task from the task book.
Format: markTask/mt
Details: markTask INDEX

  • Marks the task at the specified INDEX.

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

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

Examples:

  • listTask

  • markTask 1
    Marks the 1st task in the task book to be completed and the marked task will disappear in the result list.

Setting a priority for a task : setPriority

Sets the priority field of a task that is already present in ths taskBook with an integer value between 1 to 5.
Format: setPriority/stp
Details: setPriority INDEX c/new value specified

  • Sets the priority value of the current task with the specific INDEX provided.

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

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

  • The new value of the task’s priority should still be between 1 to 5 (inclusive).

Examples:

  • setPriority 1 c/1
    Sets the priority of this task to be Super Important.

  • setPriority 1 c/6
    A warning message is shown: A priority value is defined within integer range of 1 to 5.

Sorting tasks by their priority : taskByPriority

Sorts the task currently present in the taskBook by priority.
Format: taskByPriority/tbp

Sorting tasks by end date : taskbyend

Sorts the list of tasks by their end date
Format: taskByEnd/tbe

This sorting will not affect the order of the tasks currently in the storage. However, the current index shown will be the index used for a specific task to edit, delete, setPriority, mark…​

Linking a task with provided people
Format: link/lk
Details: link Index p/personIndex [p/personIndex]

Examples:

  • link 1 p/1
    link task 1 with person 1 in the current displayed list

  • link 1 p/1 p/2
    link task 1 with person 1 and person 2 in the current displayed list

linked tasks of person: linkedTasks

Showing Linked tasks of provided person
Format: linkedTasks/lts
Details: `linkedTasks Index `

Examples:

  • linkedTasks 1
    show linked tasks of person 1 in the current displayed list

linked tasks of person: linkedPersons

Showing Linked persons of provided task
Format: linkedPersons/lps
Details: `linkedPersons Index `

Examples:

  • linkedPersons 1
    show linked persons of task 1 in the current displayed list

Coming in v2.0

FAQ

Q: How do I transfer my data to another Computer?
A: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Address Book folder.

Command Summary

  • Add add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​
    e.g. add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague

  • Add Task add n/NAME d/Description s/START TIME f/END TIME [t/TAG]…​
    e.g. addTask n/picnic d/have fun at Botanic Garden s/1/1/2099 12:00pm f/1/1/2099 15:00pm t/friends

  • Clear : clear

  • Delete : delete INDEX
    e.g. delete 3

  • Delete Task : deleteTask INDEX
    e.g. deleteTask 3

  • Edit : edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…​
    e.g. edit 2 n/James Lee e/jameslee@example.com

  • Edit Task : editTask INDEX [n/NAME] [d/DESCRIPTION] [s/START_DATE_TIME] [f/END_DATE_TIME] [c/INTEGER[1~5] [t/TAG]…​
    e.g. editTask 1 n/picnic d/have fun at Botanic Garden s/1/1/2017 12:00pm f/1/1/2017 15:00pm t/friends

  • Export : export INDEX
    e.g. export 3

  • Export Task : exportTask INDEX
    e.g. exportTask 3

  • Find : find KEYWORD [MORE_KEYWORDS]
    e.g. find James Jake

  • Help : help

  • History : history

  • Link : link TaskIndex p/personIndex [p/personIndex]…​ `
    e.g. `link 1 p/2

  • List Contact : list

  • List Task : listTask

  • Mark Task : markTask INDEX
    e.g. markTask 1

  • Redo : redo

  • Remark : remark INDEX r/[REMARK]
    e.g. remark 1 r/Likes to swim.

  • Select : select INDEX
    e.g.select 2

  • Select Task : selectTask INDEX
    e.g.selectTask 2

  • Set Priority : setPriority INDEX c/PRIORITY INDEX
    e.g.setPriority 1 c/2

  • Task By End : taskByEnd

  • Task By Priority : taskByPriority

  • Undo : undo ==== Clearing all tasks : clearTask

Clears all entries from the task book.
Format: clearTask/ct ==== Selecting a task : selectTask

Selects the task identified by the index number used in the last task listing.
Format: selectTask/st
Details: selectTask INDEX

  • Selects the task and display the task at the specified INDEX.

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

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

Examples:

  • select 2
    Selects the 2nd task in the task book.

Deleting a task : deleteTask

Deletes the specific task from the task book.
Format: deleteTask/dt
Details: deleteTask IDNEX

  • Deletes the task at the specified INDEX.

  • 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

  • deleteTask 1
    Deletes the 1st task in the task book.

End of Extract


Justification

  1. In this application, 3W, we have task book as a separate entity besides address book so that they will not affect each other. The task book will thus be able to directly built besides the original address book without the need to modify the modelling and storage logic of the address book.

  2. Because of time constraints, the current design of the DateTime of the tasks have rigid input format. They are powerful in checking constraints such as the start date time must be earlier than end date time, and the validity of the start and end dates and time. Currently, we focus on the validity and security. In the future, this implementation will be extended with powerful natrual language processing unit to ensure the flexibility of input as well.

  3. Following the addressbook functionality, the edit task function will also be able to accept various fields (at least one filed must be present). However, the priority of the task will be updated or modified through setPriority command. This modelling will ensure the user make frequent changes to the task priority easily. The task priority currently has 5 degrees with 1 being the most important. We think 5 degrees is the most suitable one for satisfying different business people’s needs.

Implementation


Start of Extract [from: Developer Guide]

TaskBook

We develop this application as a parallel of two similar application, namely addressBook and taskBook. They are similar in many ways, including comman commands like add for adding a person and addTask for adding a task.

Adding a taskBook to our application originated from our design requirements.

  • The taskBook is a set of parallel functionalities apart from the addressBook.

  • The taskBook is related to addressbook in the sense that we can link the person and task together.

  • The taskBook and addressBook has the following independent components: model, logic, and storage.

  • The taskBook and addressBook share the same user interface by taking up taskPanel and personPanel respectively.

With the extra taskBook working in parallel, the model interface should be modified in this way:

ReadOnlyTaskBook getTaskBook();

void addTask(ReadOnlyTask task) throws DuplicateTaskException;

void updateFilteredTaskList(Predicate<ReadOnlyTask> predicate);

With the updated model interface, the ModelManager and ModelStub should be modified accordingly.

For storage, we save the tasks into another storage file (xml file), the storage interface should be equipped with the following read and write methods:

Optional<ReadOnlyTaskBook> readTaskBook() throws DataConversionException, IOException;

@Override
void saveTaskBook(ReadOnlyTaskBook addressBook) throws IOException;

@Override
Optional<ReadOnlyAddressBook> readAddressBook() throws DataConversionException, IOException;

@Override
void saveAddressBook(ReadOnlyAddressBook addressBook) throws IOException;

void handleAddressBookChangedEvent(AddressBookChangedEvent abce);

void handleTaskBookChangedEvent(TaskBookChangedEvent tbce);

As given in storage and model, the main logic should be implemented this way to take both addressbook and the taskbook’s storage during initialization.

UserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(config.getUserPrefsFilePath());
userPrefs = initPrefs(userPrefsStorage);
AddressBookStorage addressBookStorage = new XmlAddressBookStorage(userPrefs.getAddressBookFilePath());
TaskBookStorage taskBookStorage = new XmlTaskBookStorage(userPrefs.getTaskBookFilePath());
storage = new StorageManager(addressBookStorage, userPrefsStorage, taskBookStorage);

The unit tests stub classes and setUp methods should be updated accordingly. In addition, in order to make task’s operations undoable and redoable, the taskbook states should be saved before each command’s execution.

Design Considerations

Aspect: Implementation of taskBookStorage
Alternative 1 (current choice): Create a new xml file and several xml adapted classes for task Book storage
Pros: We will not create any dependencies between taskBook and addressBook.
Cons: A lot of code seems very similar and more storage file become hrad to manage.
Alternative 2: Save the new task to the same storage xml file as addressBook
Pros: This method of implementation saves the space and it can reuse some of the codes in addressBook.
Cons: It creates dependency between the storage for both books and it is inefficient to retrieve only one of them from storage xml file.+


Aspect Implementation of modelling and logic of taskBook
Alternative 1 (current choice): Rewrite codes for taskBook, keep the original addressbook codes untouched.
Pros: The original addressBook logic and modelling will not be affected. We keep an independent book from the original.
Cons: The code reusage is very low and adding a taskBook become very tedious.
Alternative 2: Modify the original code base to reutiliza some of the common functionalities.
Pros: The code reusage is good and adding a taskBook becomes more efficient.
Cons: The dependency is very high between addressBook and taskBook, there is a high tendency to break original logic and modelling.

ModelClassDiagram

Figure 2.4.1 : Structure of the Model Component

StorageClassDiagram

Figure 2.5.1 : Structure of the Storage Component

UiClassDiagram

Figure 2.2.1 : Structure of the UI Component

Use case: Delete person

MSS

  1. User requests to list persons

  2. AddressBook shows a list of persons

  3. User requests to delete a specific person in the list

  4. AddressBook deletes the person

    Use case ends.

Extensions

  • 2a. The list is empty.

    Use case ends.

  • 3a. The given index is invalid.

    • 3a1. AddressBook shows an error message.

      Use case resumes at step 2.

Use case: list tasks by date

MSS

  1. User requests to list tasks by date

  2. AddressBook shows a list of tasks by date

  3. User requests to see the tasks by date order

  4. AddressBook shows the tasks by date

    Use case ends.

Extensions

  • 2a. The task list is invalid.

    • 2a1. AddressBook shows an error message.

    • 2a2. AddressBook is empty.

      Use case resumes at step 2.

Use case: list tasks by priority order

MSS

  1. User requests to list tasks by priority

  2. AddressBook shows a list of tasks by priority

  3. User requests to see the tasks by priority order

  4. AddressBook shows the tasks by priority

    Use case ends.

Extensions

  • 2a. The task list is invalid.

    • 2a1. AddressBook shows an error message.

    • 2a2. AddressBook is empty.

      Use case resumes at step 2.

Use case ends.

Use case: list tasks by tag

MSS

  1. User requests to list tasks by tag

  2. AddressBook shows a list of tasks by tag

  3. User requests to see the tasks by tag

  4. AddressBook shows the tasks by tag

    Use case ends.

Extensions

  • 2a. The task list is invalid.

    • 2a1. AddressBook shows an error message.

    • 2a2. AddressBook is empty.

      Use case resumes at step 2.

Use case ends.

Use case: Add a new task

MSS

  1. User requests to add a task

  2. AddressBook prompts to ask for task details

  3. User inputs task details

  4. AddressBook adds the task

    Use case ends.

Extensions

  • 2a. The details is invalid.

    • 2a1. AddressBook shows an error message.

      Use case resumes at step 2.

Use case: Edit hierarchy

MSS

  1. User requests to edit hierarchy

  2. AddressBook prompts to ask for hierarchy details

  3. User inputs hierarchy details

  4. AddressBook update hierarchy

    Use case ends.

Extensions

  • 2a. The details is invalid.

    • 2a1. AddressBook shows an error message.

      Use case resumes at step 2.

Use case: View task details

MSS

  1. User requests to list tasks

  2. AddressBook shows a list of persons

  3. User requests to see a specific task details

  4. AddressBook shows the details of a person

    Use case ends.

Extensions

  • 2a. The list is empty.

    Use case ends.

  • 3a. The given index is invalid.

    • 3a1. AddressBook shows an error message.

      Use case resumes at step 2.

      Use case: View task details

MSS

  1. User requests to list tasks

  2. AddressBook shows a list of persons

  3. User requests to see a specific task details

  4. AddressBook shows the details of a person

    Use case ends.

Extensions

  • 2a. The list is empty.

    Use case ends.

  • 3a. The given index is invalid.

    • 3a1. AddressBook shows an error message.

      Use case resumes at step 2.

Use case: View task details

MSS

  1. User requests to list tasks

  2. AddressBook shows a list of persons

  3. User requests to see a specific task details

  4. AddressBook shows the details of a person

    Use case ends.

Extensions

  • 2a. The list is empty.

    Use case ends.

  • 3a. The given index is invalid.

    • 3a1. AddressBook shows an error message.

      Use case resumes at step 2.

Use case: Invalid actions

MSS

  1. User requests an invalid action

  2. AddressBook shows a error message

  3. AddressBook shows suggestions on fixings of this error or warning occurred

    Use case ends.

Extensions

  • 2a. The error message is hard to understand

    • 2a1. The user can choose to exit/restart the program

    • 2a2. The user can choose to redo this action

      Use case ends.

  • 3a. The given suggestion is not a good fix

    • 3a1. AddressBook opt to redo this action

      Use case ends.

{More to be added}

Appendix A: Non Functional Requirements

  1. Should work on any mainstream OS as long as it has Java 1.8.0_60 or higher installed.

  2. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage.

  3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.

  4. Should be able to respond and update within 2s per actions

  5. Should give reasonable error messages and warnings

  6. Should try to give suggestions with valid reasons and logic

  7. Should have not very steep learning curve for a regular English-speaking person

  8. Should have detailed tutorials and documentation

{More to be added}

Invalid-action

An action that will trigger warnings and error messages
Eg.: Dangerous events, delete and clashing events

Priority

The importance of a task in the taskBook. Integer values of 1 to 5 are used to represent the priority.

The correspondence between interger value and the priority of the tasks is as follows: 1 (super important), 2 (important), 3 (normal), 4 (trivial), and 5 (super trivial).

Appendix B: Product Survey

Trello

Author: Dong Shaocong

Pros:

  • Beautiful interfaces.

  • Notes which are easy to be removed, added, edited and moved.

  • Attachments and update history for an event.

  • Sync with different device for same account.

  • Power ups to choose including github and Slack.

Cons:

  • It’s not a command line software, and therefore not very friendly for developers and command line lovers

  • Unable to work offline and often clash with not so stable Internet connections

End of Extract


Enhancement Proposed:

  1. Add task Book (in parallel with address book)

  2. Task book basic Functionalities

  3. DateTime of Task better checking logic


Other contributions

  1. Generate JAR file for weekly milestones.

  2. Prepare sample data and manual test script.[commit]

  3. Update task model for UI integration[commit]

  4. Design the fxml and css file for TaskBook panel and task card for our UI.

  5. Make link response message more friendly[pull request]

  6. Debug for markTask[pull request]

  7. Update developer guide diagrams[pull request]

  8. Make the taskBook commands undoable and redoable.[commit]

  9. Apply Dependency Inversion Principle For Task Model[commit]

  10. Apply Defensive Programming[commit]

  11. Apply Abstraction design pattern[commit]