Re: Model-driven Views

On Mon, Apr 25, 2011 at 9:14 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/22/11 8:35 PM, Rafael Weinstein wrote:
>> Myself and a few other chromium folks have been working on a design
>> for a formalized separation between View and Model in the browser,
>> with needs of web applications being the primary motivator.
>>
>> Our ideas are implemented as an experimental Javascript library:
>> https://code.google.com/p/mdv/ and the basic design is described here:
>> http://mdv.googlecode.com/svn/trunk/docs/design_intro.html.
>
> The interesting thing to me is that the DOM is what's meant to be the model
> originally, as far as I can tell, with the CSS presentation being the
> view....
>
> I guess we ended up with too much view leakage through the model so we're
> adding another layer of model, eh?

There's always multiple layers of model in any non-trivial system.  ^_^

In this case, the original "DOM as model" is valid in the sense of the
page as a more-or-less static document, where it's the canonical
source of information.  With an app, though, the data canonically
lives in Javascript, with the DOM being relegated to being used to
display the data and allow user interaction.  MDV is one possibility
for making this relationship cleaner and simpler.

~TJ

Received on Tuesday, 26 April 2011 06:33:12 UTC