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-T10-3] MangaTantou #9

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

Conversation

xenthm
Copy link

@xenthm xenthm commented Sep 19, 2024

MangaTantou serves to manage the tasks under which editors in a manga company have to handle. This includes having to chase authors for deadlines, track sales revenue, manage authors’ salaries etc.

import static constants.Regex.PRICE_OPTION_REGEX;
import static constants.Regex.QUANTITY_OPTION_REGEX;
import static constants.Regex.SPACE_REGEX;

Choose a reason for hiding this comment

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

Consider using enums instead of static constants like CATALOG_COMMAND to improve maintainability.

* which should specify an Add operation for either Manga or Author
* @return a Command object representing the Add operation for Manga or Author
* @throws TantouException if the user input is invalid for both Manga and Author Add commands
*/

Choose a reason for hiding this comment

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

consider extracting code (within each block) to individual methods if possible

return new AddSalesCommand(salesArguments);
}
throw new TantouException("Invalid sales command provided!"
+ " You need to provide the author, manga, quantity sold, and unit price.");

Choose a reason for hiding this comment

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

Consider splitting the class as it has many functionality and can be separated into 2 different ones.

throw new JsonParseException("corrupt Manga object");
}
JsonObject mangaJsonObject = json.getAsJsonObject();

Choose a reason for hiding this comment

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

Instead of generic messages like "corrupt manga name", provide more informative ones that specify which field was invalid.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback! The part you are referencing checks if the Manga entry in the data file is a JsonObject (whichs means it shouldn't be formatted as an array or anything else. I provided more informative messages if the mangaName or deadline contains issues in the following lines of code.

saveFile(authorList);
return;
}
assert !existingAuthor.hasManga(deletingManga): "No manga found";

Choose a reason for hiding this comment

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

The assertion check for finding the existence of authorName after already validating it before could be removed since they are unnecessary

Copy link

@chewycj chewycj 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 diagrams are really clear and detailed!! 💯 Just some minor notations to change 😄 We found this from a past year forum that might be useful for formatting the diagrams: nus-cs2113-AY2324S2/forum#35

Copy link

Choose a reason for hiding this comment

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

The class diagram is really detailed and well-drawn! 🚀 However, there were some non-standard notation for the diagram mangasales_class.png to note, according to prof, I think can refer to how the team did the command.png for the standard format too! 👍

Class name:
image
Perhaps for normal classes, I think we don't need to coloured green C!
such as from the addressbook example:
image

Visibility:
image
The symbols for the visibility could be changed to '+' and '-' or '#' accordingly too!

Copy link
Author

Choose a reason for hiding this comment

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

Yes! This will be fixed once we include our standardised config file to the puml files.

Copy link

Choose a reason for hiding this comment

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

All of the team's sequence diagrams are well drawn and neat! 💯 One thing to note that prof has pointed out is that the boxes of the entities are rounded, as it should be a sharp corner instead!

For example, these are rounded:
image

Choose a reason for hiding this comment

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

Noted on this, thanks for catching it!

> **_NOTE:_** There is circular reference (bidirectional navigability) between `Author` and `Manga` through `MangaList`.

### Commands
![Command Inheritance](/docs/uml/puml/Command/Command.png)
Copy link

Choose a reason for hiding this comment

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

Perhaps the Command.png can be placed in the images folder! As currently it could not load in the DG 😿

image

Choose a reason for hiding this comment

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

Ah, careless mistake! Thanks for helping us point it out early!

Copy link

Choose a reason for hiding this comment

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

Perhaps the UML note can be connected by a dotted line instead!

image

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, will look into that!

Copy link

@jemehgoh jemehgoh 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 on your guide! The explanations are mostly relevant and the diagrams are mostly appropriate. I just have several nits, as mentioned in my other comments.

Comment on lines 49 to 50
inheriting from the abstract `Command` class. Ensure that each new command class includes
an implementation of the `execute` method and appropriately interacts with the `Ui` class

Choose a reason for hiding this comment

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

I think you should not repeat yourself here regarding implementing the "execute" method?

Choose a reason for hiding this comment

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

Thanks for the comment, I agree that the content is similar in nature regarding the execute method but in the Guidelines, I had phrased it and targetted my language to be instructional towards the developers while in Structure, it is more of a generic description. Nonetheless, I hear you and will look into making the text more targetted with reduced repetition. Thanks again!

For the AddSalesCommand to be successful, the manga that the sales data is associated with must exist. If the `sales`
command is successful, the `Sales` data is then saved via Storage.

![mangasales_class.png](uml/images/mangasales_class.png)

Choose a reason for hiding this comment

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

I think this class diagram is not relevant to this section and shouldn't be placed here?

Comment on lines +13 to +17
class ArrayList<T>
ArrayList <|-- AuthorList
note on link : ArrayList<Author>
ArrayList <|-- MangaList
note on link : ArrayList<Manga>

Choose a reason for hiding this comment

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

Screenshot 2024-10-30 132426
In this diagram, MangaList and AuthorList are indicated as inheriting from ArrayList, but with notes stating "ArrayList" and "ArrayList". I think that, unless these two classes inherit from ArrayList (in which I think you should remove the notes), I believe that there is no inheritance to indicate?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I'm not sure I understand you. They both inherit from ArrayList, but AuthorList extends ArrayList<Author>, while MangaList extends ArrayList<Manga>. I still do believe the notes are necessary for show that distinction.

Copy link
Author

Choose a reason for hiding this comment

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

Will be keeping this representation based on:

Your notation seems OK (* good!). Not sure what the comment means specifically.

From UML specification:
image

*we don't cover this in CS2113; so you went beyond to learn the notation for generics inheritance.
specifying the type in the UML note seems OK to me as a way to explain to the reader what it means.

Originally posted by Prof in nus-cs2113-AY2425S1/forum#41 (comment)

cmd -> ui : print list as table with the required columns
ref over ui, col : Print all required list and format rows
return
return done printing
Copy link

@jemehgoh jemehgoh Oct 30, 2024

Choose a reason for hiding this comment

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

image

I think you should remove the "done printing" label, as the dotted arrow is sufficient to indicate that control has gone back to Tantou?

group sd [Add required columns to list]
ml -> row ** : add new PrintColumn
row ++
return added to columns
Copy link

@jemehgoh jemehgoh Oct 30, 2024

Choose a reason for hiding this comment

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

image

I think you don't have to mention "added to columns" every time you return control, since you already mention "add new [column]" for each corresponding operation?

Copy link
Author

Choose a reason for hiding this comment

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

You're right. Perhaps I can make it clearer by appending "to columns" to each top arrow.


#### Storage Structure
![StorageClass.png](uml/puml/StorageClass/StorageClass.png)
The above UML class diagram outlines the structure of the classes related to saving data.

Choose a reason for hiding this comment

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

This line is not well formattted. I think it is meant to start on the next line

#### Interaction
The following diagram illustrates the interactions that take place when the
user provides `"catalog -a Kubo Tite"` as an input.
![add author sequence diagram](/docs/uml/images/AddAuthorSequence.png)

Choose a reason for hiding this comment

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

This is a broken link which is not visible.

For the AddSalesCommand to be successful, the manga that the sales data is associated with must exist. If the `sales`
command is successful, the `Sales` data is then saved via Storage.

![mangasales_class.png](uml/images/mangasales_class.png)

Choose a reason for hiding this comment

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

May I clarify what is the meaning of the circle and square icons? If I remember correctly it should be + or - or omitted

Copy link
Author

Choose a reason for hiding this comment

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

It is the default way for PlantUML to display the access modifier. But you are correct, we should be following the textbook for this course.


The following sequence diagram illustrates the interactions that occur when the parser creates a new `AddSalesCommand`.

![addsalesdata.png](uml/images/addsalesdata.png)

Choose a reason for hiding this comment

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

Is the sequence diagram format correct? Should it not have the instance at the bottom?
image

Copy link
Author

Choose a reason for hiding this comment

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

You are right, it should not be there. Thank you.

averageandyyy and others added 24 commits November 4, 2024 12:36
Updated schedule to work with the new parser
- Wrap long lines
- Fill in Product Scope section
- Fill in User Stories section
- Fill in Non-Functional Requirements section
- Add instructional placeholder text for Manual Testing section
averageandyyy and others added 30 commits November 11, 2024 23:32
- Fix "RegEx" typos
- Update table of contents
- Delete template PPP
- Add Ian's file
Cut lines and reformat.
Give instructions on how to run the jar file.
- Adding sales data with command did not show the numbers that were just
  added as a message. This was fixed in AddSalesCommand.java
- In SaleDeserializer.java, perform checks on the saleJsonObject before
  proceeding
Remove redundant spaces in code blocks in UG
The previous one did not work.
Try another horizontal line in DG
GitHub should look at the docs directory to find the updated README.md
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.

8 participants