Silverlight 的各种 MVVM 框架的优缺点是什么? [英] What are the strengths and weaknesses of various MVVM frameworks for Silverlight?

查看:43
本文介绍了Silverlight 的各种 MVVM 框架的优缺点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Silverlight 的各种 MVVM 框架的优缺点是什么?

What are the strengths and weaknesses of various MVVM frameworks for Silverlight?

我知道以前有人问过类似的问题,但该领域发展迅速,给出的答案很快就过时了.

I know similar questions have been asked before, but the field is moving quickly and the answers given are rapidly out of date.

我特别想对以下框架进行简要评估 -

I'm specifically looking for a brief assessment of the following frameworks -

  • 棱镜
  • 口径
  • 收紧
  • 金光
  • MFedMVVM
  • MVVM 灯
  • nRoute
  • 结构化 MVVM

...加上任何其他人都知道的.

...plus any others that anyone is aware of.

推荐答案

任何框架的缺点都是一样的:它是别人的代码,它是别人对模式的实现.您正在将解决方案的控制权交给其他人的代码.如果你对此感到满意,无论如何,就去做吧.

The disadvantage of any framework is the same: It's someone else's code and it's someone else's implementation of the pattern. You're ceding control of the solution to someone else's code. If you're comfortable with that, by all means, go for it.

但是 MVVM 是一个非常容易掌握的模式.实现它实际上非常简单.WPF 和 Silverlight 已经包含了使绑定工作所需的大多数核心组件,从而使 MVVM 工作.

But MVVM is a really simple pattern to grasp. Implementing it is actually pretty trivial; WPF and Silverlight have baked in most of the core components you need to make binding work, and thus make MVVM work.

我发现我真正需要做的 MVVM 是一个用于跨类消息传递的事件聚合器、一个用于处理重复编码 INotifyPropertyChanged 的​​基本视图模型类,以及一个用于连接我的依赖项的 IoC 容器.就是这样.

I've found that all I really need to do MVVM is an event aggregator for messaging across classes, a base view model class to handle the repetition of coding INotifyPropertyChanged, and then an IoC container for wiring up my dependencies. That's about it.

在体验了组件应用程序 UI 块之后,我倾向于回避任何其他人的框架".特别是如果我可以在短时间内自己编写核心位.

After my experience with the Component Application UI Block, I tend to shy away from anyone else's "framework". Especially if I can write the core bits myself in short order.

在我目前的工作中,我们对我们的项目进行了 MVVM,而我的基础设施实际上就是我上面所说的几个类和接口.

We do MVVM on our projects at my current job and my infrastructure is literally a couple of classes and interface for just what I stated above.

这篇关于Silverlight 的各种 MVVM 框架的优缺点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆