棱镜的替代品用于模块化 MVVM 应用程序的 MEF

发布于 2024-10-18 01:28:48 字数 670 浏览 4 评论 0原文

我和我的团队开始计划开发一个模块化应用程序,该应用程序可能会针对 WPF 和 Windows 等多目标。银光。

我个人有一些使用旧版本的 PRISM 来使用 MVVM 模式构建复合 Silverlight 应用程序的经验。当时我们对MEF处理各种模块依赖关系并不熟悉,所以我们没有使用它。

我们没有与任何特定的框架结合,但想使用更大的框架之一。因此,我们开始研究 Caliburn/Caliburn Micro、Prism、MVVM Light 和 Reactive UI。

我读到的关于模块化的大部分内容都建议使用 PRISM 和 MEF 来处理该过程的这一部分。由于我仍在思考其中的一些问题,我不确定我是否错过了一些明显的选择。我可以在 Caliburn Micro 和 MEF

任何人都可以向我指出类似的文章,使用其他一些框架来编写复合应用程序,类似于 PRSIM 使用区域等的方式?理想情况下,我希望限制所需框架的数量,同时提供最大的灵活性。我们并不反对采用“同类最佳”方法,例如使用 MEF/PRISM 来处理合成,使用 MVVM Light 进行视图管理等;但是 1 就可以了,为什么还要用 2?

My team and I are beginning to plan the development of a modular application which will likely multi-target WPF & Silverlight.

I personally have some experience using the older version of PRISM to build a composite Silverlight app using the MVVM pattern. We weren't familiar with MEF at the time for handling the various module dependencies, so we didn't use it.

We aren't married to any particular framework, but want to use one of the bigger players out there. As such we've begun to examine Caliburn/Caliburn Micro, Prism, MVVM Light and Reactive UI.

Most of what I've read for modularity suggests PRISM and MEF to handle that part of the process. As I'm still wrapping my head around some of this, I'm not sure if I'm missing some obvious options. I was able to find this article on Caliburn Micro and MEF.

Can anyone point me to similar articles using some of the other frameworks to compose a composite app similarly to the way PRSIM uses Regions, etc? Ideally, I'd like to limit the number of frameworks needed while providing maximum flexibility. We aren't averse to taking a "best of breed" approach and using for example MEF/PRISM to handle the compositing and MVVM Light for the View management, etc; but why use 2 when 1 will do?

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

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

发布评论

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

评论(1

深府石板幽径 2024-10-25 01:28:48

您可能首先应该做的一件事是将它们隔离到适当的存储桶中。我经常看到人们将 MVVM 框架与应用程序组合框架混合在一起。一旦您将它们放入适当的桶中,您就可以开始从每个类别中选择一个框架,并将它们组合成您认为最好的场景。

应用程序组合

  • Prism(使用任何 IoC 容器:MEF、Unity、Ninject、Autofac 等。Prism 有一些功能可以使 MVVM 变得更容易,但我不会将其称为功能齐全的 MVVM 框架...它主要是一个模块化的应用程序组合框架。)
  • MEF(MEF 实际上能够开箱即用地进行应用程序组合。它经常被认为只是一个 IoC 框架,但它具有欺骗性的强大功能。)

MVVM 框架

  • ReactiveUI(我的最爱)
  • Caliburn
  • Caliburn Micro
  • MVVM Light

我想这会帮助你做出决定。您可以选择您喜欢的应用程序组合技术和您喜欢的 MVVM 框架,然后开始比赛。

至于文章,我的文章并不多。有很多关于使用 Prism 组合应用程序的好文章(这几乎是它的工作),但这里有一篇关于使用 MEF 本身组合应用程序的好文章:

http://blogs.microsoft.co.il/blogs/tomershamam/archive/2009 /08/11/wpf-mef-declarative-composite-ui.aspx

您还应该查看 Glenn Block 在他的博客上的系列“构建 HelloMEF”。我找不到完整的列表(他与他的标签不一致),但这里是“MEF”标签。这里有很多好东西:

http://blogs .msdn.com/b/gblock/archive/tags/mef/default.aspx?PageIndex=1

One thing you should probably do first is isolate these into their appropriate buckets. I see this a lot where people will mix MVVM frameworks with application composition frameworks. Once you have them in the appropriate buckets you can start to pick one framework from each category and combine them into what you consider to be the best scenario.

Application Composition

  • Prism (using any IoC container: MEF, Unity, Ninject, Autofac, etc. There are a few things that make MVVM easier with Prism, but I wouldn't call it a fully featured MVVM framework... it's primarily a modular application composition framwork.)
  • MEF (MEF is actually able to do application composition out of the box. It's often dismissed as just an IoC framework, but it is deceptively powerful.)

MVVM Frameworks

  • ReactiveUI (my favorite)
  • Caliburn
  • Caliburn Micro
  • MVVM Light

This will help you make a decision, I think. You can pick and application composition technology you like and an MVVM framework you like and be off and running to the races.

As for articles, I don't have too many. There are a lot of good articles on application composition with Prism (that's pretty much its job), but here is a good article on application composition with MEF by itself:

http://blogs.microsoft.co.il/blogs/tomershamam/archive/2009/08/11/wpf-mef-declarative-composite-ui.aspx

You should also check out Glenn Block's series "Building HelloMEF" on his blog. I couldn't find a comprehensive list (he wasn't consistent with his tagging), but here is the "MEF" tag. Lots of good stuff here:

http://blogs.msdn.com/b/gblock/archive/tags/mef/default.aspx?PageIndex=1

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