Robby on Rails: Does AJAX break the MVC pattern?thoughts.sort_by{|t| t[:topic]}.collect tag:www.robbyonrails.com,2005:TypoTypo2006-09-05T22:12:46-04:00Robby Russellurn:uuid:d97e559a80993c3d5f3edab4dc4ea24b2005-06-18T18:28:00-04:002006-09-05T22:12:46-04:00Does AJAX break the MVC pattern?<p>A friend asked me earlier after he read some background on <em><span class="caps">MVC</span></em>...
“According to the <span class="caps">MVC</span> pattern, a view should never know anything about the users input.”</p>
<p>He was reading this <a href="http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf"><span class="caps">PDF</span></a>.</p>
<blockquote>
Conversely, a view should never know about user input, such as mouse operations and keystrokes.
</blockquote>
<p>I can see his point, but not quite sure that with javascript, that this violates the <span class="caps">MVC</span> rule. Javascript always seems to be an <strong>exception</strong> with web development. (does it become its own controller?)</p>
<p>Thoughts on how to respond to him with a good answer?</p>
<p>It’s obvious that we use <em><span class="caps">AJAX</span></em> with controllers, but what about on a simple <em>Toggle.display()</em> ?</p><p>A friend asked me earlier after he read some background on <em><span class="caps">MVC</span></em>...
“According to the <span class="caps">MVC</span> pattern, a view should never know anything about the users input.”</p>
<p>He was reading this <a href="http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf"><span class="caps">PDF</span></a>.</p>
<blockquote>
Conversely, a view should never know about user input, such as mouse operations and keystrokes.
</blockquote>
<p>I can see his point, but not quite sure that with javascript, that this violates the <span class="caps">MVC</span> rule. Javascript always seems to be an <strong>exception</strong> with web development. (does it become its own controller?)</p>
<p>Thoughts on how to respond to him with a good answer?</p>
<p>It’s obvious that we use <em><span class="caps">AJAX</span></em> with controllers, but what about on a simple <em>Toggle.display()</em> ?</p>