What Exactly are MVC Frameworks And How Do They Work?

Tisey Soft
3 min readJul 3, 2021

I believe at some point in your development career, you’d have heard of the term model-view-controller, mostly associated with frameworks, like codeigniter, Django and the rest, well in today’s article, we are going to take a very brief yet in-depth look at what exactly MVC framework are, and how they work, grab a coffee, and relax, it’s going to be an exciting read!

Photo by Ales Maze on Unsplash

Well, an MVC framework is an architectural pattern that separates an application into three main parts, as the name suggests, Model-View-Controller, each parts designed to handle specific development aspect of an application, traditionally made for GUIs its now mainly used in the web development space, popular for designing web apps and so much more.

Features Of MVC

With the drastic usage of MVC in frameworks, there has to be some sweet sugar hiding within this architecture, let us quickly look at some of the features of MVC

  1. Designing web application with the MVC architecture, you get full control over your HTML, and Styles as well as your routes and URLs
  2. Easy and organized code, with very clear separation of code, and development logic, helps with long term maintenance
  3. Make use of the high list of features provided by already made frameworks like Django and the rest
  4. Support TDD (Test Driven Development).

The MVC architecture

The MVC Architecture

The image is pretty self explanatory, with the image you can get a very basic understanding of how it works.

There are three main components I mean obviouslyyy lol. (I’ll stop now, I’m bad at jokes), Model, View, Controller. Let’s take a more detailed approach.

Model

The model component stores data and its related logic, it represents data that is being transferred between controller components or any other related business logic, it responds to request sent from the view and also responds to instructions given from the controller.

View

A view is part of the application that deals with the presentation of data, views are generally created from the data collected from the Model component, a view requests for information from the Model, and the presents the output.

Controller

A controller — simply put, handles user interaction, basically it interprets an input from the user, then inform the View and Model to process that input, and carry out their respective jobs, in this case model process the input and the View displays it after it’s been processed.

Conclusion

I hope this has given you a very basic understanding of the MVC architecture, if you want more in-depth knowledge, I suggest you get your hands dirty and get started with some MVC frameworks like Ruby On Rails and Django.

If this helped you, leave a feedback and an applause, also follow me on twitter, I’ll see you lot in the next article, stay safe.

--

--

Tisey Soft

Software Engineer — testing the limits of a computer’s brain, lets see how far it can take humanity.