• Albert Bennett

Simply Put: MVC

Updated: Mar 28, 2021

So what is MVC? I'm sure you've heard of it more than once before and wondered.

Simply put, it's a project architecture mainly used in web applications. The acronym stands for Model, View, Controller.

A project that is using MVC would be structured as such:

- Model:

Represents the shape/ structure of the data.

Model objects retrieve and store model state in the database. Essentially, they form a contract between the view. So as to promise the structure of the data that is going to come back from the database.

- View:

Defines the user interface and enables modification of data through CRUD commands.

- Controller:

Handles requests to the database. Used to render the correct view with the model data.

There is a more modern approach is to this architecture and that is to separate out the structure into several other projects so as to reduce project dependencies and aid in bug/ feature management. This approach is outlined below:

It looks more complex but, it is much easier to manage. The front-end handles the modification and rendering of the data. Where as the back-end is where all

of the heavy lifting takes place. It is here where the model is defined, and data is retrieved/ managed from a data source(s) (api, database, etc). Another great advantage of this approach is that it is easier to update individual elements, and add new features.

I hope this brief explainer helps :)

18 views0 comments

Recent Posts

See All