The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

A different perspective on Model-View-Controller

While having a discussion on new-media (web/software) in opposition to traditional (textual) media, it occurred to me that the metaphore of MVC could be used to explain the structure of a webpage. The markup (HTML) represents the Model, the stylesheet (CSS) represents the View and the behaviours (javascript) handles the Controller-role.
This way of describing the media is analogous to the classical image-analysis, witch operates with a semantic and a syntactic layer, somewhat similar to the Model and the View.

I recognize that this is bending the conventional meaning of MVC, but I think it makes a lot of sense. It does to me anyway, and I'm quite sure that W3C has atleast been aware of it while defining the XHTML standard.

Has anybody stumbled upon some texts dealing with this subject ? Preferably something a bit more academical than the tutorial linked to above.

Off Topic:

I know that this hasn't got much to do with PHP, but it does have a lot to do with MVC, witch has been discussed a lot on theese forums, so I ask the moderators to leave the post in this forum.

The css definitely would be rendering the view, but I'm thinking that the html would represent the controller, and delegates logic (things to do based on input) to javascript (which would become the model).

As far as I see it, MVC is a thought-model (is that a word?) - it can be used to explain structures on different levels.
Consider a traditional php-served webpage ; On the macro-level, everything happening clientside is consider the View, while Controller-stuff happens in the php-script and the Model is covered by filesystem and a relational database. With AJAX technology, the Controller is shifted more towards the client.
At the same time, each macro-component can be decomposed into a "local" MVC. Using an MVC-aware framework for PHP is an example of this, and as we push more code onto the client (AJAX) something similar will be needed there. The macro-level Model-component (The database) may use VIEW's (a SQL-feature) and stored procedures may take care of local Controller-stuff.

However, if we percieve a webpage as a closed system (ignoring the webserver and even the browser), it becomes sensible to understand the HTML-CSS-JS triad as reflecting M-V-C. If you consider the paradigmshift between HTML4 and XHTML I think it becomes quite appearent. In HTML4 Model and View weren't seperated - the major change (apart from syntax) to XHTML is exactly the seperation between semantics and presentation. Most clearly exemplified with the <b> vs. <strong> tags.
Btw ; From the javascript-perspective the HTML is accessible through the DOM (Document Object Model). Go figure.