MVC stands for Model View Controller.
It divides an application into 3 component roles which is based on a framework methodology.
These component roles are discussed briefly as follows:
i) Models : These component roles are used to maintain the state which is persisted inside the Database.
Example: we might have a Product class that is used to represent order data from the Products table inside SQL.
ii) Views : These component roles are used to display the user interface of the application, where this UI is created off of the model data.
Example: we might create an Product “Edit” view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object.
iii) Controllers : These component roles are used for various purposes like handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI.
In a MVC application, the views are used only for displaying the information whereas the controllers are used for handling and responding to user input and interaction.
Asked In: Many Interviews |