Backbone.js 和 WPF 之间的知识重叠程度如何?
这似乎是一个非常奇怪的问题,但我一直在学习 Backbone.js 的工作原理,最近有人问我有关在工作中创建 WPF 项目的问题。
对于使用过这两种框架的人来说,了解 Backbone.js 框架对于开始开发 WPF 应用程序是否有帮助?
例如,您在 Backbone 中创建视图来管理 html 页面中的数据和模板的呈现。
如果您从 WPF 具有管理 XAML 文件的 ViewModel 的方式来看待这一点,您会说某些技能是可以转让的吗?如果是这样,当我在 WPF 中工作时,Backbone.js 工作方式的哪些方面会立即显现出来?
我意识到 WPF 是一种使用 MVVM 的 MS 专有技术,而 Backbone 是一个使用修改后的 MVC 模式的开源 JS 框架。我只是想看看是否可以将我已经知道的内容转移到 WPF 上。
谢谢。
This may seem like a really off-the-wall question, but I've been learning how Backbone.js works and I've recently been asked about creating a WPF project at work.
For those of you who have worked with both, would knowledge of the Backbone.js framework be beneficial for starting on a WPF application?
For instance, you create Views in Backbone that manage the data and rendering of templates in the html page.
If you look at this in terms of the way WPF has a ViewModel that manages the XAML files, would you say that certain skills would be tranferable? If so, what aspects of the way that Backbone.js works would be immediately apparent when I'm working in WPF?
I realize that WPF is a proprietary MS technology that uses MVVM and Backbone is an open-source JS framework that uses a modified MVC pattern. I'm just trying to see if I can transfer what I already know onto WPF.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过 IMO 的转账很少。两者都有声明性标记(HTML 与 XAML),并且都有命令式编程语言(JS/CoffeeScript 与 C#/VB.Net)。除此之外,范式非常不同。
为了接近,您可以查看 RestSharp 来管理您的模型/REST 服务。 WPF 中的 ViewModel 和 Backbone.js 中的视图很相似,但不太相似。 ViewModel 是模型的视图或视图的模型,但它们往往不包含特定于视图的代码。代码背后可能。有时感觉 Backbone.js 视图与 WPF ViewModel 和隐藏代码类似。
您还可以查看 Magellen 了解 WPF 中的路由和 MVC 功能,这些功能与中发生的路由有一些相似之处骨干.js。
XAML 中的标记与 HTML 中的标记显着不同。您拥有一个成熟的组件模型,它比 Backbone.js 的功能要强大得多,但这只是 HTML 的限制,而不是 Backbone 的限制。此外,XAML 在标记中内置了双向数据绑定(而不是在 Backbone 的视图中进行)。标记还具有可用的状态管理和转换,在 Backbone 中工作时通常在 jQuery 中处理。
哦,是的,WPF 中没有 jQuery,但这可能是显而易见的。
您从 Backbone 获得的代码组织技能可能会得到很好的转化。您对关注点分离 (SOC) 和单一责任的深刻理解也可能在开发 WPF 应用程序时有所帮助。
祝你好运!
Very little transfers over IMO. Both have a declarative markup (HTML vs XAML) and both have an imperative programming language (JS/CoffeeScript vs C#/VB.Net). Other than that, the paradigms are very different.
To get close, you might look at RestSharp to manage your models/REST services. ViewModels in WPF and Views in Backbone.js are analogous but not very similar. ViewModels are views of the model or models of the view, but they don't tend to contain view-specific code. Code behind might. Sometimes it feels like Backbone.js views are similar to WPF ViewModels AND code behind.
You might also look at Magellen for routing and MVC capabilities in WPF that have some similarities to the routing that happens in Backbone.js.
The markup in XAML is significantly different than in HTML. You have a full-blown component model which is significantly more capable than Backbone.js but this is just a limitation of HTML and not so much Backbone. Further, XAML has two-way data binding built into the markup (as opposed to doing it in the views in Backbone). The markup also has state management and transitions available to you which is often handled in jQuery when working in Backbone.
Oh yeah, there is no jQuery in WPF, but that is probably obvious.
Your code organization skills from Backbone are likely to translate well. Your strong understanding of separation of concerns (SOC) and single responsibility are also likely to help when developing WPF apps.
Good luck!