Consider a UI with a tree structured menu. The navigation can go through several subtrees, ordered by functionality of the product. The data which can be modified by each subtree is structured in e.g. C structs which can be loaded from the server. In each leaf menu you can edit only one single data entry of the loaded data structure. When leaving the subtree the complete data structure should be stored back on the server.
In the MVC design pattern, where do I locate the menu navigation and the load/store of the data which will be triggered during the navigation? Is the menu structure embedded into one controller with no model while the data editing is another controller with an actual model? Or is the menu structure a model itself which presents it's current state to the view (as e.g. the current menu number)?
The product contains a LCD segmented display and only a push turn key as input device.
Example:
- Main menu
- Subtree: User menu -> on entry/exit: load/store user data struct
- Leaf: Edit user name
- Leaf: Edit user age ...
- Subtree: Options menu -> on entry/exit: load/store options data struct
- Leaf: Edit display brightness ...
- Subtree: User menu -> on entry/exit: load/store user data struct
Thanks for any advice!!
Aucun commentaire:
Enregistrer un commentaire