Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can someone explain MVC very simply for me? [duplicate]

Can someone explain MVC very simply for me? I just cant seem to wrap my head around it.

Most tutorials or verbose explanations lose me.

like image 955
Alain Goldman Avatar asked Apr 15 '13 08:04

Alain Goldman


People also ask

What is MVC in simple words?

MVC (Model-View-Controller) is a pattern in software design commonly used to implement user interfaces, data, and controlling logic. It emphasizes a separation between the software's business logic and display.

What is MVC explain with real life examples?

The Model-View-Controller (MVC) framework is an architectural pattern that separates an application into three main logical components Model, View, and Controller. Hence the abbreviation MVC. Each architecture component is built to handle specific development aspect of an application.

What is the correct way to describe MVC architecture?

-MVC is an architectural pattern consisting of three parts: Model, View, Controller. Model: Handles data logic. View: It displays the information from the model to the user. Controller: It controls the data flow into a model object and updates the view whenever data changes.

Can you explain the different advantages of MVC briefly?

A major advantage of the MVC pattern is that it simplifies the testing process by a great deal. It makes it easier to debug large-scale applications as multiple levels are structurally defined and properly written in the application. Thus making it trouble-free to develop an application with unit tests.


3 Answers

To understand MVC in Layman's term, refer to the variation of the bank analogy

Essentially, MVC is:

  • the Model is the part of the code that knows things
  • the View is the part of the code that shows the things the Model knows
  • the Controller is the part of the code that gets commands from the user and tells the View what to show and the Model what to know.
like image 97
Jainendra Avatar answered Sep 27 '22 17:09

Jainendra


It's the separation of data (model), logic (controller) and displaying the results (views). Using MVC has the advantage that the different roles in an application are separated, which makes it more robust. Another advantage is that it's easier to maintain as more developers are used to this way of programming.

like image 38
SPRBRN Avatar answered Sep 27 '22 16:09

SPRBRN


MVC is a way to separate the core of your application from the graphics parts. you have a controler, you does all the access and work, and some views, who just display the result and interact with the user, without doing any processing off the data

http://en.wikipedia.org/wiki/Model–view–controller

like image 40
wazaminator Avatar answered Sep 27 '22 17:09

wazaminator