-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Nam Minh Quan] iP #41
base: master
Are you sure you want to change the base?
Conversation
Modify Duke.main() to perform taskList functions
Refactor TaskList to work with Task objects Complete Level 3
Add Input and expected text files for testing Level 4
Add Exception handlers Add DukeHandler to handle responses and prevent public access to list of tasks
Fix handle logic bug Level 6 done
The TaskStorage class handles loading and modifying the text file that saves all tasks Let's create this class
Date and time is stored as String in Task subclasses Let's make a class that converts string input for Times to LocalDateTime objects to be stored in task objects
# Conflicts: # src/main/java/Deadline.java # src/main/java/DukeHandler.java # src/main/java/Event.java
Duke is using a DukeHandler to parse user input, user interaction is being handled in multiple classes Let's pull up behaviors common to user interaction and create a new Ui class This helps OOP to be clearer in this project
DukeDate class modified for ease of reading
A-packages increment completed
Duke does not have test cases to verify its functions Let's make some jUnit tests to make sure that the functions work
Duke does not have function to search for specific tasks Let's add a findTask() method to allow this
# Conflicts: # src/main/java/Duke/DukeHandler.java # src/main/java/Duke/task/TaskList.java
# Conflicts: # src/main/java/Deadline.java # src/main/java/Duke.java # src/main/java/Event.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job overall!!! Just some minor nits to fix!
README.md
Outdated
@@ -1,4 +1,4 @@ | |||
# Duke project template | |||
# Duke.Duke project template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very minor nitpick, Duke got refactored to Duke.Duke which does not make sense here.
src/main/java/Duke/Duke.java
Outdated
import Duke.task.TaskList; | ||
import Duke.task.TaskStorage; | ||
import Duke.util.Ui; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see a line separating task and util packages even further.
src/main/java/Duke/task/Task.java
Outdated
* Represents the object that the chat-bot manages | ||
* and users can interact with. | ||
*/ | ||
public abstract class Task { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how you defined Task as an abstract class 👍
import java.util.ArrayList; | ||
import java.util.Scanner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to see a separation between util & io packages here again
src/test/java/TaskListTest.java
Outdated
import Duke.DukeHandler; | ||
import Duke.task.Task; | ||
import Duke.task.TaskList; | ||
import Duke.task.Todo; | ||
import org.junit.jupiter.api.Test; | ||
import Duke.DukeException; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.fail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statements could be arranged better, i.e the junit ones, then java ones then duke ones etc.
src/main/java/Duke/util/Echo.java
Outdated
package Duke.util; | ||
|
||
import java.util.Scanner; | ||
|
||
public class Echo { | ||
|
||
public Echo() { | ||
} | ||
public void echoInput(String input) { | ||
Scanner userInput = new Scanner(System.in); | ||
while (!input.equals("bye")) { | ||
System.out.println(input); | ||
input = userInput.nextLine(); | ||
} | ||
System.out.println("Bye. Hope to see you again soon"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless I am missing something, what is the point of the echo class?
Duke uses Text-based interface to communicate with users Creating GUI using JavaFX allows a better user experience Let's refactor Duke to return replies in String, and use JavaFX to display them to users
Duke Manager class does not have an assertion Let's add an assertion to notify if the response from Duke is empty
Duke Manager class does not have an assertion Let's add an assertion to notify if the response from Duke is empty
Duke uses a DukeHandler to process input and return the output Let's extract the parser and command processor to achieve further OOP
Duke uses too long methods Let's extract out some common methods to increase readability
Improve code quality
# Conflicts: # src/main/java/Duke/DukeHandler.java # src/main/java/duke/DukeManager.java
Branch a assertions
Duke does not have a help command to show users what they can do with the program Let's add a help command and let users know that they can use it to see all the commands and their formats
Add Help extension
Duke exits before showing the bye output By informing the user that the program is exiting, we can reassure them that it was not a crash Let's add a timetask function so that the program can display a goodbye message before exiting
Duke runs does not return anything if IndexOutofBound Exception occurred due to the user's input mark, unmark, delete's index is larger than the task list size Let's add TaskNotFound Exception to handle this exception and show the user that an error has come up because of their input
Duke's font size is small and hard to read. The profile photos are square Let's increase the size of the font and crop the profile images so users will have a more enjoyable experience using Duke
Duke does not handle exception when user inputs the incorrect date format Let's add DukeDateException to handle this error
#Duke Chat-bot
##This chat-bot helps you organize your to-do list. It's
##All you need to do is:
And it is completely FREE!
Features:
If you are a Java programmer, you can use it to practice Java too. Here's the
main
method: