Over the last 30 years websites have gone from simple HTML pages with a bit of CSS to incredibly complex application with thousands of developers working on them. To decrease the complexity of project, developers started to use different software Architectural design patterns. Yes! Among many of them MVC Architecture is the most popular pattern. MVC stands for Model, View and Controller. Each of these components are built to handle specific development aspects of an application.

At first client will send the request to server. When the request come to server, Controller will respond to the request. Controller is responsible for handling request flow.

Next, Controller will pass the request to Model. Model is responsible for handling data logic and interactions with database. Model gets the data for the particular request from database and send it back to Controller.

Controller cannot send data directly to client. Because the data might not be in human readable format. Here for, Controller sends the data to be modified to View. View is responsible for handling data presentation and dynamical rendering. View format the data, arrange it, add some styles and pass it back to Controller. Controller give the data to client as a response.

For example: User sends the request to server to get the list of employees. Controller will take the request and send it to model. Model query the database via select * from Employee and return the list of employees to Controller. On successful retrieval of data from model to controller, Controller send the list to View to get the presentation. View render the list in HTML format and return to Controller. Finally Controller give the list of employees to user as a response.

Popular MVC web frameworks

1) Django

2) Laravel

3) Express JS

4) Flask

5) Ruby on Rails

Undergraduate at University of Moratuwa