Skip to content

[CS2113-T14-3] termiNus#43

Open
GuoAi wants to merge 839 commits into
nus-cs2113-AY2021S1:masterfrom
AY2021S1-CS2113-T14-3:master
Open

[CS2113-T14-3] termiNus#43
GuoAi wants to merge 839 commits into
nus-cs2113-AY2021S1:masterfrom
AY2021S1-CS2113-T14-3:master

Conversation

@GuoAi

@GuoAi GuoAi commented Oct 1, 2020

Copy link
Copy Markdown

A software for NUS University undergraduate students.

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

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

Copy link
Copy Markdown

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 thread docs/DeveloperGuide.md Outdated
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.

Copy link
Copy Markdown

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
Copy Markdown
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 thread docs/DeveloperGuide.md
Comment on lines +65 to +68
The following sequence diagram shows how the `Parser` works.

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

Copy link
Copy Markdown

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 thread docs/DeveloperGuide.md
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.

Copy link
Copy Markdown

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 thread docs/DeveloperGuide.md Outdated
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.

Copy link
Copy Markdown

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 thread docs/DeveloperGuide.md
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`

Copy link
Copy Markdown

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 thread docs/DeveloperGuide.md Outdated
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

Copy link
Copy Markdown

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

@TomLBZ TomLBZ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some comments

Comment thread docs/DeveloperGuide.md

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

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

Copy link
Copy Markdown

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
Copy Markdown
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.

Comment thread docs/DeveloperGuide.md
##### Sequence Diagram
Below is a sequence diagram of how the main program functions.

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

Copy link
Copy Markdown

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?

Comment thread docs/DeveloperGuide.md
##### Sequence Diagram
Below is a sequence diagram of how the main program functions.

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

Copy link
Copy Markdown

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

Comment thread docs/DeveloperGuide.md

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

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

Copy link
Copy Markdown

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 thread docs/DeveloperGuide.md Outdated
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
Copy Markdown
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

kerct commented Oct 30, 2020

Copy link
Copy Markdown

image

Should this section be filled up too?

@kerct

kerct commented Oct 30, 2020

Copy link
Copy Markdown

image

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

@kerct

kerct commented Oct 30, 2020

Copy link
Copy Markdown

image

Should this section be filled up too?

image
Same for the Command component!

@kerct

kerct commented Oct 30, 2020

Copy link
Copy Markdown

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.

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Member

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.

Comment thread docs/DeveloperGuide.md

#### High level description

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

Copy link
Copy Markdown
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 thread docs/DeveloperGuide.md
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
Copy Markdown
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.

Comment thread docs/DeveloperGuide.md

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

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

Copy link
Copy Markdown
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.

Comment thread docs/DeveloperGuide.md Outdated
|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
Copy Markdown
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

kerct commented Oct 30, 2020

Copy link
Copy Markdown

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!

@kerct kerct left a comment

Copy link
Copy Markdown

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

kerct commented Oct 30, 2020

Copy link
Copy Markdown

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

Comment thread docs/DeveloperGuide.md
# Developer Guide

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

Copy link
Copy Markdown

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