Skip to content
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
wants to merge 148 commits into
base: master
Choose a base branch
from
Open

Conversation

ARPspoofing
Copy link

@ARPspoofing ARPspoofing commented Jan 19, 2023

Duke

A chatbot to store items from user

  • Lightweight project
  • Saves to hard disk
  • Reads from hard disk

Developed in an iterative approach every week

  1. In the first week, Duke was designed to store simple input from the user's machine only during the session
  2. In the second week, Duke was designed to store more complicated times and tasks
  3. In the third week, Duke was given a football fan personality 👟 ⚽
  4. Ronaldo SUI 🐐

Duke is executable with various levels. Replace the method name with the level name to see previous level iterations

public static void main(String[] args) {
        Duke duke = new Duke();
        duke.moreOop();
    }
  • Week 1
  • Week 2
  • Week 3
  • Week 4

Using Git RCS

git status 
git add 
git commit 

Duke was built referring to CS2103/T page

damithc and others added 30 commits July 31, 2022 17:20
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants