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

OrderModel #4

Open
shannah opened this issue Jan 25, 2021 · 0 comments
Open

OrderModel #4

shannah opened this issue Jan 25, 2021 · 0 comments

Comments

@shannah
Copy link

shannah commented Jan 25, 2021

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.

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

No branches or pull requests

1 participant