Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is Model View Controller (MVC)?

controller model MVC view
0
Posted

What is Model View Controller (MVC)?

0

In a typical application you will find these three fundamental parts: • Data (Model) • An interface to view and modify the data (View) • Operations that can be performed on the data (Controller) The MVC pattern, in a nutshell, is this: • The model represents the data, and does nothing else. The model does NOT depend on the controller or the view. • The view displays the model data, and sends user actions (e.g. button clicks) to the controller. The view can: • be independent of both the model and the controller; or • actually be the controller, and therefor depend on the model. • The controller provides model data to the view, and interprets user actions such as button clicks. The controller depends on the view and the model. In some cases, the controller and the view are the same object. Rule 1 is the golden rule of MVC so I’ll repeat it: The model represents the data, and does nothing else. The model does NOT depend on the controller or the view. Let’s take an address book application

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123