Differences in between MVC, MVP and MVVM

Posted by Rajeshk under ASP.NET on 11/17/2012 | Points: 10 | Views : 74526 | Status : [Member] | Replies : 4
Hi all,


can anyone tell me the differences in between Model view Architecture(MVC) ,Model View Presenter(MVP) And Model View View model(MVVM)

Thanks&Regards
rajeshkommireddy@gmail.com



Responses

Posted by: Sheonarayan on: 11/17/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Rajeshk,

There are bunch of resources available on this website related with MVC, MVP, MVVM.

Read this article on this website that details the same and even more http://www.dotnetfunda.com/articles/article830-comparison-of-architecture-presentation-patterns-mvpscmvppvpmmvvm-an.aspx.

For short and sweet comparison, visit http://www.dotnetfunda.com/interview/exclusive/x4408-net-and-aspnet-interview-questions-what-is-mvc-mvp-and-mvvm-pattern.aspx as well.

Hope this helps.

Regards

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Rajeshk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshk on: 11/17/2012 [Member] Starter | Points: 25

Up
0
Down
hi Sir,
Thank you ,yeah it helps me alot.....can you give me an example which implements MVP pattern with the code because i dont know how to implement is it possible to do with Visual studio.net?

Thanks&Regards
rajeshkommireddy@gmail.com

Rajeshk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 11/22/2012 [Member] Bronze | Points: 25

Up
0
Down
MVC, MVP, and MVVM are some of the common patterns to guide programmers toward creating decoupled solutions.
The software behaviors that are common to MVC, MVP, and MVVM are:

1)Data Layer / Business Logic (Model): This is the behavior which applies the business logic to the application's data. A Domain Model usually represents the Model where the objects are used to mimic the real world entities.
2) Presentation Layer / UI ( View ): View is responsible for the visual presentation of the application. This behavior displays model information to the user.
3) Application Logic ( Controller, Presentation or ViewModel ): This behavior holds the logic that implements the interaction between the model and the view.

MVC

1)MVC consists of three layers Model, View, and Controller.
2) MVC is a compound pattern
3) It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure.
4)It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.
5)It provides better support for test-driven development (TDD).
6)It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.

MVC Steps

Step 1: Incoming request directed to Controller.
Step 2: Controller processes request and forms a data Model.
Step 3: Model is passed to View.
Step 4: View transforms Model into appropriate output format.
Step 5: Response is rendered.
Example:-
Please refer below link
http://www.codeproject.com/Articles/79577/A-Simple-Tutorial-on-Developing-ASP-NET-Applicatio

MVP

1)1)MVP consists of three layers Model, View, and Presenter.
2)In MVP, View and Model are more loosely coupled, providing a clearer separation of concerns.
3)MVP, View is responsible for delegating the user input to the Presenter.
4)MVP, Presenter and View should have a 1-1 relation, with each View having a reference to its Presenter through the interface.
5)MVP, view binds to the Model directly through data binding.
6)In MVP, unit testing is easier, as View knows Presenter through an interface which can easily be mocked.

Example:-
Please refer this link
http://www.c-sharpcorner.com/uploadfile/john_charles/model-view-presenter-mvp-design-pattern-and-data-binding/

MVVM

1)MVVM pattern is a one of the best solutions to handle such problems for WPF and Silverlight application.
2)When you use MVVM pattern for WPF, Silverlight the view wouldn't have the typical event handlers that's so common in UI code.
3)MVVM provides a clear separation between the UI and application logic.
4))The MVVM pattern includes three key parts:

1)Model (Business rule, data access, model classes)
2)View (User interface (XAML))
3)ViewModel (Agent or middle man between view and model)
Example:-
Please refer this link
http://msdn.microsoft.com/en-us/library/gg405484%28v=pandp.40%29.aspx

Rajeshk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 11/22/2012 [Member] Bronze | Points: 25

Up
0
Down
Please mark as answer if it helpful to you..That helps others who search the same..

Rajeshk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response