UI abstractions, part 1: MVC

published 2023-08-15

MVC

The model-view-controller pattern in short:

Rendering graph...

The model:

The view:

The controller:

Characteristics

It’s possible to realize the MVC-pattern as a ‘one-way communication scheme only’, simplifying control and data flows in the involved components:

The strict separation in one-way-communication allows the pattern to be easily used in server-side-rendering, in which the view (HTML-pages) display the current state, holding clickable links which, when being clicked, executing controller-logic on the server side, which then update the model, like session information or database state, or even simply embed all model state in the HTML-page, so the server side is completely stateless, and finally, render the updated state into a new view in shape of a rendered HTML page, representing the new, updated view.

In ASP.NET, for example, the controller on the server-side returns the next view to be displayed, after updating the model and rendering the new state via view into HTML.

Examples