Hi,
Can any one explain about difference between MVP, MVVM, MVC architectural design patterns with simple examples.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Francis SusaimichaelPosted Apr 21, 2016, 3:16 AM
It's not an easy task to explain it with simple example in a thread. I would suggest the below urls, which gives a brief introduction about each architectural patterns:
Nishant MittalPosted Apr 21, 2016, 3:14 AM
Comparison MVC with Other Patterns:
In the previous articles I have mention What MVC is and small application using MVC pattern.
Now let’s move further and see what advantages MVC provide us as compare to other packages.
1) 1) Smart UI Pattern: I think everyone has used this pattern in his/her life once we have started our carrier in coding.
In Smart UI pattern we generally add “Form (Web or windows), adding events like button click, keystrokes, mouse move etc. Code quality in this is highly coupled. UI code and Business logic got all mixed together. The code that defines the acceptable values for a data input, that queries for data or modifies a user account, ends up in little pieces, coupled together by the order in which events are expected.
The main drawback of this pattern is to maintain the application and extend it further. Let say I got a new changes; I may keep more “if” statement in the code to get the changes done. Same in case of extending the functionality.
In case you want to write small application for client, Smart UI pattern is perfect to use.
2) Three tier Architecture: Most popular architecture and interview question. It’s the most widely used architecture. Also the best part it can be extended up to NTier. We have well defined layer under that we need to write the code. Whole business logic will move into business layer. DAL will contain data access code etc. And UI will contain event related stuff. The difference is that when the UI layer is directly coupled to a click-and-event GUI framework (such as Windows Forms or ASP.NET Web Forms), it becomes almost impossible to perform automated unit tests.
3) 3) MVVM (Model View View model): MVVM almost plays the same role as MVC.Unlike MVC MVVM has no notation that a view exists or not. But following are the benefits of MVVM.
a) Flexibility for designer and coder to work simultaneously.
b) Thorough unit testing for your solutions.
c) You can use concept of reusability of components across the application.
d) Can change UI without affecting code base.