MVC (or Model-view-controller) is a popular software framework for successfully and efficiently relating the user interface to underlying data models. Since the programming language Smalltalk first defined the MVC concept in the 1970s.
MVC Framework is common to think of an application as having three main layers: presentation (UI), application logic, and resource management. In MVC, the presentation layer is split into controller and view. The most important separation is between presentation and application logic. The View/Controller split is less so.
In other words, the model contains:
Views and controllers together comprise the user interface. A change-propagation mechanism ensures consistency between the user interface and the model.
The model-view-controller pattern proposes three main components or objects to be used in software development:
In the generic MVC sequence diagram below, it shows the view object is responsible for user input and output, i.e. a dialog box is a good example of a view. A controller object implements the logic for the allowable transactions that can be performed on the model. The model object encapsulates the fine-grained business logic and data.
This sequence diagram example shows how hotel reservations can be made. This sequence diagram captures the behavior of a single hotel reservation scenario by showing a number of example objects and the messages that are passed between these objects as shown in the diagram below: