问题描述
我有点出过期的WPF,现在,很想听听人民的棱镜(我用的版本前)的最新版本VS的MVVM光+统一办法的意见(我从未做过 - 体面的例子网址将是一件好事)
I am a little out-of-date in WPF right now and would be interested to hear peoples opinions on the latest version of Prism (which I used a couple of versions ago) vs an MVVM Light + Unity approach (which I have never done - decent examples URLs would be good).
我的项目将是一个大的,包括写由几个开发商多个模块。也有基金带来的第三方控制套件,以建立使用花哨的对接/工作区布局管理器在那里的一个很好的工作空间(我知道有的玩的棱镜地区比别人更好)。
My project will be a large one comprising multiple modules written by several developers. There is also the funds to bring in a 3rd party control suite in order to set up a nice workspace using one of the fancy Docking/Workspace layout managers out there (and I know some play better with the Prism regions than others).
如果你是从头开始的一个项目,现在,你会去,为什么?关于具体建议的体系结构模式的细节将是有益的(如:自动发现模块的DLL?注射记录服务?)。基本上,任何想法和建议将是一件好事。我想获得一个良好的讨论继续下去。也许还有另外一个方向完全,你会建议去吗?我非常多,在研究阶段,并希望尽可能多的输入地。
If you were starting a project from scratch right now, what would you go with and why?Details on specific recommended architecture patterns would be useful (e.g. auto discovery of module dlls? Injecting logging service?).Basically, any thoughts and advice would be good. I'd like to get a good discussion going. Perhaps there is another direction entirely that you would suggest going in? I'm very much in the research phase and would like as much input as possible.
我把这个放在这里,因为我认为它会得到的观点比棱镜/ MVVM光论坛更少偏见点,但如果有更合适的地方了这个问题,请点我这个方向努力。
I put this on here because I thought it would get less biased points of view than the Prism/MVVM Light forums but, if there is a more suitable place for this question, please point me in that direction.
推荐答案
如果你需要的模块,你会想看看棱镜。棱镜具有的部分的元素,可以帮助您MVVM(DelegateCommand和CompositeCommand,例如),但我认为这是更完整的另一个MVVM框架。
If you need modularity, you'd want to look at Prism. Prism has some elements that can help you with MVVM (DelegateCommand and CompositeCommand, for example), but I think it's more complete with another MVVM framework.
有一个关于如何塑造棱镜的问题,前几天。检查出来怎么考虑棱镜的功能的详细说明。High级建模忠告棱镜MVVM
There was a question a few days ago about how to model Prism. Check that out for a detailed explanation of how to consider Prism's functionality.High Level Modelling Advice for Prism MVVM
团结就是控制容器的倒置的实现,这绝对是不错的,但棱有使用其他容器的能力。它有MEF(其中,反过来,被内置到.NET 4.0)内置的支持,但它不是唯一的选择。看一些包括在棱镜的样品,并决定什么办法,你更喜欢。团结是不完整的自己在我看来UI合成。 MEF可能是一个更近的选择,如果你想尝试合成一个与MVVM框架+ IoC框架的方法UI。
Unity is an implementation of an inversion of control container and it's definitely good, but Prism has the ability to use other containers. It has builtin support for MEF (which, in turn, is builtin to .NET 4.0), but it's not your only choice. Look at some of the samples included in Prism and decide what approach you like better. Unity is not complete on its own for UI compositing in my opinion. MEF might be a closer choice if you wanted to try to composite a UI with the MVVM Framework + IoC Framework approach.
MVVM光其实是一个免费的框架棱镜。其他MVVM框架来考虑:
MVVM Light is actually a complimentary framework to Prism. Other MVVM frameworks to consider:
- 在MVVM基金会(非常轻巧...好小项目)
- 在卡利(非常健壮的框架)
- 在卡利科技(股的姓名和卡利作家,但它类似于MVVM光与一些很好的约定)
- ReactiveUI (原名ReactiveXAML,这是一个有点脑子熔炉,但如果你了解无扩展的.NET(RX),这个框架简直太神奇了......神奇的在我看来。)
- MVVM Foundation (very lightweight... good for small projects)
- Caliburn (very robust framework)
- Caliburn Micro (shares a name and an author from Caliburn, but it's akin to MVVM Light with some nice conventions)
- ReactiveUI (Formerly "ReactiveXAML". This is a bit of a brain melter, but if you learn Reactive Extensions for .NET (Rx), this framework is simply amazing... magical in my opinion.)
如果我将要开始一个新项目:我会去棱镜和ReactiveUI。
If I were going to start a new project: I would go with Prism and ReactiveUI.
棱镜,因为你必须有模块化的大型项目,我要删除,只是通过删除或添加的DLL添加功能的大单位,一个应用程序的能力(和你没有实现像你这样的DLL嗅探功能将只有一个IoC + MVVM的做法)。更容易测试,更容易调试,更容易分开发展。尼斯各地。
Prism because you have to have modularity with large projects and I like the ability to remove and add large units of functionality to an app just by deleting or adding DLLs (and you don't have to implement the DLL sniffing feature like you would with just an IoC + MVVM approach). Easier to test, easier to debug, easier to develop separately. Nice all around.
ReactiveUI因为与用户界面编程这些天,你的大部分时间都花在了UI线程上管理你的时间。封锁是一个没有没有......用户不希望看到一个UI冻结;他们希望看到的动画GIF等符号旋转,让他们知道他们可以在别的工作,而你的数据加载。此外,这么多价值的应用提供这些天正在从不同系统的数据,并把它们放在一起在UI ......您不仅需要一个好的合成系统(棱镜),但你也将需要一个良好的MVVM框架即把异步操作作为它的面包和奶油... ReactiveUI就是它了。
ReactiveUI because with UI programming these days, most of your time is spent managing your time on the UI thread. Blocking is a no-no... users don't want to see a UI freeze; they want to see that animated GIF wait symbol spinning so they know they can work on something else while your data is loading. In addition, so much of the value applications provide these days is taking data from disparate systems and putting them together in the UI... not only will you need a good compositing system (Prism), but you will also need a good MVVM framework that treats asynchronous operations as its bread and butter... ReactiveUI is it.
这篇关于MVVM灯+统一或棱镜?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!