What Is M.V.C ?

Abir (@imabptweets)
3 min readMar 8, 2020

--

Hey, whats M.V.C?

Just another way to make you more cool with web-app/software production.
Lets understand M.V.C with a daily life example-YouTube, you read right, YouTube.

What am I exactly doing ??
Searching Cats and Dogs on YouTube. Well, not exactly.

CURIOUS. ??

So here I see..
Side Bars and Menu bars remains as it is.
Just the Space where Video lists are shown, gets changed based on user search.

Is it Common???
You may say, yes!
But what you think, YouTube has written code for every such search result page.
No, that’s not possible.

More Curious, How did they do it??

You will be amazed, getting to know that, they have written the code for the web page only once. And rest is the magic of M.V.C .

Want this Superpower ???
If that sounds interesting.
Connect here: Linkedin

Working Of M.V.C

First of all, Instead of going directly into jargon, lets see what happens when a user search for a query on YouTube.

Lets Demystify M.V.C.
View, in layman terms, is what user sees on the screen.
In technical jargon, we can say it is the data sent by controller to render the user interface.

  1. User searches a query on YouTube Within speed of light, (if you have good connectivity ;D ) the request is sent to Controller. Hey Pause…
    (Controller: In layman’s term, is the middle man between Model and View and is responsible for requesting information and send the response from Model to View. Controller doesn’t perform any logical data operation, it is a medium for communicating between model and view.)
  2. Controller based on request sent by user, asks for information regarding that request to the Model.
    (MODEL: Model is responsible to perform the logical operations, including database operations and is the crux part of M.V.C. Model can be written in multi language based on web-application requirement. But here we will be using JavaScript and the ExpressJS.)

User Searches an item and the request is sent to controller, and controller requests information to model, and receives the information, and the controller sends the data to view which displays the final result to the user.

--

--

Abir (@imabptweets)

I love to build,innovate and write about software from its scalability to its design. Also passsionate about Dev-Advocacy. DMs open: twitter.com/imabptweets