MVC Isn’t MVC
So, the original MVC was designed in the context of green-screen terminal systems. In that context, this “design pattern” really isn’t a design pattern per se; it’s just a formalism over the code you’d inevitably write to make such a system work. In a green-screen system:<p>• the “view” is the terminal buffer state — not even a “virtual DOM” version of it, but literally the buffer state itself (under 3270 protocol, properties like “editable” are basically bits in the TTY buffer applied per-cell — you can think of them like ANSI TTY-cell background colors and not be far off.) Think of it as an mmap(2)ed file in backend memory, holding structs of <i>almost</i> the same type as the view, save for OS-syscall-time remapping to prune out the form labels.<p>• the “model” is the ADT over the record-oriented mainframe datafile backing the terminal (How does the model know how to change the view? Because it’s a very <i>thin</i> abstraction: fields in the view-state, and fields in the DB state, are 1:1, with no parsing or serialization — leading to things like passwords only being stored in the DB at the size of the form-field for them.)<p>• the “controller” is the serial line-discipline that interprets the key codes sent from a TTY into editing actions like “overwrite a character” or “backspace”, and applies those actions to the data in the model (how does it know what part of the model is active? “Spatial databases” have something like a hierarchical navigation-path DB cursor as part of their descriptor state. Switching the active view is a model state change!)<p>• you need an “editor” separate from the “controller” because otherwise every character edit action sent to the TTY would provoke an instantaneous commensurate change in the DB data. If you need to store <i>and validate</i> live edits before committing them to the DB, then you need an editor “proxy” object to hold that “draft” state.<p>All in all, pretty different from anything we’re doing these days. Or is it? Depends on where you draw the line of abstraction! In modern terms:<p>• the classical MVC “controller” is the <i>frontend</i> or <i>per-component view controller</i> — observing the client’s actions and feeding them into the system as events.<p>• the classical MVC “view” is the <i>API query result set, databound through the client DOM components</i>. If your app is server-side rendered, it’s the HTML DOM itself as loaded into the browser!<p>• the classical MVC “model” is the entire backend, through its API<p>• the classical MVC “editor” is the <i>changeset</i> — a CQRS Command-in-draft. (In a HATEOAS context, an HTML form is also this.)