MVC Framework

And its alternatives

Joe D Jensen
3 min readNov 17, 2022

Designing an application can be a daunting task. Following an established architectural framework can encourage you to appropriately separate the logical components of your application and ensure your code is accessible to other developers. One very popular framework is Model-View-Controller (MVC).

MVC

The MVC framework is made up of three distinct, but connected logical components. This separation seeks to isolate the internal representation of the data and their representation to the user.

Model

At the core of the MVC framework is the model. The model is the internal representation of the application data. Models typically manifest as tables in a applications database.

View

The view is the external representation of the model, such as a table, chart, or diagram. Web applications frequently utilize HTML templates to render the data served from the model.

Controller

The final component, serving as a key connection between the model and view, is the controller. The controller is responsible for accepting user input and giving the model instructions based on this input.

After the model executes the instructions sent from the controller, the model it updates the view. The controller can also handle simple manipulations to the data that do not require updating the database. The MVC framework was designed in the 1970s, and with fairly simple applications in mind. As such, alternatives which are more appropriate for the current environment have evolved.

Model View Viewmodel (MVVM)

As you may have guessed, the first 2 components of this framework provide the same separation as above; model is internal, view is external. The communication between these components, however, is different.

As web application GUIs became more involved, the separation between view and controller began to deteriorate, with more and more user interface elements being added to the views. MVVM seems to solve this by automating communication between the view and the model. The view model exposes public properties and commands which can be bound to the view. These bindings can then be used to send and receive updates to and from the model.

This improvement allowed UX designers to focus on UX, with the business logic communicated between ViewModel and Model, improving concurrency and throughput.

Hierarchical MVC

Another outgrowth of MVC is hierarchical MVC. This framework aims to increase modularity by allowing MVC triads to call on each other. If pieces of content need to be repeated multiple places, this framework can reduce proliferation of views, and reduce unnecessary data loading that frequently occurs when performing multiple model instructions in traditional MVC. A standard HMVC architecture allows your top level MVC to call on other MVC triads, and use the results to render the final view.

Now you can use each of these triads to represent reusable components!
Many other frameworks exist, including several other direct descendants of MVC. If you are still interested after all this, check out Model View Presenter and Model View Adapter.

--

--