[CS2113-T11b-1] CookingAids#71
Conversation
| private static int currentId = 1; // Keeps track of the latest assigned ID | ||
|
|
||
| public static synchronized int generateNewDishId() { | ||
| return currentId++; // Increment and return the next ID |
There was a problem hiding this comment.
It would be nice to have comments for the reader rather than the coder to increase readability. Avoid adding comments which are for the coder's reference.
| removeExpiredIngredients(name); | ||
|
|
||
| // Reduce quantity starting from the earliest expiry date | ||
| for (Iterator<Ingredient> iterator = ingredientList.iterator(); iterator.hasNext() && amount > 0; ) { |
There was a problem hiding this comment.
It would be nice to use more intuitive variable names than "iterator" to increase code readability.
|
|
||
| // Reduce quantity starting from the earliest expiry date | ||
| for (Iterator<Ingredient> iterator = ingredientList.iterator(); iterator.hasNext() && amount > 0; ) { | ||
| Ingredient ing = iterator.next(); |
There was a problem hiding this comment.
Similarly for "ing" , better to use more intuitive variable name.
|
|
||
| ArrayList<String> ingredients = new ArrayList<>(); | ||
| if (!ingredientsString.isEmpty()) { | ||
| String[] ingredientArray = ingredientsString.split(","); |
There was a problem hiding this comment.
Try avoiding the usage of magic strings and magic literals
There was a problem hiding this comment.
Thanks for spotting this! Issue has been fixed in the latest commit
| } | ||
|
|
||
|
|
||
| public static void deleteDish(String receivedText) { |
There was a problem hiding this comment.
This is a very long method. try to keep method length to about 30 LOC.
There was a problem hiding this comment.
Long methods have been refactored in the latest commit
noradazaperez
left a comment
There was a problem hiding this comment.
- Shouldn't you be using standard UML notation? It seems that the red squares and green circles are not standard UML.
- Maybe the classes and methods are too detailed. Try being more simple. For example, instead of
static void initializeIngredientStorage(HashMap , List newIngredients), you could try
- initializeIngredienteStorage(String[], Ingredient[]): void
kaixiangg
left a comment
There was a problem hiding this comment.
Progress looks good to me so far, just a few nits to pick, keep it up! :)
|
|
||
| #### <ins>Implementation</ins> | ||
|
|
||
| * `Food` is an abstract class. |
There was a problem hiding this comment.
Nice job displaying the details of the classes here clearly, however would it be more concise and clear if it is integrated directly together with class diagrams?
| @@ -2,29 +2,144 @@ | |||
|
|
|||
| ## Acknowledgements | |||
There was a problem hiding this comment.
Can consider including sources used here such as different libraries used.
|
|
||
|
|
||
|  | ||
| ### UI |
There was a problem hiding this comment.
Can consider making each of the components of the application with a larger font for easier readability for developers who are collaborating
| | v2.1 | aspiring chef | save my favourite recipes | access them easily | | ||
| | v2.1 | user that is going to shop soon | be recommended recipes that are an item away | plan what to buy next when I'm not limited by my current ingredients | | ||
| ## Non-Functional Requirements | ||
|
|
There was a problem hiding this comment.
Can consider adding manual testing section when one downloads the jar file for more completeness
jwyk
left a comment
There was a problem hiding this comment.
Other than rendering problems and fore-mentioned comments, the DG looks clean and good 👍.
| | Version | As a ... | I can ... | So that I can ... | | ||
| |---------|----------|-----------|-------------------| | ||
| | v1.0 | Veteran cook | add new recipes to the list | enjoy my own recipes without relying on the default list | | ||
| | v1.0 | forgetful student | see my current quantity of ingredients | check if I have enough ingredients to make foods and whether I should buy more | | ||
| | v1.0 | indecisive user | change my meal plans | have flexibility in my meals | |
There was a problem hiding this comment.
Should align this to make the table work because the table isn't rendering properly
|
|
||
| The bulk of the app's work is done by the following components: | ||
| * `UI`: The UI of the App. | ||
| * `Command`:The command executor. |
|
|
||
| ### How the architecture components interact with each other | ||
| The _Sequence Diagram_ below shows how the components interact with each other for the scenario where the user issues | ||
| the command add -ingredient=tomato -quantity=5 -expiry=2025-04-03 |
There was a problem hiding this comment.
Might want to change the way how you displayed the PlantUML diagrams for public/protected/private parameters and methods to follow CS2113 convention.
There was a problem hiding this comment.
Consider increase the word font to increase readability
| } | ||
|
|
||
| ExpiryDate --|> DishDate | ||
| Ingredient --|> Food |
There was a problem hiding this comment.
Could potentially include the multiplicity between food and ingredients to increase the clarity
There was a problem hiding this comment.
could potentially show how these block of commands interact with other part of the system
There was a problem hiding this comment.
there is a lack of the diagram to show the data flow, ie after the data is being parsed, how is it being stored/ modified. Could consider to add that in
| * `AddDishCommand` adds a dish to the DishCalendar. | ||
| * `RemoveDishCommand` removes a dish from the DishCalendar. | ||
| * `AddRecipeCommand` adds a recipe to the RecipeBank. | ||
| * `RemoveRecipeCommand` removes a recipe from the RecipeBank. | ||
| * `AddIngredientCommand` adds an ingredient to the IngredientStorage. | ||
| * `RemoveIngredientCommand` removes an ingredient from the IngredientStorage. | ||
| * `AddShoppingItemCommand` adds an item to the ShoppingList. | ||
| * `RemoveShoppingItemCommand` removes an item from the ShoppingList. |
There was a problem hiding this comment.
Will it be better to elaborate on the implementation of the commands rather than briefly stating the description?
| The following is a UML diagram of the `commands` package: | ||
|  |
There was a problem hiding this comment.
Detailed and well-structured UML diagram for understanding. Good job!
| | v2.1 | beginner meal prepper | see meal-prepping tips | improve my meal-prepping | | ||
| | v2.1 | health conscious student | track calories of dishes | know exactly how many calories my food has | | ||
| | v2.1 | aspiring chef | save my favourite recipes | access them easily | | ||
| | v2.1 | user that is going to shop soon | be recommended recipes that are an item away | plan what to buy next when I'm not limited by my current ingredients | |
There was a problem hiding this comment.
Very detailed and developed user stories help to visualize the developing process of your project.
| | v2.1 | aspiring chef | save my favourite recipes | access them easily | | ||
| | v2.1 | user that is going to shop soon | be recommended recipes that are an item away | plan what to buy next when I'm not limited by my current ingredients | | ||
| ## Non-Functional Requirements | ||
|
|
There was a problem hiding this comment.
Maybe consider to add sequence diagram for each command you have for better visualization of your commands.
| Below is a Sequence Diagram of an example of how a User performs command view -month=5 to view his dishes for the month of May | ||
|  | ||
| The class diagrams of UI and Calendar printer are seen below | ||
|  |
There was a problem hiding this comment.
I think there are icons used in the plantUML diagram that does not follow course guidelines.
| The following is the class diagram for the classes Recipe and RecipeBank. | ||
|
|
||
|  | ||
|
|
There was a problem hiding this comment.
Good job creating the class diagram! But I think the link between recipeBank and recipe is a bit ambiguous, there is a "1" but also a "contains" and "many".
There was a problem hiding this comment.
If recipeBank contains a recipe, I think the arrow should be the other way around.
| The following is the class diagram for the classes Recipe and RecipeBank. | ||
|
|
||
|  | ||
|
|
There was a problem hiding this comment.
Also, maybe its better to add a * to the link between recipe and ingredient.
| The following is the class diagram for the classes Recipe and RecipeBank. | ||
|
|
||
|  | ||
|
|
There was a problem hiding this comment.
If recipeBank contains a recipe, I think the arrow should be the other way around.
| The following is the class diagram for the classes Recipe and RecipeBank. | ||
|
|
||
|  | ||
|
|
There was a problem hiding this comment.
The link between recipeBank and dish also has no arrow.
| <div style="page-break-after: always;"></div> | ||
|
|
||
| ### How the architecture components interact with each other | ||
| The _Sequence Diagram_ below shows how the components interact with each other for the scenario where the user issues |
There was a problem hiding this comment.
class diagram might be more suitable to represent overall architecture instead of a sequence diagram
| These classes facilitate user interaction by providing formatted output and handling command-based operations. | ||
|
|
||
| Below is a Sequence Diagram of an example of how a User performs command view -month=5 to view his dishes for the month of May | ||
|  |
There was a problem hiding this comment.
would be better to standardise a colour for all your diagrams for consistency
| This approach keeps business logic separate from UI logic, improving code maintainability and readability. | ||
|
|
||
| <div style="page-break-after: always;"></div> | ||
|
|
There was a problem hiding this comment.
can consider adding a line break between each section for better readability
| planning their meals with their limited budget and time. | ||
| <div style="page-break-after: always;"></div> | ||
|
|
||
| ## User Stories |
There was a problem hiding this comment.
might want to double check the format of user stories, does not properly show up as table
|
|
||
| The following is the class diagram for the classes Recipe and RecipeBank. | ||
|
|
||
|  |
There was a problem hiding this comment.
can relook at positioning of classes to make labels on arrows more visible
| printCalendarRow(year, month, secondRowFirstDate, daysInMonth, list); | ||
| printCalendarRow(year, month, thirdRowFirstDate, daysInMonth, list); | ||
| printCalendarRow(year, month, fourthRowFirstDate, daysInMonth, list); | ||
| printCalendarRow(year, month, fifthRowFirstDate, daysInMonth, list); | ||
| printCalendarRow(year, month, sixthRowFirstDate, daysInMonth, list); |
There was a problem hiding this comment.
This part could probably be done using a loop
| private boolean expiringSoon = false; | ||
| private boolean expired = false; |
There was a problem hiding this comment.
I think these can be updated based on current date automatically rather than requiring separate fields
| int startIndex = receivedText.indexOf(RECIPE_FLAG) + RECIPE_FLAG.length(); | ||
| int endIndex = receivedText.indexOf(" ", startIndex); | ||
| if (endIndex == -1) { | ||
| endIndex = receivedText.length(); | ||
| } | ||
|
|
||
| return receivedText.substring(startIndex, endIndex).trim(); |
There was a problem hiding this comment.
This code was repeated several times
| @JsonProperty("name") String dishName, | ||
| @JsonProperty("date") String dishDate) { | ||
|
|
||
| this.dishName = dishName.toLowerCase(); |
There was a problem hiding this comment.
Great consideration of case-sensitivity!
fixed bugs with recipe delete
recipe deletion warns if dishes scheduled
…d for ingredient. Adjusted test cases to reflect units behind ingredients
Fixed bugs regarding ingredient expiry dates. Added new Update comman…
Improved code readability Updated app version in welcome message
* 'master' of https://github.com/jxromy/tp: checkstyle start Update command # Conflicts: # docs/UserGuide.md
Updated UG table of commands
Add LoggerTest, update PPP
* 'master' of https://github.com/jxromy/tp: Update whalesyong.md Update AboutUs.md Update AboutUs.md Update AboutUs.md fixing text ui test minor fix for logger Fix Text UI for Github CI Robustify tests for CI Add debug code for Github CI Try fixing github CI Add flushing for log tests for Github CI Fix checkstyle AGAIN resolve checkstyle err Fix Test errors for CI Fix checkstlye Add LoggerTest, update PPP Add PPP segment # Conflicts: # data/cookingaids.json
Fixed UG
Updated PPP
change aboutus links
fix error emssages for shopping list
Update parser diagram
Minor ppp update
Final PR




CookingAids helps exchange students plan for healthy meals effortlessly. With an intuitive meal planner and a built-in recipe generator, users can create healthy meal plans and optimise their grocery shopping. The recipe generator suggests easy-to-make dishes based on available ingredients, making meal preparation more efficient and cost-effective.