Saturday, 8 July 2017

An introduction to MVC Design Pattern

Model-View-Controller is the software design pattern that divides the application into three interconnected layers. These three layers are:
  1. Model
  2. View
  3. Controller
Each of these layers are built to handle specific development aspects of the application. MVC is one of the most widely used web development framework to create scalable and extensible projects.
In the MVC design pattern, the User inputs, the business logic , and the visual feedback to the user are explicitly separated by the three layers, each of which is specialized for a particular role in the application.

Model Layer: The model layer represents the data of the application domain, responds to requests for information, about the state which is usually from the view, and responds to instructions to change the state usually from the controller. In simple words, the model layer corresponds to all data-related logic that the user works with. This data represents either the data that is being transferred between the view and the controller components or any other business logic related data.

View Layer: The view layer manages the presentation of the application output to the user. It is related to the User interface.

Controller Layer: The controller layer interprets the mouse  and the keyboard inputs from the users, commanding the model and/or view to change as appropriate.In simple words, controller acts as an intermediate layer between the model layer and the view layer to process all the business logic and the incoming requests, manipulates the data using the model layers, and interact with the view layer to render the final output.

If you like the post, please comment, share the post and do like me on Facebook.

Thanks & Regards,
Susanto Paul