Move towards completing individual contributions to Phase 1 of the project.
Implement the following increments while committing code incrementally
Implement the following
-
Implement
Level-6
in a branch namedbranch-Level-6
. -
Without merging that branch, go back to the master branch and implement
Level-9
in a separate branch namedbranch-Level-9
. -
Now, go back to the master branch and merge the two branches one after the other.
-
Tag the commit (in the master branch, after merging) that achieves the respective deliverable.
-
As before, push to your fork.
- Provide the capability to delete items from Duke's task list
- Remember
Level-6
includesA-Collections
- Remember
Level-6
: Delete
Level 6. Delete
Add support for deleting tasks from the list.
Example:
list
____________________________________________________________
Here are the tasks in your list:
1.[T][✓] read book
2.[D][✓] return book (by: June 6th)
3.[E][✗] project meeting (at: Aug 6th 2-4pm)
4.[T][✓] join sports club
5.[T][✗] borrow book
____________________________________________________________
delete 3
____________________________________________________________
Noted. I've removed this task:
[E][✗] project meeting (at: Aug 6th 2-4pm)
Now you have 4 tasks in the list.
____________________________________________________________
- Do some automated testing of the Duke UI
- Provide the capability to search for tasks that were recorded
Level-9
: Find
Level 9. Find
Give users a way to find a task by searching for a keyword.
Example:
find book
____________________________________________________________
Here are the matching tasks in your list:
1.[T][✓] read book
2.[D][✓] return book (by: June 6th)
____________________________________________________________
- Make your code more object-oriented
A-MoreOOP
: More OOP Refactor the code to extract out closely related code as classes.
- Minimal: Extract the following classes:
Ui
: deals with interactions with the userStorage
: deals with loading tasks from the file and saving tasks in the fileParser
: deals with making sense of the user commandTaskList
: contains the task list e.g., it has operations to add/delete tasks in the list
For example, the code of the main class could look like this:
public class Duke {
private Storage storage;
private TaskList tasks;
private Ui ui;
public Duke(String filePath) {
ui = new Ui();
storage = new Storage(filePath);
try {
tasks = new TaskList(storage.load());
} catch (DukeException e) {
ui.showLoadingError();
tasks = new TaskList();
}
}
public void run() {
//...
}
public static void main(String[] args) {
new Duke("data/tasks.txt").run();
}
}
- Stretch Goal: Consider extracting more classes. e.g.,
*Command
classes (i.e.,AddCommand
,DeleteCommand
,ExitCommand
etc.) that inherits from an abstractCommand
class, so that you can write the main logic of the App as follows:public void run() { ui.showWelcome(); boolean isExit = false; while (!isExit) { try { String fullCommand = ui.readCommand(); ui.showLine(); Command c = Parser.parse(fullCommand); c.execute(tasks, ui, storage); isExit = c.isExit(); } catch (DukeException e) { ui.showError(e.getMessage()); } finally { ui.showLine(); } } }
- [Optional] Some members in the team: develop a GUI for Duke.
- You will learn how to use JavaFX in
A-JavaFx
- If you plan to implement a GUI in your project Phase 2, it is recommended that at least one person in the team attempt this exercise successfully.
- You will learn how to use JavaFX in
Level-10
: GUI optional