Why is ASP.NET MVC limited to ASP?

Duplicate

MVC.NET for the desktop?

I developed some ASP.NET MVC applications and loving the framework. However, one thing that I do not quite understand is why it is limited to web interfaces. It seems that one of the reasons for the separation of the view and the controller is the possibility of multiple viewing to reuse the same controller logic. For example, I should be able to suspend the WPF interface on the same controllers as the web interface. I suspect, however, that I am misunderstanding something fundamental regarding the separation of problems. Is there a reason ASP.NET MVC controllers are limited for use in web applications?

Update: I'm less interested in “is it possible to make MVC on the desktop” - I know that Prism, etc. allow it. However, from a design point of view, one of the “reasons” we want to divide problems into reuse. If we cannot reuse the controllers, it feels like we are repeating ourselves when rewriting identical logic in a WPF application. The answers below clarify this for me, though.

+7
asp.net-mvc wpf
source share
6 answers

I have to say that the MVC model is especially practical in web applications and because the view (html page) is really disabled and is far from the controller and model.

This is not the case in desktop applications, and you will soon miss out on some features to break up the template to make the application more useful.
For example, you cannot use powerful time-bound data binding in WPF, since it violates the MVC pattern.

Good template used in WPF, MV-VM

+6
source share

Model View Controller is a template, ASP.NET MVC is a template applied to ASP.NET web infrastructure. As already mentioned, this bundles URLs in things to make navigation easier and more integral part of what actions are called.

Nevertheless, nothing prevents technically not using components in ASP.NET MVC libraries. Data access levels through LINQ or Entities are available outside of ASP.NET MVC. Similarly, the model itself has countless examples of its implementation for Winforms applications. The same methods can be applied to WPF.

+3
source share

It’s easy to say this, I know, but if you well implement your level of data access and business objects, you can reuse a significant part of your code.

We use ASP.NET MVC. We have a separate project in which there are our business objects and our level of data access. Our "models" in a web project tend to make packaging easier for our business objects.

Our management methods are fairly easy, because between the level of access to data and our business objects, we encapsulated and simplified most of our business logic presented to their consumers.

Once we created our MVC application, we wanted to use some of our data in a WPF application (for the status display screen). We just created a new project, indicated our data access level and data model, and we were away. Really simple, and a lot of code reuse.

+3
source share

I would not say that you misunderstand the division of problems, because your question indicates that you understand this well.

The name "ASP.NET MVC" indicates that Microsoft made a convincing decision to create a more specialized implementation of MVC for w3eb-based applications. This allows them to optimize the design to make it more productive for developers creating web applications and services.

If they created a more general .NET MVC framework, I would expect this to require a much more complex compromise between the needs of web and desktop applications.

Personally, I believe that Microsoft's approach can make it more confusing for less experienced developers who often assume that the implementation of the template is a template.

+2
source share

ASP.NET MVC is an environment for running MVC with ASP.NET; it includes things like URL routing, etc. You can very well program MVC (Model-View-Controller) style with WPF and WinForms.

+1
source share

Here is the previous question , where I tried in a similar way - let's see what we come up with this time.

Another aspect of this question is why is VS so unsuitable for abstract design tools that can be used for both .NET and asp.NET development?

+1
source share

All Articles