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

[CS2113-T14-3] termiNus #43

Open
wants to merge 839 commits into
base: master
Choose a base branch
from

Conversation

GuoAi
Copy link

@GuoAi GuoAi commented Oct 1, 2020

A software for NUS University undergraduate students.

yeapcl added a commit to yeapcl/tp that referenced this pull request Oct 13, 2020
Copy link

@LIU-YiFeng-1 LIU-YiFeng-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! easy to read and understand!

Comment on lines 8 to 17
Below is an architecture diagram of termiNus.

![ArchitectureDiagram](./images/ArchitectureDiagram.png)

- `Duke` is the main object of the program and handles all the logic and models related to the program.
- `Ui` is the main object that provides an interface between `Duke` and the user.
- `Command` represents a command that is provided by the user. `Ui` reads the command and it is sent to `Parser` to create a new `Command` object.
- `Duke` executes the command and shows the output to the user using `Ui`.
- `Command` object modifies the state of `ItemList`, which consists of multiple lists for different types of `Items`.
- `Storage` takes the state of `ItemList` and stores it to file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, I like how the architecture diagram is used here. Easy to understand

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a good idea to have this diagram first but it may be a bit confusing to those looking at it for the first time. Maybe adding some colour to help differentiate the different parts would be good? I also noticed that you did not describe all the items in the diagram in the explanation, if these are the main components of your architecture then maybe you can narrow it down to this as well?

Comment on lines +65 to +68
The following sequence diagram shows how the `Parser` works.

![DukeSequenceDiagram](./images/ParserSequenceDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It seems that the sequence diagram is not being terminated, is it how it supposed to be? Correct me if I am wrong

Comment on lines 87 to 92
Two of the previously mentioned methods, `removeArgumentsFromCommand` and `getArgumentsFromRegex` make use of regular
expressions to parse the optional arguments.

- The regular expression that parses these optional arguments is `([\w]+/[^\s]+)`. This regular expression matches 1 or more
alphanumeric characters (denoted by `[\w]+`), followed by a forward slash, then 1 or more of any character except whitespace (denoted by `[^\s]+`).
- The expression also uses capturing parenthesis to ensure that the parser does not parse the same argument twice.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to provide an example in the form of a picture? It is quite confusing to a first-time reader, given that there are so many different symbols.

Comment on lines 112 to 116
Methods handling data loading (i.e. `loadTask()`, `loadBook()`, `loadLinks()`, `loadCredit()`, `loadModule()` methods)
return an `ArrayList` of `Item`s (i.e. `Task`, `Book`, `Link`, `Credit`, `Module`). These will be the initial values of
the `ItemList`. The `save()` method takes an `ItemList` and a `String` specifying the path to which the file will be
saved. The `ItemList` will be parsed and saved into files (each `ItemList` will be saved to a separate file) at the
specified path.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps a class diagram to aid the explanation?

Comment on lines 122 to 132
There are 6 fields stored for each `Task`:
1. String `T` for "Task"
2. Whether the `Task` has been done or not (1 for done, 0 for not done)
3. Description of the `Task`
4. Priority of the `Task` (an Integer)
5. Category of the `Task`
6. Date of the `Task`

All the fields are separated by ` | ` with a leading and a trailing space. Each `Task` is stored as one line.

Example: `T | 0 | borrow book | 1 | book | 28-10-2020`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! I like how this format is used consistently to explain the store files.

Comment on lines 195 to 211
|Version|Priority| As a ... | I want to ... | So that I can ...|
|--------|----------|----------|---------------|------------------|
|v1.0|***|student|add tasks into a list|keep track of the things I need to do|
|v1.0|***|student|assign priorities to tasks|focus on the more important things first|
|v1.0|**|student|assign categories to tasks|have a more organised task list|
|v1.0|***|student|mark tasks as done|keep track of the remaining tasks to do|
|v1.0|**|student|list all tasks in my list|have a better overview|
|v1.0|***|student|be able to delete unwanted tasks|focus on the tasks which I need|
|v1.0|***|student|save all data after using the application|retrieve the data upon running the application
|v2.0|**|student|automatically create folders for my modules|I do not have to manually create them|
|v2.0|***|student|add recurring tasks|avoid adding the same tasks every week
|v2.0|***|student|have a calendar|I can view my current and upcoming tasks
|v2.0|***|student|be able to set a tracker my borrowed books|avoid overdue fines
|v2.0|**|student|sort my tasks based on highest priority|focus on those tasks first
|v2.0|***|student|save zoom links in a centralized place|easily attend my online classes instead of looking through my email for the link
|v2.0|***|student|add modules and calculate my CAP|have a better projection of my grades and efforts
|v2.0|*|student|login with a password|my system is protected

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the Priority could be explained in terms of HIGH MEDIUM or LOW? Without the legend to explain the number of *, could be confusing

Copy link

@TomLBZ TomLBZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments


The following sequence diagram shows how the `Storage` works.

![StorageSequenceDiagram](./images/StorageSequenceDiagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean save() can only be executed once throughout the program? Correct me if I'm wrong.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

I think when an object is destroyed the dotted line should not continue anymore.

##### Sequence Diagram
Below is a sequence diagram of how the main program functions.

![DukeSequenceDiagram](./images/DukeSequenceDiagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diagram is inconsistent with the next diagram about storage:
image
This diagram shows that save() is executed repeatedly but Storage is a singleton in this process.
image
However, this diagram shows Storage object being distroyed after one call to save().
Is one of the diagrams wrong?

##### Sequence Diagram
Below is a sequence diagram of how the main program functions.

![DukeSequenceDiagram](./images/DukeSequenceDiagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ItemList supposed to keep existing when Duke is destroyed?
image


The following sequence diagram shows how the `Parser` works.

![DukeSequenceDiagram](./images/ParserSequenceDiagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the command be destroyed here?
image

Comment on lines 24 to 33
- First, the `main` function of the `Duke` class creates an instance of `Duke`.
- During the instantiation of `Duke`, a `Storage` object is created.
- `Duke` creates and loads the state of `ItemList` from file by calling a function from `Storage`.
- After `Duke` is initialized, the `Duke` class calls the `run()` method of `Duke`.
- `Duke` calls methods from `Ui` class and shows messages to the user.
- `Duke` reads commands from the user using the `Ui` class (which acts as an interface between `Duke` and the user).
- `Command` object is returned to `Duke` which is executed.
- `Command` object interacts with `ItemList` and changes its state.
- `Storage` saves the state of `ItemList` to file.
- `Duke` continues reading commands until a `ByeCommand` is generated by the user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good explanation but if this is a step by step process, maybe you can use a numbered list instead?

@kerct
Copy link

kerct commented Oct 30, 2020

image

Should this section be filled up too?

@kerct
Copy link

kerct commented Oct 30, 2020

image

Would it be better to explain the optional arguments here too? For example, what does the p in p/0 mean?

@kerct
Copy link

kerct commented Oct 30, 2020

image

Should this section be filled up too?

image
Same for the Command component!

@kerct
Copy link

kerct commented Oct 30, 2020

image
Perhaps it would be neater if the examples are formatted in a list rather than listing it out in one line?
For example, the methods handling data loading are:

  • loadTask()
  • loadBook()
  • loadLinks(), etc.

Copy link
Member

@kstonekuan kstonekuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading in the right direction with the sequence diagrams and detailed explanations but the organisation of the sections is a bit off and need more class diagrams help with understanding the classes.


#### High level description

The `Parser.parse()` method takes in `fullCommand` as an argument, which is the full command entered by the user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is a good explanation I think it would be good to have a class diagram here as well to show the relationship

Comment on lines +55 to +56
An optional argument consists of 2 parts, which is delimited by a forward slash. In the example above, there are 3 optional
arguments, which are `mc/4`, `ay/2021S1` and `g/A`. Each optional argument can be represented in this form: `<key>/<value>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good explanation and makes it clear, especially <key>/<value>. Maybe it would be worth it to explicitly list out the keys as being mc, ay and g and what they each mean even if it can be inferred.


The following sequence diagram shows how the `Storage` works.

![StorageSequenceDiagram](./images/StorageSequenceDiagram.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

I think when an object is destroyed the dotted line should not continue anymore.

|v2.0|***|student|add modules and calculate my CAP|have a better projection of my grades and efforts
|v2.0|*|student|login with a password|my system is protected

## Implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it is a bit confusing that there is another 'Implementation' section here when there were many implementations described in the section above under 'Design & Implementation', maybe this should be moved to there as well? I believe this would go under the Command component.

@kerct
Copy link

kerct commented Oct 30, 2020

image
I feel that putting each file (tasks.txt, books.txt, links.txt and modules.txt) as a subsection rather than a bulleted list would be more appropriate here!

Copy link

@kerct kerct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the developer guide is very detailed. It might be helpful to include a contents overview at the start with links to the relevant sections too.

@kerct
Copy link

kerct commented Oct 30, 2020

image
Just a small grammar issue here - it should be "forget" and "want", not "forgets" and "wants".

@@ -1,25 +1,283 @@
# Developer Guide

## Design & implementation
<!-- @@author iamchenjiajun -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You guys may consider add a content table with hyperlink and an introduction for your product and this document (developer guide), so that the readers can have a rough idea of your whole project and can choose to look into detail in specific sessions, instead of being thrown with architecture content/diagram right at the beginning.

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.

10 participants