A Semi-Dive into MVC

Nathan Miller
3 min readApr 24, 2021

When it comes to building web applications, I’ll be the first to let you know that I had no idea what actually went into building a website. I mean I did…but only through the eyes of a former myspace user. Building those pages with code, being pulled from sites never registered on how minor programming had slipped into my life at such a young age. From that point, I never really thought much about the meat and potatoes that go into even being able to pull that code for use in an application. What I came to realize is that MVC (although a bit confusing at first) can be such a rewarding experience.

MVC(Marvel vs Capcom)….I mean(Model-View-Controller) is as stated before the base building block of a web application. MVC was originally developed for GUIs(graphical user interface) but had become the 3 main logical components of the architectural framework surrounding web development. MVCs 3 components all have a role to play in the development of web applications and now became the go-to framework for web and mobile apps.

There is a kind of deep lore surrounding the process and development of MVC. Astounding I know 👂🏼🤷🏾‍♂️! But as stated before we aren't here for a Full-Dive only just a Semi. So I’ll be giving a short overview of how MVC the Model-View-Controller all work and why it works the way it does.

Features surrounding this development tool have basically everything you could need to start building a web application from scratch. These features include everything from being able to contact other languages such as existing features provided by ASP.NET, JSP, Django. It allows the ability to clearly see the separation of your Model-View-Controller. Those being: Business Logic: the custom rules or algorithms that handle the exchange of information between a database and user interface. UI Logic(User Interface): the components that make up your view such as labels, input fields, and buttons. Input Logic: the user giving something to the program, and output is the program giving something to the user. These and many other features help keep MVC as one of the core frameworks for development.

Now since we have a slight overview of what the capabilities of MVC are, let us go over how it's used in implemented in the development. We’ll go step by step on what each one does and why it does it.

The Model to start. Stores data and related logic. Data is transferred between controller components or any other related business logic. An example of this would be that a Controller acts as a ferry and receives info from a database. It then takes that info and ferries it back to the database. It's basically taking requests from the views and responds to the controller to update its self. They also refer to the model as the Cook.

The View represents the presentation of data. Views are created by the data collected from the model data. A view requests the model to give information so that the output presents itself to the user. The view also represents the data from chats, diagrams, and tables. Views we'll include all the UI components like text boxes, drop downs, etc. They also refer to it as the ticket or the person ordering the food i.e You.

The Controller is the part of the application that handles the user interaction. A Controller sends commands to the model to update its state. The controller also sends commands to its associated view to change the view’s presentation. The controller is the waiter in this process.

So as an overall synopsis of what's happening. The View, user aka You writes down information about what you would like. That user flags down the waiter or the controller and takes the request you've written down. The waiter(controller) writes it down and transfers that information over to the Model. The Model or cook then takes the information given by the controller and turns that information into food or requested information. Which is then sent back to You the user by the controller the waiter as an update.

In conclusion, MVC as a framework is a significant part of many other frameworks that build off of it such as Rails. We can get back to and cover another in another Semi-Dive. I hope you have a better understanding of how MVC works because I know I have.

--

--