Skip to content

Implementation and Design Decisions

Mason Daugherty edited this page Jul 30, 2024 · 1 revision

Changes to our design based on feedback in Milestone 2, and additional realized needs:

  • We did not include Recipe.getQuantity(Ingredient) because Ingredients track their own quantity, so getting the quantity in a Recipe is unnecessary.
  • We changed the Inventory constructor. In our design, we had it still referring to the four ingredients we previously have. It now allows for arbitrary Ingredients, as intended.
  • The endpoint deleteIngredient takes in an Ingredient name, rather than a full Ingredient object.
  • The createIngredient endpoint in APIIngredientController takes in a full Ingredient object, rather than just the Ingredient name. This allows us to know what the quantity of the Ingredient is.
  • The updateInventory endpoint in APIInventoryController takes in a full Inventory object, rather than one Ingredient. This allows for many changes to be made at once.

Additional design updates:

  • API creates a string from URL parameters instead of an Ingredient object
    • Allows for an optional quantity parameter
    • Addresses: "How do we pass an Ingredient object?"
  • Illegal Argument Exceptions are thrown when a constraint is violated during Ingredient creation.
  • Error messages have been changed to show inline to allow for quick correction, rather than showing as a pop-up the user must close out of (as shown in our original wireframes)
  • During recipe creation, rather than an error message being printed when a constraint is violated, we included a pop-up.
  • Added clear ingredients buttons on the Add Ingredients and Add Recipe pages to allow for many ingredient removals easily.
Clone this wiki locally