MEF 与 Mono.AddIn

发布于 2024-08-09 03:03:24 字数 155 浏览 3 评论 0原文

我正在开发 .NET 3.5 C# 桌面应用程序。它应该可以通过插件进行扩展。

是否有任何文章等讨论 MEF 和 Mono.AddIn 之间的差异来帮助我做出明智的决定?

或者更好的是您有这两个框架的经验并且可以对它们发表评论吗?

谢谢, 帕特里克

I'm developing a .NET 3.5 C# desktop application. It should be extensible via plug-ins.

Are there any articles etc. discussing the differences between MEF and Mono.AddIn to help me make an informed decision?

Or even better have you got experience with both of these frameworks and can comment on them?

Thanks,
Patrick

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

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

发布评论

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

评论(3

一抹微笑 2024-08-16 03:03:24

[注:我从事 MonoDevelop,它使用 Mono.Addins,但上周我与 MEF 团队的 Glenn Block 广泛讨论了 MEF 和 Mono.Addins 之间的差异]

MEF 基于编写代码,尽管底层抽象非常灵活。相比之下,Mono.Addins 基于元数据树,您可以将数据/元数据/代码插入到定义的丰富架构中,因此扩展可以添加数据/元数据以及代码。

Mono.Addins 为您提供了一个开箱即用的插件管理/打包/存储库/更新系统。对于 MEF,此时,您必须构建自己的。

MEF 的进入门槛稍低,并且在其可用性和底层抽象方面进行了大量的设计工作。此外,它是 .NET 4 的一部分,因此它将拥有更大的使用它/为其开发的用户社区。

此时,如果您需要插入数据/元数据以及代码,并且您想要一个现成的打包系统,我会推荐 Mono.Addins,否则我会推荐 MEF。展望未来,Mono.Addins 的功能很可能会在 MEF 上实现,因此可能会有一条向 MEF 的迁移路径。

[NOTE: I work on MonoDevelop, which uses Mono.Addins, but I discussed the differences between MEF and Mono.Addins extensively with Glenn Block from the MEF team last week]

MEF is based on composing code, though the underlying abstractions are very flexible. In contrast, Mono.Addins is based on a tree of metadata, where you can plug data/metadata/code into a rich schema of your definition, so extensions can add data/metadata as well as code.

Mono.Addins gives you an addin management/packaging/repository/update system out-of-the box. For MEF, at this point, you would have to build your own.

MEF has a slightly lower barrier to entry, and a lot more design work has gone into its usability and underlying abstractions. In addition, it's part of .NET 4, so it'll have a much bigger community of users developing with/for it.

At this point, if you need to plug in data/metadata as well as code and you want a ready-made packaging system, I'd recommend Mono.Addins, otherwise I'd recommend MEF. Going forwards, it's likely that Mono.Addins' features will be implemented on MEF, so there will probably be a migration path towards MEF.

手长情犹 2024-08-16 03:03:24

我相信 Hanselmillions Show #181 有一些关于 Mono.AddIns 及其含义的讨论带到桌面上。

在搜索网络时,我还发现此讨论,它强调了以下方面的差异这两个框架当前如何处理目录缓存。

I believe Hanselminutes Show #181 has some discussion about Mono.AddIns and what it brings to the table.

While scouring the web I also found this discussion which highlights a difference in how these two frameworks currently handle catalog caching.

扎心 2024-08-16 03:03:24

我对两者进行了研究,并决定使用 MEF,主要是因为它将作为 .NET 4 的一部分发布,因此将自动有更多围绕它的支持、讨论和开发。另外,MEF 似乎能够在代码中使用属性来完成我需要的所有操作,如果我没记错的话,Mono.AddIns 需要一些元数据文件。

编辑:如果您想查看我使用 MEF 构建可扩展应用程序框架的努力结果,我已将其开源,并为其命名:SoapBox 核心

I investigated both and decided to go with MEF, mostly because it's going to be released as part of .NET 4 so there will automatically be more support, discussion, and development surrounding it. Also, MEF seemed to be able to do everything I needed using attributes right in the code, and Mono.AddIns required some metadata files, if I remember correctly.

EDIT: If you'd like to see the result of my efforts at using MEF to build an extensible application framework, I've open sourced it, and given it a name: SoapBox Core.

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