Can the MVC Design Pattern / architectural pattern

2020-06-05 04:38发布

问题:

I've just learned what ASP.NET MVC is and I'm wondering if the pattern is ever used in Windows Desktop application development?

I'm specifically looking at potentially trying to use it in a Desktop .NET application.

Please forgive me if this question is way out in left field in terms of how MVC is suppose to be used. I'm still trying to wrap my head around the details of it.

回答1:

MVC comes in many flavors, Marting Fowler discusses at http://martinfowler.com/eaaDev/uiArchs.html

Google returns quite a lot of interesting stuff for windows forms mvc also



回答2:

The Model-View-Controller Pattern works like a dream with "desktop" apps, as you don't have to worry about handling state information.



回答3:

Most definitely. Here is a list of MVC GUI frameworks.



回答4:

I don't rememer where I see a good example of MVC for descktop apps.
It was about a thermometer.
The model was the thermometer it self. A simple POJO with the current state of temperature.
The apps have several views and controllers of the thermometer.
The controllers calls the setters, and the views calls the getters.
To synch the app use the Observer pattern. The views subscribe to the model.
And the model notify all the views subscribed in each setter.

It was a very useful example for understand MVC.



回答5:

For others whom might be interested:

http://dotnetslackers.com/articles/aspnet/BuildingModelViewPresenterAapplicationsWithMVCFramework.aspx

http://www.mvcsharp.org/Getting_started_with_MVCSharp/Default.aspx