Model View Controller……Kiss your mother with that mouth?

A really dumb way to explain MVC…

RoarzOnRailz
thelearningcurve
Published in
4 min readSep 26, 2019

--

Oh hey !!! Thanks for checking in! I’m fantastic 😁.

As some of you may, or may not know I am currently completing the 6 month Fast Track Bootcamp Coder Academy Brisbane!🙌

What a cray……No cray is not a typo…..its just how I say it…fight me! …. 6 weeks this has been so far !. I cant believe how much I have learnt in 6 weeks 😮. If someone had of said to me 6 weeks ago that I would have completed a Ruby Terminal application and created my own Portfolio website by now I would have laughed in their faces.

SHAMELESS PLUG!

Portfolio Website: https://roakz.github.io/portfolio-website/

GitHub link for Llama Palooza (Ruby terminal app): https://github.com/Roakz/Llama_Palooza

Aaaaaaanyway….enough rambling 😆

We are here to talk about MVC…I’m sorry what?….. yes I said MVC. It stands for Model View Controller.

As our Cohort has moved into the next phase of our coding journey it has become a mysterious … neigh dreaded term that instils fear across the room. Even Karl our class mascot which happens to be a crocheted Lllama had a blank look on his face…. And that guy doesn't miss a beat!

Karl and I after a week of Portfolio assignments.😴

Rambling truly over now…..I promise….

Ok so MVC…What Does it mean and what is it…

I wanted to break this down to consolidate my own learning and to help others in the future understand MVC or Model View Controller. Same thing in case you were wondering.

Model view controller is basically a methodology or shall I say Pattern or Design Structure. I’ll say it again Design Structure. It is a common structure used in the Programming world and an adopted structure of Rails or Ruby on Rails.

Let me break it down

Model

The model part of the structure is where you will find the DATA. It is literally the part of the structure that stores data that may need to be accessed or modified for one reason or another depending on the app that you are making. Think of it like the Wikipedia of the app world.…it holds the answers dude ☮✌.

View

The view part is talking about anything that is displayed to the user, the user interface! So if we are printing a message to the screen as an output or a request for input or just generally displaying anything this is where it would be. Think of it like your computer screen or the Television…. Its all about the vision dude ☮✌.

Controller

Controller is the middle man. Basically controller fetches the required data or information from the Model and sends it to the View. The controller is the logic or the muscle. The delivery man even. Its totally in control dude ☮✌

Ok enough ridiculous Puns…..

So what does it all mean Basil?

…Somebody stop me !!!

The funny thing is that in a logical sense it’s almost easier to think about it as MCV or Model Controller View. Remember that Controller is the middle man!

An analogy would be like an old school movie theatre with the Projector out the back and the screen out the front. The reel is the model which stores the movie, the Projector is the controller that knows how to find the movie and play it and the screen is the view. The people watching don’t see what is happening at the back! they just see the screen !

I hope this helps anyone that needed a bit of clarity on MVC or Model View controller!

Peace out guys!!🦙

--

--