WPF和MVC是同一个概念吗?

发布于 2024-09-06 12:10:37 字数 101 浏览 4 评论 0 原文

我对这两个概念都是新手。

1)我想知道MVC和WPF是相同的概念,但WPF用于桌面,而其他用于WEB?

2)如果我学习其中一项,学习其他一项会很容易吗?

I am new for both concepts.

1) I want to know that MVC and WPF is same concepts but WPF for desktop while other is for WEB ?

2) Will be easy to learn other one If i learn one of them ?

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

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

发布评论

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

评论(6

抚你发端 2024-09-13 12:10:37

我认为当您谈论“MVC”时,您可能指的是“ASP.NET MVC”技术(基于您问题的标签)。无论如何,这里有几点可以澄清正在发生的事情:

  • ASP.NET MVC 是一种基于 模型-视图-控制器 (MVC) 模式。您可以稍微改变它,但该框架是专门设计用于这种模式的。

  • WPF是一种用于开发Windows应用程序的技术。在编写 WPF 应用程序时,您可以使用各种不同的设计模式,但目前最流行的一种称为 model-view-视图模型(MVVM)。在编写 WPF 应用程序时,您还可以使用 MVC 模式(组件的组织),但这不如更原生的方法那么好。

因此,关于您的问题:

  • 它们不是相同的概念 - 技术不同,两种技术使用的常用模式(组织代码的方式)也不同。

  • 学习一种技术可能会让稍微更容易理解另一种技术,因为它们都是.NET GUI框架并且共享一些概念。不过,我认为这不会有太大帮助。

I think you probably meant "ASP.NET MVC" technology when you were talking about "MVC" (based on the tags of your question). Anyway, here are a few points that may clarify what is going on:

  • ASP.NET MVC is a technology for developing web applications based on the model-view-controller (MVC) pattern. You can twist it a little bit, but the framework is specifically desgined to work with this pattern.

  • WPF is a technology for developing windows applications. You can use various different design patterns when writing WPF applications, but the most popular one these days is called model-view-viewmodel (MVVM). You could also use the MVC pattern (organization of components) when writing WPF applications, but that wouldn't work as nicely as more native approaches.

So, regarding your questions:

  • They are not the same concepts - the technologies are different and the usual patterns (ways of organizing code) used with the two technologies also differ.

  • Learning one technology may make it easier to understand the other one slightly, because they are both .NET GUI frameworks and share some concepts. However, I don't think this will help a lot.

久光 2024-09-13 12:10:37

MVC(模型-视图-控制器)是一种设计模式,并不特定于特定的技术集。

WPF(Windows Presentation Framework)是微软的窗口库,可以在MVC设计的系统中使用。然而,没有什么可以强制执行这一点,而且 MVC 模式的使用肯定会被 WPF 滥用。

MVC 是一种广泛使用的模式,无论使用何种技术集(无论是基于 Web、WPF、Swing 等),熟悉它都会很有用。请注意,MVC 通常与 GUI 相关联,但没有特定的限制,只要模型及其更改需要反映到对该数据具有不同视图的不同消费者,就可以使用该模式。

MVC (model-view-controller) is a design pattern, and is not specific to a particular technology set.

WPF (Windows Presentation Framework) is Microsoft's windowing library, and can be used in an MVC-designed system. However there's nothing to enforce this and MVC pattern usage can certainly be abused with WPF.

MVC is a widely used pattern and familiarity with it is going to be useful regardless of the technology set used (whether it's web-based, WPF, Swing etc.). Note that MVC is usually associated with GUIs, but there's no particular restriction and the pattern can be used wherever a model and its changes need to be reflected to different consumers with different views on that data.

为你鎻心 2024-09-13 12:10:37

不,

WPF 和 Silverlight 比 WPF 和 ASP.NET MVC。 Silverlight 是一个独立的运行时,基本上是 .NET 的子集; Silverlight 对 UI 使用 XAML 标记,它支持子集(以及一些特定于 Web 的)功能来自 WPF 和 .NET。

ASP.NET MVC 是 Microsoft 对 MVC 模式的实现。 MVC 与 WebForms(“经典”ASP.NET Web 开发)的区别在于,MVC 有助于使用最佳实践并为开发人员提供对应用程序输出的高级控制 - WebForms 更 RAD(快速应用程序)开发)驱动,使开始工作变得容易,但将一些关于最佳实践、模式和控制的担忧抛在一边。


至于哪个更容易:MVC 可能会更快上手,但是进行全面的 Web 开发需要一组技术(HTML/CSS/JavaScript/.NET),而 WPF 可以让您更集中所需的知识(XAML/WPF) /。网)。

No,

WPF and Silverlight are much more closely related than WPF and ASP.NET MVC. Silverlight is a seperate runtime and is basically a subset of .NET; Silverlight uses XAML markup for the UI, which supports a subset (and some web-specific) features from WPF and .NET.

ASP.NET MVC is Microsoft's implementation of the MVC pattern. What differentiates MVC from WebForms ("classic" ASP.NET web-development) is that MVC assists in using best-practices and giving the developer a high-level of control of the output of the application--WebForms was more RAD (Rapid Application Development) driven, making it easy to begin to work with--but putting some concerns about best-practes, pattens, and control to the wayside.


As for which is easier: MVC will likely be quicker to start with, but doing full-blown web-development requires a set of technologies (HTML/CSS/JavaScript/.NET) whereas WPF keeps your required knowledge more focused (XAML/WPF/.NET).

一束光,穿透我孤独的魂 2024-09-13 12:10:37

不。MVC 是一种模式,而 WPF 是一种 Microsoft 技术。

您可以通过一些努力在 WPF 中使用 MVC 模式,但现在 WPF 中更流行的是 MVVM。 MVC 本身并不仅限于 Web。

格兹,克里斯。

No. MVC is a pattern while WPF is a Microsoft technology.

You could with some effort likely use the MVC pattern in WPF but more popular in WPF is MVVM nowadays. MVC itself is not restricted to web only.

Grz, Kris.

分開簡單 2024-09-13 12:10:37

2) 学习其他的会很容易如果
我学其中之一?

Shure:它们都可以使用 c# 或 vb 进行编程。它们都可以使用 Visual Studio 进行编程。

但对于任何包含 .NET 技术的技术(Winform、ASP.NET、Silverlight...)也是如此。

2) Will be easy to learn other one If
i learn one of them ?

Shure: They both can be programmed using c# or vb. And they both can be programmed using Visual Studio.

But the same is true for any technology that incorporates .NET technology (Winform, ASP.NET, Silverlight...)

病女 2024-09-13 12:10:37

是的,MVC 不是特定于技术的——它只是一种设计模式。

我在构建物理机器人时使用了这个概念 - 中央控制器以及开关和灯的实际物理“用户界面”。 “模型”可以被认为是来自摄像机和传感器的环境数据的收集。

实际上,您发现模型视图控制器实际上可以是单独的硬件/不同的微控制器。控制器可以使用 i2c 和串行总线等标准协议(接口)相互“对话”。

还设计了 Web 和 WPF 应用程序 - 这就是程序界面真正派上用场的地方。我发现在 WPF 中,视图/控制器/模型实际上是什么之间的界限很容易模糊 - 例如,网格控件本身是模型/视图/控制器的缩影,而网格控件本身就是模型/视图/控制器的一部分。 “视图”,由高层控制器和模型提供支持。

Web 应用程序使“线”在哪里变得更加清晰,但是对于 Blazor 之类的东西,您可以运行服务器端或客户端,并且最终可以让客户端在外部有一个“微控制器/模型/视图”。主要网络应用程序。

观察了这些场景后,我发现 MVC 可能真的是一种分形类型的想法,当你放大时,模式会在越来越小的级别上重复。

Yes, MVC is not technology specific - its just a design pattern.

I have used this concept when building physical robotics - a central controller, and actual physical "user interfaces" of switches and lights. The "model" can be considered as the collection of environmental data from cameras, and sensors.

You actually find the Model view controller can literally be separate pieces of hardware/different micro controllers. The controllers can "talk" to each other using standard protocols (interfaces) like i2c and serial buses.

Having also designed both web and WPF apps -this is where program interfaces really come in handy. I find in WPF though, the line can easily blur between what the view/controller/model actually is - for example, is a grid control in itself a microcosm of a model/view/controller, and that in itself is then part of a "view", powered by a controller and model at the high level.

Web apps make it more clear where the "line" is, but with things like Blazor for example, you can run server side or client side, and can wind up with the client have a "micro controller/model/view" outside of the main web app.

Having observed these scenarios, it occurred to me that MVC might really be a fractal type idea, where as you zoom in, the pattern repeats at smaller and smaller levels.

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