MVC is a design pattern. A reusable "recipe" for constructing your
application. Generally, you don't want your user interface code and data
access code to be mixed together, it makes changing either one more
difficult. By placing data access code into a "Model" object and user
interface code into a "View" object, you can use a "Controller" object
to act as a go-between, sending messages/calling methods on the view
object when the data changes and vice versa. Model-view-controller (MVC) is an architectural pattern used in software
engineering. In complex computer applications that present a large
amount of data to the user, a developer often wishes to separate data
(model) and user interface (view) concerns, so that changes to the user
interface will not affect data handling, and that the data can be
reorganized without changing the user interface. The
model-view-controller solves this problem by decoupling data access and
business logic from data presentation and user interaction, by
introducing an intermediate component: the controller.Model:
The domain-specific representation of the information that the
application operates. Domain logic adds meaning to raw data (e.g.,
calculating whether today is the user's birthday, or the totals, taxes,
and shipping charges for shopping cart items). Many applications
use a persistent storage mechanism (such as a database) to store data.
MVC does not specifically mention the data access layer because it is
understood to be underneath or encapsulated by the Model.View:
Renders the model into a form suitable for interaction, typically a
user interface element. Multiple views can exist for a single model for
different purposes.Controller: Processes and responds to
events, typically user actions, and may invoke changes on the model.