The other day, I asked:
What if we think about the Web this way:
- XTHML = Model
- CSS = View
- {Java/EMCA/DOM}scripting = controller
Tantek responded with:
I think this makes a lot of sense. In fact, see:
http://tantek.com/log/2004/09.html#d12t2359
for some thoughts on the matter. Interesting that we both drew the same analogy.
I do think you made an additional good point about now with AJAX, XCJ/MVC considerations are perhaps more important than ever.
I’ve thought about this more over the last few days and I have a few thoughts
- I think this is really important given the whole AJAX craze. Developers and designers need to be extra careful to be sure that they find a balance between dynamic interfaces and open, query-able HTML-as-api interfaces. These two movements are worthwhile, but could easily interfere with each other (well, really I’m just talking about AJAX interfering with having consumable HTML).
- I’ve been trying to think of how we could apply what we know about MVC to XCJ, but its tough because of a key difference. In my understanding of MVC, the Controller is somewhat of a primary component, coordinating the active of the other two. In XCJ, the XHTML is the primary component, which coordinates the other two pieces by linking to or including them inline. I’m not sure what the implications of this are.
- In the FOO Camp Wiki page which Tantek links to in the above-referenced post, there’s a comment which says:
where do you go beyond MVC?
data structure patterns in XHTML
If we’re going to think of XHTML as ‘just-data,’ it would be useful to think of its structures like datastructures. It seems that we have some XHTML data structures already. Some simple analogies:
And for multi-dimensional data we could either nest these simple structures or use tables.
- Thinking about XHTML as just data could really change the way people develop websites.
XCJ is the logical conclusion of the semantic html, microformats, html-as-api ideas. Each of these are attempts to make the Web more data- and meaning-rich while building on current tools.
Once presentation has been banished to CSS-siberia and behavior to Javascript-jail, all that’s left is data, right?