Hi

How would you design and couple the Model, View and Controller in the
following simple example?

By clicking a button on a page, some (out of many) properties on a
Model should be modified and the small part of the View that
represents the modified properties must be updated accordingly. That
is, the onClick event calls an appropriate method, update(), on the
Controller. But how? And what then?

More specifically my questions are:

1) Should the Controller method, e.g. "update()", fetch the modified
properties itself or should the View do it and provide the properties
as arguments to the update() method?

2) Should the Controller "know" the View and let the update() method
manually call some refresh() method in the View after modifying the
Model, or should the View just attach some sort of listener to the
Model (or even Controller?) and the perform the refresh of the
relevant parts itself?

3) In general: Who should "know" who in the MVC design and how should
they "know" each other? How and by who are modifications on the Model
performed (who reads the modified values/properties from the DOM) and
how is the relevant parts of the View updated accordingly?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to