MVC.NET for the desktop

后端 未结 4 1647
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 06:25

Is there any reason that MVC isn\'t equally useful for desktop apps as for web apps?

What would be required to make an ASP.NET MVC directory tree implementable as a de

4条回答
  •  一个人的身影
    2021-02-09 06:56

    There is nothing stopping you from using the MVC pattern in a desktop app. In fact, it has been used on the desktop since before there was a web.

    See Wikipedia for some examples

    MVC just stands for "Model View Controller" which describes the way that concerns are separated from each other using the MVC pattern.

    As far as using ASP.NET MVC on the desktop, there are a few problems. For one thing, it relies on HTTP requests and responses. You would need a server layer as part of your application architecture to listen for requests and send responses. Second, ASP.NET MVC views are really just simple HTML text files meant to be interpreted by a web browswer. So, you would need an HTML rendering component as a GUI front-end. You would likely want a CSS rendering engine and a JavaScript interpreter as well.

    Basically, all you would be doing is running a dedicated browser as the front-end and a local web server as the back end.

    There is really not much need since there are many great MVC frameworks already. There are also closely related patterns like MVP (Model View Presenter) and MVVM (Model-View-View Model). For example, many WPF (Windows Presentation Framework) apps are MVVM.

提交回复
热议问题