-
Notifications
You must be signed in to change notification settings - Fork 364
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
[ARPspoofing] iP #18
Open
ARPspoofing
wants to merge
148
commits into
nus-cs2103-AY2223S2:master
Choose a base branch
from
ARPspoofing:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[ARPspoofing] iP #18
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Duke reads a list of commands and checks if it is a valid user input. The commands are fixed and have the same common behaviour. The common behaviour can cause code duplication and untidiness once Duke gets more complex. Extracting the common behaviour into a Printable class allows abstraction. Let's store common behaviours into a Printable class so that the Duke will only need to call Printable. Printable will handle the output.
Duke stores the user inputs in an ArrayList. Duke class will be too cluttered and not abstracted if Tasks and Task classes are not created. Let's make the Tasks class as an immutable list with a generic type Task Using composition which is has-a relationship is preferable over inheritance
Task class has no mark or unmark functionality This causes the input mark or unmark to be stored instead of the desired outcome Implementing mark and undone as attributes for Task allows the user to mark and unmark a Task Let's implement attributes mark and unmark and show the status in the toString function
There are no tracker classes which means if a user keys in todos, deadline or events, it get recorded as an entry All three classes have common behaviours The common behaviours across the three classes can cause code duplication Extracting the common behaviour with a superclass as Task prevents code duplication Let's make Todos, Events and Deadline inherit from Task and override the toString method Using inheritance is preferable over composition in this situation because the common behaviours are not composable and the superclass Task is already implemented in previous iterations
The default runscript does not point to the correct file path. There is also a bug which stores multiple lines in one sentence as various keys. This causes the run script to fail and the bug causes more items in the list Modifying the class path and bin path in the run script will allow compilation and succesful running. No compilation error with regards to packages Let's make the class path to run the main function in Duke point to bin and the package has the remaining path
There is no exception handling which means the user will not understand why the input in invalid Extracting the exceptions into custom classes with a superclass IllegalArgumentException allows the user to better understand the reason for the invalid input Let's pull up DukeException and DukeUnknownException as classes with IllegalArgumentException as a superclass
Duke error terminates the whole program instead of displaying a message This does not achieve the desired outcome (the program needs to continuously run until the user types exit) The error is catched and a statement is being printed out instead Let's handle the error in a try-catch block in a function for encapsulation
The user will have an empty startup everytime after terminating the program The user's list can be stored into a text file Let's create a Save class and check if the user has the text file in a specific directory on all OS. If not, create the file and read / write into the file everytime the user startups and changes the list
There is a separate branch that allows the user to save input, read and write into the hardisk. Merge into master allows master to be the most updated. Let's merge branch-Level-7 into master with no fast-forward for an extra commit. Merge branch 'branch-Level-7'
Local date parser is present on branch-Level-8 but not in the master branch. Master branch needs to be the most updated. Let's merge branch-Level-8 into master with no fast forward for an extra commit. Merge branch 'branch-Level-8'
Functionalities of parsing user argument and dealing with user arguments is done by Duke class. Functionalities can be abstracted to other classes to satsify SOLID principles Let's create Ui, Parser, Storage and TaskList classes
Merge branch 'branch-Level-8'
No unit test case leads to difficulty to deduce the correctness of the classes Unit test cases ensure the return output are all intended Let's create JUnit test cases in test folder and build it with gradle to check if the unit test cases pass or fails
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Duke
A chatbot to store items from user
Developed in an iterative approach every week
Duke is executable with various levels. Replace the method name with the level name to see previous level iterations
Using Git RCS
Duke was built referring to CS2103/T page