Understand MVC Pattern?

What metaphor is good for understanding the Model-View-Controller pattern?

  • I'm trying to understand the MVC pattern and I'd love an intuitive way to understand it.

  • Answer:

    A painting Paints are the model. They have unique and similar properties to other paints. You can mix them or use them as pure as possible. The painter is the controller. The painter performs the task using the paint and easel. The painter takes the paint from the palette and decides how to apply it to the easel. The easel is the view. It is agnostic of the painter and paint and doesn't care how it will be used. It does, however, have qualities like size and texture that effect the outcome of the painting. Notice here that the paint and easel have nothing to do with each other, as should your models and views. Only the painter, or controller, merges the two mediums.

Ryan Nystrom at Quora Visit the source

Was this solution helpful to you?

Other answers

A good metaphor would be TV : The model are TV channels The view would be the TV screen The controller would be the end user, using his remote control to change the view by switching channels. But even in technical terms, it's pretty simple : The model is the data storage (your database). The view is what the user interacts with (html page, app view...). The controller is sitting in the middle, interpreting what the user want in the view and applying it to the model.

Alain Mevellec

This one is the best IĆ¢€™ve come accross so far, and my job is to explain MVC pattern to coding complete beginners. https://medium.freecodecamp.com/model-view-controller-mvc-explained-through-ordering-drinks-at-the-bar-efcba6255053#.vcygtwprjEnjoy the reading!

Nicolas Flz

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.