Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: MVC - basic couple of questions
02-25-2013, 08:20 AM #1
- Join Date
- May 2012
- Thanked 0 Times in 0 Posts
MVC - basic couple of questions
Newbie MVC questions if you are able to help out...
Just wondering - say your model is storing user settings that relate to component settings - a whole bunch of checkBoxes in different views - and the model initially gets populated by an external xml file.
1. Should each and every user setting in the model have it's own dispatchEvent, with each checkBox listening for a change to it's specific event? Or is the idea that the model fires off one 'Update' event, and each checkBox (listening for this update event) then 'gets' it's relevant on/off setting from the model? So if it's the latter, and you have 100 checkboxes in your project, all 100 would be updated, even though only one was clicked?
2. I get how the MVC works when, say, clicking a button to change something
- view's button handler updates controller
- controller updates model
- model dispatches update event
- view, listening for event, makes the visual change
...but how does it work for something like a checkBox, where the visual change has already taken place? Say you want the checkBox selection to be stored by the model, how do you then tell the model "don't update the view - it's already updated" thus avoiding and endless loop?
3. Is this a good example of MVC for me to study? Would you regard it a loosely coupled? http://www.ndid.se/2010/12/as3-mvc-e...80%93-revised/
Thank for your help.
Last edited by shaunthomson; 02-25-2013 at 08:23 AM.