Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple explanation for MVC (model view controller) pattern [closed]

How would I go about explaining the model view controller (MVC) pattern to someone who has no programming experience whatsoever?

like image 722
np. Avatar asked Aug 27 '12 08:08

np.


2 Answers

If I were explaining this to my grandmother who is not a programmer, I'd explain it with sugar, a cup of coffee, and herself:

(Disclaimer:This is not an actual photograph of my grandmother! I am not a perfect painter with Microsoft Paint!)

like image 80
ComFreek Avatar answered Oct 05 '22 18:10

ComFreek


Assuming this person knows what a computer is and how to use a browser, I'd try something like this:

MVC stands for Model, View and Controller. Each of these have a role in a system.

  • The Model gets requests from the Controller and sends back data.
  • The View gets data from the Controller and handles rendering.
  • The Controller has a larger role:
    • It sends requests to the Model, gets data back and passes on appropriate data to the View.
    • It gets and interprets requests from outside the MVC-pattern (client requests).

Otherwise, try an illustrative real life example:

  • Your Model is a warehouse manager.
  • Your View is a salesman.
  • Your Controller is a general manager.

And the entire MVC-solution is the company they work in.

If you understand the MVC pattern yourself, I'm sure you can make make an understandable explanation from this.

like image 22
Aske B. Avatar answered Oct 05 '22 18:10

Aske B.