MVC.NET for the desktop
Asked Answered
W

4

7

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 desktop app?

Woodard answered 28/11, 2008 at 22:46 Comment(0)
O
3

Prism

Obscure answered 16/10, 2010 at 15:41 Comment(2)
This is actually a MVVM framework. #668281Debauchee
i'll split the difference with you any day :)Obscure
U
1

I've always thought of the term MVC as the same as a n-layer application - so correct me if I'm wrong here folks.

When i develope, I always(unless other instructed) use the following model/structure, also in applications:

GUI(Web, Winform, whatever) -> Business logic -> Data layer -> And also with an underlying "Model"

... Which is a sort of MVC - So yes, it is usefull for desktop apps also. The main advantage with this, is that you can develope web, win and mobile(++) applications based on the same code.

Another thing that could be done, is to create the data/businesslayers as web-services...

I think this aproach would qualify as SOA.

EDIT: As a note, the four levels of applications are created as seperate projects - and then used as adding reference to either the project, or the DLL, or from the GAC(or wherever you like.....) :) Thus, the need for a directory structure is not needed.

Undue answered 28/11, 2008 at 22:55 Comment(0)
S
0

Hmmm... well, your view can be rendered as anything... HTML, XML, etc. So, why not XAML? I wonder if you can get your WPF or Silverlight app to work in the MVC framework this way... that is, not requiring a web server to run.

Sulcus answered 28/11, 2008 at 22:56 Comment(2)
Ohh... Nice points Brian... Genisio... From the word "Genesis" ? ;)Undue
(note to others: at the time the comment was posted - Brian Genisio had "666" points ;)Undue
D
0

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.

Debauchee answered 16/10, 2010 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.