Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Some remarks on the difference between traditional MVC and web-MVC (was: Re^2: Implementing Model-View-Controller)

by ruoso (Curate)
on Jan 05, 2006 at 16:44 UTC ( #521266=note: print w/ replies, xml ) Need Help??


in reply to Some remarks on the difference between traditional MVC and web-MVC (was: Re^2: Implementing Model-View-Controller)
in thread Implementing Model-View-Controller

First off, since the web mostly works with HTML pages that can only be updated via request/response actions (I'm ignoring flash), you can't really have a model update the view's output directly. Also, there are so many possible views that updating them all would be very inefficient.

Unless you get serious about AJAX (many people bet on this). In theory, you can implement the entire MVC in JavaScript (client-side) and have your server acting just as a Web Services provider. In fact, XForms is just that, the only problem is that it still isn't supported by the web browsers..

daniel


Comment on Re: Some remarks on the difference between traditional MVC and web-MVC (was: Re^2: Implementing Model-View-Controller)
Re^2: Some remarks on the difference between traditional MVC and web-MVC (was: Re^2: Implementing Model-View-Controller)
by Joost (Canon) on Jan 05, 2006 at 17:06 UTC
    Unless you get serious about AJAX (many people bet on this).
    While you can certainly craft stuff on top of AJAX that behaves like a callback system, it's still running on top of HTTP, i.e. request/response pairs originating from the browser.

    That means you're still just polling for data from the client as soon as you need any information from the server side. You're not pushing data to the display as you do in traditional GUI applications, where the view also knows a lot about the state of the display. Actually, my guess is that the more AJAX technology you're using, the more you'd have to focus on plain output & http caching if you want to get any kind of performance (instead of generating one HTML page, you're generating lots of XML fragments).

      That means you're still just polling for data from the client as soon as you need any information from the server side. You're not pushing data to the display as you do in traditional GUI applications.

      Well... I was talking about getting even deeper into AJAX... I mean, the Model would be implemented as Javascript objects, the controller as javascript objects and the view as javascript code glued to the form input elements... This way you would have the same type of communication of traditional GUI applications... where the server doesn't push data also...

      daniel
Re^2: Some remarks on the difference between traditional MVC and web-MVC (was: Re^2: Implementing Model-View-Controller)
by dimar (Curate) on Jan 05, 2006 at 20:15 UTC

    Yup. In fact there is work underway now on complete templating, database persistence and state management using only the browser and Javascript.

    Here are some links relating to what ruoso said:

    Javascript-only Templating and MVC framework.

    Ajax Massive Storage System (supposedly simulate a database without RDBMS or web server).

    The point is that "offline AJAX" is a buzzword to be looking out for. Another buzzword "serverless AJAX" might become popular. In fact, with JSON, you can have "offline AJAX without XML" (which is ironic, since XMLHTTP is what started this whole bandwagon in the first place).

    =oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV

      Well, but if we go to offline AJAX, then we're getting back to that small system that a simple WebMVC already solves... The question here *is* having a complex system that you *do* want to have a server, or yet, multiple servers..

      daniel

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://521266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-10-25 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (143 votes), past polls