问题
I've been studying and working with presentation design patterns for a while, and i have successfully impleneted design patterns like FrontController
, MVP
etc. for WebApps
, and of course the MVC
pattern and the ASP.NET MVC
framework which is a great choice. however, i was wondering if using a presentation pattern like MVP
would be a good choice for WinForms
applications. if the answer is yes then great, if not and/or there are pitfalls to be aware of it would be great if you could explain the ideas a little bit about different presentation patterns in WinForms
applications.
回答1:
All presentation patterns derive from MVC. However, Model2 is what ASP.NET MVC gives us, MVP is devided in Passive View (PV) and Supervising Controller (SC) and Presentation Model is what the MVVM give us.
For the Web,
- Model 2
- MVP (both PV and SC)
For the Windows Forms
- MVP (both PV and SC)
For the WPF
- MVP (both PV, SC)
- MVVM
There is a very nice figure from the book "Microsoft .NET: Architecting Applications for the Enterprise" which presents MVC, MVP, MVVM and what can be fit in Windows Forms, Web Forms, ASP.NET MVC.
The figure 7-14 is on page 374, however you can also watch it here.
回答2:
You may want to look the following article where few popular and new design patterns that are related to presentation component and model are described.
来源:https://stackoverflow.com/questions/7019035/presentation-design-patterns