MVC vs. MVVM, MVP, HMVC, and MVA

Vincent Nguyen
3 min readFeb 13, 2021
MVC Architecture with Model, View, and Controller pointing an arrow at each other.
Image from https://www.tutorialsteacher.com/mvc/mvc-architecture

MVC —

An architecture which can be used to define the parts used to create an application. The model houses the data necessary to route to the view. Here the code’s goal is to create paths for data to be displayed when it reaches the view section. The view houses the visual part of the application such as the user interface (UI). The code here can be several pages and each page will have to be linked to its corresponding model code. The controller comes into play here, connecting the information requested from the view and adjusting to the appropriate model so that a visual aspect can be displayed to the user. This type of architecture carries its own merits when developing an application but there are others that were derived from this architecture.

Image from https://domburf.medium.com/using-the-mvvm-pattern-with-a-xamarin-forms-mobile-app-b1930976bc3d

MVVM —

Architecture utilizes the same type of model and view as MVC with one key difference being the viewmodel. The viewmodel here holds the code to transform data from the model and directly sends this change to the view. This type of change helps to keep each model directly interacting with its respective views without having to worry about a different model accidently affecting their view.

image from https://www.journaldev.com/14886/android-mvp

MVP —

Despite being a familiar acronym in both the sports and software world, this type of MVP is an architecture that utilizes model, view, and presenter. The key differences here are that the view will not contain any logic in it, just the face of the application. The presenter will act as the in-between for the model and view to allow interaction between them. The model and view cannot interact with each other directly in this architecture. Each view will end up having their own model and presenter to handle their actions and requests.

Image from https://stackoverflow.com/questions/5454337/mvc-vs-hmvc-for-web-application-development

HMVC —

This architecture utilizes the MVC except on a larger scale thus including the H to stand for hierarchical. This is the MVC model repeated over and over again for the parts of your application. What this allows is for parts of the application to be used again elsewhere as each controller can communicate with another controller. Another point about this style of architecture is to modulate the application into smaller more manageable parts that can work independently. It will also be easier to expand the work to be added to the application due to the capability of controllers calling to each other when a new part is created.

Image from https://medium.com/@eliseharris99/the-model-view-controller-mvc-design-pattern-3c32c5eccbac

MVA —

This architecture looks to solve the same problem as the MVC however with a variation. The MVA utilizes an adapter in place of the controller with its job being the line for the view and model. In this architecture, the model and view are unaware of each other’s existence. Between a single model and view there can be many adapters that modify how the information from the model can be presented in the view.

After this overview of a few architectures hopefully this will help you choose the right architecture for your solution. Happy coding!

--

--