Model-View-Controller (MVC) is one of the most widespread and influential patterns in software architecture. Despite rumors of MVC’s [death](http://cirw.in//blog/time-to-move-on.html), it remains a useful pattern to [understand](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller). In this post, rather than reining in the various definitions of MVC, I will highlight how it evolved into the modern web frameworks we know and love today.\n\n### Inception\n\nIn 1978, Trygve Reenskaugh and Adele Goldberg coined the name “Model-View-Controller”. Trygve believed MVC and its variants formed a [Pattern Language](https://en.wikipedia.org/wiki/A_Pattern_Language), a shared language for people to talk about problems and their solutions. The concept of a software Pattern Language also influenced the Gang of Four to write the [Design Patterns book](https://en.wikipedia.org/wiki/Design_Patterns). If MVC were included in the Design Patterns book, we would probably find it under the [Behavioral Pattern](https://en.wikipedia.org/wiki/Behavioral_pattern) section, hanging out with patterns like [Mediator](https://en.wikipedia.org/wiki/Mediator_pattern) and [Observer](https://en.wikipedia.org/wiki/Observer_pattern).\n\nHere’s Trygve’s retrospective paper in 2003, [MVC, Its Past and Present](http://heim.ifi.uio.no/~trygver/2003/javazone-jaoo/MVC_pattern.pdf). Trygve enumerates eleven patterns that form the MVC Pattern Language. Only two have stuck around in a significant way: _Model/Editor Separation_ and _Input/Output Separation_, and I argue that these are essentially the same:\n\n> “The View and Controller roles may be played by the same object when they are very tightly coupled” — Trygve Reenskaugh (a point which has been endlessly debated in the community)\n\n### Native MVC\n\nIn the decades that followed, MVC outlived Smalltalk and powered applications for Mac OS and Windows as those systems grew and evolved rapidly. Later, when smartphones began to appear, native mobile apps for Windows Mobile and [early versions of iOS](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html) also relied on MVC and its variants. At Microsoft, MVC later evolved into [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel), which powers projects like WPF, Silverlight, and Xamarin.\n\n### Web MVC\n\nIn the early 2000’s, several important web frameworks adopted the Pattern Language of MVC: Spring, Ruby on Rails, PHP, and ASP.net. These frameworks added a new responsibility for the Controller: handling the initial HTTP request. It went something like this:\n\n!(https://hackernoon.com/hn-images/0*1VVNmPlwpfeytDMh)\n\nControllers respond to HTTP requests\n\nThe Controller is now the entrypoint into the application, rather than the View. The responsibility of the View also changed: instead of presenting something to the user directly and handling input, its job was to assemble a bundle of HTML, JS, and CSS for the browser to render. The HTML/JS would contain logic like button click handlers that would dispatch an action back to the controller via an XMLHttpRequest. Notice that there is no significant presence of the MVC pattern within the browser. That would soon change with the advent of Modern Web Frameworks.\n\n### Modern Web Frameworks\n\nAs the browser wars settled, we finally got to have nice things: XMLHttpRequest, stable DOM API, ES6, etc. With this increased power and flexibility, companies began building more and more complicated web apps (sometimes called [Single Page Apps- SPA](https://en.wikipedia.org/wiki/Single-page_application)), as opposed to related sets of simple web pages. Modern Web Frameworks help organize this increasing client-side complexity and keep application development predictable and productive.\n\nOften, these frameworks introduced an extra build step to create static bundles of HTML, JS, and CSS, for direct hosting via a simple “View Controller” (usually a handler at / or /index.html). The static nature of these resources means we can set cache-control headers and rely on CDNs to help serve them with lower latency. These Single Page Apps include logic (in JS) for making HTTP API requests against a set of resources served by “API Controllers”, which usually respond with JSON:\n\n!(https://hackernoon.com/hn-images/0*dTPUy_vSyQPHe-kX)\n\nThat brings us to today: [React](https://reactjs.org/), [Vue](https://vuejs.org/) , and [Angular](https://angular.io/) are the most popular Modern Web Frameworks. How similar are these frameworks’ organizing patterns to MVC? All have some sort of “View”, so any comparison will need to be done at the next layer: state (Model), mediating logic (Controller), and synchronization.\n\n_I’m about to describe these frameworks by the most common ways to use them. I’m sure someone somewhere insists on pairing Data-Binding with React, Flux with Angular, and french fries with peanut butter._\n\nVue is the most straight-forward: its docs clearly state that [Vue is an implementation of MVVM](https://012.vuejs.org/guide/). Angular is also [MVVM-ish by default](https://angular.io/guide/architecture). However, React was forged from the heart of a dying star, using a super-pattern called [Flux](https://github.com/facebook/flux):\n\n!(https://hackernoon.com/hn-images/0*f2gaPN1PjH_mjJC-)\n\n_Chris Hemsworth creating React at Facebook_\n\n!(https://hackernoon.com/hn-images/0*HIDi0gB-gme8JrcD)\n\nActual Flux diagram; a_ll the arrows on the right-side point clockwise._\n\nFlux is all about one-way data flow. Recall that the Model in MVC represents the persisted data that will be rendered by the View. Flux splits the responsibilities of the MVC Model; it uses Actions/APIs for business logic, and the “Store” for handling state. You can think of the Store as one monolithic [Passive Model](https://docs.microsoft.com/en-us/previous-versions/msp-n-p/ff649643%28v=pandp.10%29) for the entire app.\n\nWhy does Flux embrace one-way data flow? The reasoning goes like this: as an application grows in complexity, it becomes increasingly difficult to manage state changes with view updates, especially if those changes are coming from different sources. As opposed to [Data-Binding](https://en.wikipedia.org/wiki/Data_binding), where the View observes a mutable instance of the ViewModel for property changes, [React creates a new View as a function of immutable State/props](https://reactjs.org/blog/2015/12/18/react-components-elements-and-instances.html#components-can-be-classes-or-functions). The View never needs to worry about local state changes. The app can only change by creating a new Model instance in the state tree. When React wants to update the app, it replaces a part of its state tree with a new object, which triggers the creation of new View(s).\n\nWhile one-way data flow is a powerful concept, it is not a [free lunch box filled with silver bullets](https://en.wikipedia.org/wiki/No_Silver_Bullet), nor does it elevate React/Flux onto a [different power level](https://www.youtube.com/watch?v=SiMHTK15Pik) versus Angular/Vue.\n\n!(https://hackernoon.com/hn-images/0*g2vZ_UYqzRWpp-Oj)\n\nThe MVC tree of life\n\nI hope this has been useful. If not useful, then interesting. If not interesting… well that’s in the past and the past is immutable; perhaps you should replace yourself with a new functionally generated immutable instance that makes better decisions about which articles to read =).