What is MVC?

Ryan Busby
2 min readAug 24, 2016

--

MVC stands for Model-view-controller and it’s a common software architecture pattern for implementing user interfaces. That’s a bit of a mouthful and possibly obfuscates the understanding by the definition. In layman’s terms it means a pattern for modularizing an application for best practices. There are many libraries or tools that incorporate some or all of the three major components of this particular pattern. I’ll be into detail into each one. Let’s dive in!

Here is a diagram of MVC interactions to mull over

Let’s start with the Model. The Model is the core of your application and directly manages the data and logic of your application. Centralizing it is important so it’s easier to manage and reason about it. It interacts with the view and controller and is the source of truth for your application.

Next up is the V in MVC which stands for View. The view is the user interface that the user sees. This text that you see is the view of this application. However the data is stored on the model. The user of a particular application will only interact with the View or Controller in this pattern.

Lastly C is for Cookie.. kidding it actually stands for Controller. An example of a controller is an event or event handler in an application. A form will update the data in the model. A form example will be maybe some sort of comment box on a forums. Say you enter a comment and hit submit the controller will take your data and relay to the model. The model will then store the data and update the view to show your comment was posted.

That’s it for MVC! Keep in mind this is one of the many battle tested software architecture patterns. Knowing which pattern to use for your project will come with time. Also knowing how to classify parts of your application into these particular fixtures will help modularize your code and make you a better programmer overall. As always thank you for reading.

--

--