The
Model-View-Controller (MVC) design pattern assigns objects in an application one
of three roles:
Model, View,
or Controller.
The pattern
defines not only the roles objects play in the application, it defines the way
objects communicate with each other. Each of the three types of objects is
separated from the others by abstract boundaries and communicates with objects
of the other types across those boundaries. The collection of objects of a
certain MVC type in an application is sometimes referred to as a layer—for
example, model layer.
Model Objects: Model objects
encapsulate the data specific to an application and define the logic and
computation that manipulate and process that data. For example, a model object
might represent a character in a game or a contact in an address book.
View Objects: A view object is an object
in an application that users can see. A view object knows how to draw itself
and can respond to user actions. A major purpose of view objects is to display
data from the application’s model objects and to enable the editing of that
data.
Controller object: A controller object
acts as a coordinator or as an intermediary between one or more view objects
and one or more model objects. In the Model-View-Controller design pattern, a
controller object (or, simply, a controller) interprets user actions and
intentions made in view objects—such as when the user taps or clicks a button
or enters text in a text field—and communicates new or changed data to the
model objects.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The Model-View-Controller (MVC) design pattern assigns objects in an application one of three roles:
Model, View, or Controller.
The pattern defines not only the roles objects play in the application, it defines the way objects communicate with each other. Each of the three types of objects is separated from the others by abstract boundaries and communicates with objects of the other types across those boundaries. The collection of objects of a certain MVC type in an application is sometimes referred to as a layer—for example, model layer.
Model Objects: Model objects encapsulate the data specific to an application and define the logic and computation that manipulate and process that data. For example, a model object might represent a character in a game or a contact in an address book.
View Objects: A view object is an object in an application that users can see. A view object knows how to draw itself and can respond to user actions. A major purpose of view objects is to display data from the application’s model objects and to enable the editing of that data.
Controller object: A controller object acts as a coordinator or as an intermediary between one or more view objects and one or more model objects. In the Model-View-Controller design pattern, a controller object (or, simply, a controller) interprets user actions and intentions made in view objects—such as when the user taps or clicks a button or enters text in a text field—and communicates new or changed data to the model objects.