集成 ASP.NET MVC 和 MVVM 的应用程序框架

发布于 2024-12-27 23:13:20 字数 289 浏览 4 评论 0原文

我们有一个 WPF 应用程序。计划在未来扩展此应用程序并将某些功能移植到网络上。

我知道我应该为 WPF 使用 MVVM 设计模式。我想将 ASP.NET MVC 用于 Web 应用程序。我的问题是,是否有一个应用程序框架可以将这两者集成在一起,并使并行开发 WPF 和 ASP.NET 应用程序变得更容易。

目标是尽量减少代码重复。

我现在正在查看 CSLA.NET。它声称支持 ASP.NET MVC 和 MVVM 应用程序。在我完全评估之前,我不确定有多少支持。

谢谢,

纳吉特

We have a WPF application. There are plans to extend this application in the future as well as port some of the functionality to the web.

I know that I should be using the MVVM design pattern for WPF. I would like to use ASP.NET MVC for the web application. My question is, is there an application framework that sort of integrates these 2 and makes it easier to develop WPF and ASP.NET apps side by side.

The goal is minimal code duplication.

I am looking at CSLA.NET right now. It claims support for ASP.NET MVC and MVVM apps. I am not sure how much support there is until I fully evaluate it.

Thanks,

Nachiket

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人事已非 2025-01-03 23:13:20

这根本不可能,因为 MVC 和 MVVM “完全”不同。您应该做的就是将尽可能多的代码放入服务中。这些服务可以重复使用,您只需编写服务的用法(可以是控制器或视图模型)。然后,您将大部分逻辑保留在服务中,可以通过 IoC 容器(或服务定位器)检索这些逻辑。

It is simply not possible because MVC and MVVM are "completely" different. What you should do is put as much code into services as possible. These services can be re-used where you only have to write the usage of the service (this can be the controller or the view model). Then you keep most of the logic in the services which can be retrieved via an IoC container (or service locator).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文