The theory behind the MVC pattern

Let's go back to the original description of the design pattern:

Now, there's a word that isn't properly defined: user. Usually, when we program applications and algorithms, the user is the human being at the other end of the program. This definition is misleading, as it perpetuates the idea that there should always be a human being inputting information into the controller, and that views are always graphical interfaces.

I would like to challenge this assumption and from now on, we will define a user as follows: the program or human being that consumes the output of the view layer. As such, part of the view layer can be a JSON or XML represented view, or a raw view, with pure data printed on-screen.

We can now rewrite the definition as follows:

Finally, I will argue that the MVC pattern can be nested in itself. For example, the view layer can be represented by a model, a controller and a view. This last argument should not surprise you, as iOS and macOS both have NSViewController and UIViewController classes at the core of their UI frameworks.