UberEatsClone icon indicating copy to clipboard operation
UberEatsClone copied to clipboard

OrderModel

Open shannah opened this issue 5 years ago • 0 comments

Conceptually there needs to be an OrderModel with the details of the order. This would include which dishes are being ordered, quantities, and add-on choices for the dish.

This will affect some aspect of the views. For example, the DishAddOnView has a boolean property isSelected that you track internally in the view and update when the button is selected/deselected. This state should be stored inside a model. Depending on how you want to design the model, you might have a "selected" property in the DishAddOn model and just bind on that.

If you find yourself adding state variables inside a View class (other than just to help with determining if it is in-sync with the model), then it is an indication that the model needs to be adjusted to store that state instead.

shannah avatar Jan 25 '21 13:01 shannah