The Model-View-Controller (MVC) architectural pattern is used in software engineering
to allow for the separation of three common features in GUI applications:
the data access (typically via a database)
the business logic (how the data will be used)
user interaction (how the data and actions will be visually presented)
Towards this end one defines three components of such an architecture:
Model: This provides the means by which data is obtained
and manipulated. One of the goals of the model
is to give a presentation which does not directly refer
to any specific DBMS.
View: This represents the visible user interface; it knows enough about
the data to create a coherent presentation, but does not actually do the work
of presenting the data. Instead, it provides the ability to manipulate data
outside the View through event handlers defined within.
Controller: This joins the Model with the View and is the heart of
the business logic. It is the source
of activity when an event occurs and
defines the event handling actions which access data (from the Model)
and are presented to the user (in the View).
In particular, the data presentation can be changed without any notion of how
the data is obtained and conversely,
the data access can be changed without any knowledge of how
it is to be presented.
Object Relational Model (ORM)
In many cases, the underlying model used is
an Object Relational Model because it gives
an object-oriented presentation of the means by which a relational
database is accessed. The ORM offers, in addition to
SQL-like access methods, other access methods suited to common
queries like fetching by id, fetching all from a table, etc.
ORM packages stand in contrast to a "homegrown" models which
provide member functions which suit the needs of the specific
application, as well as others, but are not general enough
to suit the needs of any application.