Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are interested in the historical <em>true</em> MVC, then start with <a href="http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html">Trygve Reenskaug</a>. He created (observed?, catalogued??) it in the late 1970s. For a start, read <a href="http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf"><em>"Models-Views-Controllers"</em></a> from 1979. It defines the terminology. Take careful note of it's title - <strong>all three roles are pluralized</strong>. This is the first thing that most people seem to get wrong.</p> <p>The best description I've found of the original use of MVC is actually in a presentation dated 2004 entitled <a href="http://pl.csie.ntut.edu.tw/~ctchen/pdf/InsideSmalltalkMVC-public.pdf"><em>"Inside Smalltalk MVC"</em></a>. I would guess that the canonical papers that describe the Smalltalk 80 final version of MVC are Krasner &amp; Pope's <a href="http://www.ics.uci.edu/~redmiles/ics227-SQ04/papers/KrasnerPope88.pdf"><em>"A Cookbook for Using the Model-View-Controller User Interface Paradigm in the Smalltalk-80"</em></a> and Steve Burbeck's <a href="http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html"><em>"Applications Programming in Smalltalk-80: How to use Model-View-Controller (MVC)"</em></a>. Both papers are well worth the read.</p> <p>If you have some time to kill and don't mind listening to Robert Martin, he did a good <a href="http://confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years">keynote at Ruby Midwest 2011</a> that touched on MVC. It is a little over an hour, but quite entertaining and enlightening. I tend to follow with his opinion that most implementations get MVC wrong. I spent a little time looking around and finally found a diagram that I can link to which describes MVC. The one that I like came from <em>Pope and Krasner</em>.</p> <p><a href="http://www.as3dp.com/wp-content/uploads/2010/02/mvc_pope_krasner.png">MVC http://www.as3dp.com/wp-content/uploads/2010/02/mvc_pope_krasner.png</a></p> <p>From my point of view, the following are the key points:</p> <ul> <li><strong>a model instance is responsible for notifying the <em>interested</em> objects of changes</strong>. Note that these can be <em>any</em> object instances. The diagram shows both views and controllers receiving updates here.</li> <li><strong>views are responsible for querying the current state and displaying the results</strong>. They usually perform filtering or data transformation as well.</li> <li><strong>controllers are responsible for accepting user input and forwarding <em>view messages</em></strong> along to the view. <ul> <li><em>View messages</em> are a common theme in MVC. It is important that these are independent of the UI world - these are not mouse clicks and what not but a view-specific language of events. This brings us to the next point.</li> </ul></li> <li><strong>The view does not depend on the controller in any way</strong>. Controller's are responsible for arranging and creating views and providing the interface between the rest of the world and the view.</li> <li>In a perfect world, <strong>the view is responsible for making the model representation visible</strong>. This is how it worked when MVC was applied to desktop applications.</li> </ul> <p>The reality is that MVC has been twisted and rewritten for the web world. It's not really MVC anymore or maybe MVC was simply redefined. This is why you are seeing so many different opinions and representations of MVC out there. If you are looking into writing desktop style applications, then look at the stuff by Krasner &amp; Pope. If you are looking into how MVC is applied to the web, then I recommend Uncle Bob's keynote for an alternative that it better suited for web applications - what he called the <em>Interactor, Entity, Boundary Architecture</em> for lack of a better name. Dig around for stuff associated with his talks about <em>"the Lost Years of Architecture"</em>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload