This site is from a past semester! The current version is here.
CS2113/T Aug '19
  • Week 1 [Aug 12]
  • Week 2 [Aug 19]
  • Week 3 [Aug 26]
  • Week 4 [Sep 2]
  • Week 5 [Sep 9]
  • Week 6 [Sep 16]
  • Week 7 [Sep 30]
  • Week 8 [Oct 7]
  • Week 9 [Oct 14]
  • Week 10 [Oct 21]
  • Week 11 [Oct 28]
  • Week 12 [Nov 4]
  • Week 13 [Nov 11]
  • Textbook
  • Admin Info
  • Report Bugs
  • Slack
  • Forum
  • Project Info
  • Instructors
  • Announcements
  • File Submissions
  • Tutorial Schedule
  • Duke
  • Project Phase1 Dashboard
  • Java Coding Standard
  • samplerepo-things
  • Projects List
  • config.json templates for Reposense
  • PersonalAssistant-Duke
  • Project Phase2 Dashboard
  • Reference project - Addressbook
  • Repl.it classroom
  • Previous WeekNext Week

    Week 4 [Sep 2]

    Project Milestone: mid-v1.0

    Move towards completing individual contributions to Phase 1 of the project.

    Implement the following increments while committing code incrementally

    Implement the following increments as per the instructions below.

    • Implement Level-6 in a branch named branch-Level-6.

    • Without merging that branch, go back to the master branch and implement Level-9 in a separate branch named branch-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 includes A-Collections
    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.
        ____________________________________________________________
    

    When implementing this feature, you are also recommended to implement the following extension:

    A-Collections

         Use Java Collections classes

    Use Java Collections classes for storing data. For example, you can use an ArrayList<Task> to store the tasks.

    A-Collections: Use Java Collection classes

    A-Collections

         Use Java Collections classes

    Use Java Collections classes for storing data. For example, you can use an ArrayList<Task> to store the tasks.

    • Do some automated testing of the Duke UI
    A-TextUiTesting: Text UI Testing

    A-TextUiTesting

         Test using the I/O redirection technique

    Use the input/output redirection technique to semi-automate testing of Duke.

    A tutorial is provided in the duke repository.

    • 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

    A-MoreOOP

         Make the code more OOP

    Refactor the code to extract out closely related code as classes.

    • Minimal: Extract the following classes:
      • Ui: deals with interactions with the user
      • Storage: deals with loading tasks from the file and saving tasks in the file
      • Parser: deals with making sense of the user command
      • TaskList: 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 abstract Command 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.
    Level-10: GUI optional

    Level 10. GUI

    Add a GUI to Duke.

    When implementing this feature, you are also recommended to implement the following extension:

    A-JavaFx

         use JavaFX

    Use JavaFX to create a GUI. Refer to the JavaFX tutorials at the Duke repo (i.e., the repo you forked from) to learn how to get started.

    A-JavaFx: JavaFx optional

    A-JavaFx

         use JavaFX

    Use JavaFX to create a GUI. Refer to the JavaFX tutorials at the Duke repo (i.e., the repo you forked from) to learn how to get started.