Monday 30 March 2015

Difference between MVC and MVP design pattern

Difference between MVC and MVP design pattern


MVC and MVP both are design pattern and used to do development the project.


S.No MVC MVP
1 Full form is Model View Controller Full form is Model View Presenter
2 MVC is Front Controller based approach. MVP is Page Controller based approach
3 When request comes, Controller interact with Model (and get data) and then send the data to view. When request comes, View interact with Presenter (presenter interact with model for get data and do format) and presenter sent back the data to view.
4 Controller is responsible for displaying the view and controller can change the view also. Controller does not exist.
View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
5 View can interact with model directly. View can't interact with model directly. View must use presenter to interact with Model.
6 Limited Support Unit Testing Highly Support Unit Testing
7. It is design pattern used to separate the view from model. Advance form of MVC.
8. Following are working:
Model View Controller

Following are working:

Model View Presenter