4 ms·
When you read Trygve Reenskaug's original 1979 paper "MODELS - VIEWS - CONTROLLERS" -- it is very short, simple, and crystal-clear -- (http://heim.ifi.uio.no/~t
by narribbi 9y ago
When you read Trygve Reenskaug's original 1979 paper "MODELS - VIEWS - CONTROLLERS" -- it is very short, simple, and crystal-clear -- (http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf), it obvious what Trygve meant:
* The MODEL is something like a web server
* The VIEW is something like a browser
* The CONTROLLER is something like the Windows start menu
Trygve literally writes:
"A view (=browser) is attached to its model (=server) and gets the data necessary for the presentation
from the model by asking questions (=submitting queries). It may also update the model (=posting) by sending appropriate messages. A controller (=start menu) provides the user with input (=menu items) by arranging for relevant views (=windows) to present themselves in appropriate places on the screen."
- pvg 9y agoHe literally writes these things but none of it really suggests your analogy. 'Controller = start menu' seems particularly iffy.
- cottonflop 9y agoTaskbar might be more appropriate. Or even browser tabs, given he went with the browser.
- coldtea 9y agoBrowser tabs are the same thing as a start menu conceptually. Hardly the best example of an MVC controller (even if they still are controllers).
- hasenj 9y agoIt seems more like: Model: JavaScript View: HTML templates and css Controller: Browser engine
- Cieplak 9y agoWow, thank you! That is enlightening. It makes me think of a Nintendo (model) plugged into a TV (view) with a controller (controller) plugged into the Nintendo.
- avodonosov 9y agoContoller is a toolbar I would say
- pavlov 9y agoI feel this demonstrates why the MVC nomenclature is too vague and overloaded to be very useful any more. When every person has their own interpretation of the terms, they've lost meaning. Case in point: to you, it seems obvious that the controller is like the Windows start menu. To me, that doesn't make any sense at all.
- wruza 9y agoIn common^W my sense, controller is a thing that rules the views in a non-data plane. E.g. in master-detail scheme someone has to switch detail datasets once user selects new master row. Controller is the one responsible, cause data has no knowledge of how it is presented — master-detail vs. tree-unfold vs. edit-dialog. Controller emerges from the fact that a single data item can be presented on many different forms with different behavior rules. The last sentence is pretty straightforward on that.
- pionar 9y agoSo, I would think in that case - in our sense :) - that the "C" would better be served by being called a "Coordinator" instead of "Controller".