Model View Controller Definition
The MVC (model view controller) is a pattern on the basis of architecture or design of application. It divides the architecture of web app into three main logical components or objects.
Each components of this pattern is built to handle specific area of application. For example you will separately deal with database queries, user interface (views) and application logic. On the other hand it is possible to write all these things in a single page, But it is complex to handle. So MVC makes easy to create and accelerate workflow in development of any application.
There are three components of MVC:
It is main and central component. which deals with information and logic of data in application. You can write code to insert, delete, update and create in model. It primarily acts like a bridge between database and application. It is independent from views, means model doesn’t contain any user interface information.
The View component is used to write all the user interface logic. This part will display UI components on computer screen. The user interacts with it. For example any web-page with buttons, drop-downs, boxes and labels etc.
The controller is connecting model and views. It accepts inputs, process it and responds them. It also manipulate the incoming requests. controller interacts with model to render the final output. For example a student will access data from StudentModel (eg. name of a model file) using studentController and view it.
Examples of MVC Frameworks.
- Zend Framework