[whatwg] [web-apps] Some comments
Ian Hickson
ian at hixie.ch
Tue Apr 19 03:24:28 PDT 2005
On Sat, 13 Nov 2004, Laurens Holst wrote:
> Ian Hickson wrote:
> > > > The difference is that relying on JS is legitimate, while relying
> > > > on CSS is not.
> > >
> > > Could you please explain how you arrived at this conclusion? It's
> > > not supported by HTML or WCAG specifications.
> >
> > It's not something you'd expect to see in a specification. It's a
> > fundamental concept in the architecture of the Web. Media-dependent
> > and platform-specific material has to be optional, since you can't
> > expect to support every medium or platform (the platforms might not
> > yet exist). On the other hand, content which is key to the application
> > -- such as the logic behind a calculator -- clearly can't be optional.
>
> According to the well-known MVC (Model-View-Controller) design pattern,
> by many considered a best practice to aim for as much as possible,
> scripts should be separated from content and style. At least it kind of
> translates to that (I know this is not 100% correct). The W3C recommends
> the same separation, although I forgot where I read that so
> unfortunately I cannot provide a link at the moment.
Without making any judgements as to the value of the MVC model as opposed
to other models, I just want to note that the model I described is not
counter to the MVC model.
The MVC model, implemented in HTML, would have:
Data model: The HTML file
Control logic: meda-independent JS files
User interface: The CSS files, associated XBL, and media-dependent JS
There's no reason the control logic has to be in the data model.
Now, given the above separation, and the design of HTML, the entire "user
interface" layer can be lifted _and not replaced_, with the user agent
using default values to create a basic user interface view on the fly.
However, the data model and control logic parts, while separate and
capable of being replaced with equivalent implementations independently,
cannot be removed altogether. The user agent would not be capable of
inventing new data models or control logic, like it could invent new UI.
The data model and control logic's markup and JS are the "content", the
CSS, XBL, and media-dependent JS files are the "style". "style" is
optional, and the user should always be able to override it, while
"content" is key to the application. If the user overrides the "content",
he may well end up with a broken, or at least logically different,
application. (Of course, that's his right, IMHO. But it's not a right that
the UA should encourage him to execise, and it is in this way that it
differs from the "style" part.)
--
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg
mailing list