Re: MVC on the Web



Responding to Jeff.M...

Caveat: I don't do CRUD/USER applications so I don't use MVC at all. Consequently this is an Executive Summary response....

It seems to me that most Web-related articles and frameworks have
misinterpreted MVC. I wanted to check with you folks to see if I'm
completely off base.

The job of the controller is to "process and respond to events,
typically user actions, and may invoke changes on the model." This
sounds like the domain of the Web browser. The browser processes mouse
clicks, keystrokes and other events, and it communicates information
(via an HTTP request) back to the model. The model would be the data
and code, and the view would be the HTML and CSS.

The browser deals with a particular display paradigm. While it does respond to keystrokes, etc., it only does so within the semantic framework of HTML display (Page, Section, Field, etc.). The browser is simply a mechanism for rendering the View. Thus the business semantics is reflected in text strings used for labels, etc. that are supplied with the HTML for rendering. The Model, View, and Controller all exist on the application side.

The browser should not understand the business semantics of the display content. That is the job of the Controller. [One of the reasons large script-based browser-side applications tend to be unmaintainable is because they do not honor this separation of concerns. They mix business semantics into the scripts driving the rendering.] When the user does something to a form in the browser, the browser simply relays that event back to the Controller in its terms (e.g., "The user clicked the Save control. Here's all the data from the form's Fields.").

The Controller interprets that event in business terms (e.g., "The user has supplied Customer data.") and responds appropriately. Conversely, when the business context requires the user to, say, provide Customer data, the Controller creates a View in HTML for the browser to display and ships it off to the browser for rendering. [The RAD IDEs tend to automate a lot of that so that the actual form can be defined parametrically using external configuration data. Then the Controller just needs to provide the right data from the Model and identify the form.]



--
There is nothing wrong with me that could
not be cured by a capful of Drano.

H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
.



Relevant Pages

  • Re: Desktop running XP Home Edition taking 30 minutes to boot
    ... You have hardware problems on your controller. ... You can remove unnecessary devices from the IDE chain and see if things improve, adding them one at a time thereafter will help finding the culprit. ... I looked at the event log and found the following warnings and errors ... The browser was unable to retrieve a list of servers from ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Object audio/x-midi
    ... For the reference on a 64 bit OS system, I get only a black bar ... QT controller bar. ... This was using the latest Firefox browser. ... WMP or SWF format, the controllers for these are normal. ...
    (alt.html)
  • Re: Object audio/x-midi
    ... For the reference on a 64 bit OS system, I get only a black bar ... QT controller bar. ... This was using the latest Firefox browser. ... WMP or SWF format, the controllers for these are normal. ...
    (alt.html)
  • Re: How to update a portion of a page in near-realtime?
    ... another controller. ... Browser says, time for new update; ... Backend launches the query program, ... browsers have JS enabled) to get the status from the server. ...
    (comp.lang.javascript)
  • Re: Why why why? (Was: Re: Vertical alignment of text within a DIV)
    ... anything else a browser adds to the base web experience. ... The rendering *is not* necessarily part of the base web experience, ... specific to that platform, just as Java, Perl-TK, and Python guis (just ... system, such as a database engine, or a parser of sorts. ...
    (comp.infosystems.www.authoring.stylesheets)