什么是托管可扩展性框架 (MEF)?

发布于 2024-08-22 04:07:05 字数 154 浏览 1 评论 0原文

我用 google 搜索了一下,只得到了几篇关于 MEF 的文章。有人可以简单解释一下:

  • 什么是管理可扩展性框架?
  • 需要它的目的是什么?
  • 我怎样才能开始使用它?

任何一步一步的指导都会有所帮助,谢谢!

I googled and got only a few articles about MEF. Would someone please explain in brief:

  • What is the Manage Extensibility Framework?
  • For what purpose is it needed?
  • How can I start working with it?

Any step by step guidance will be helpful, thanks!

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

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

发布评论

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

评论(1

冷情妓 2024-08-29 04:07:05

MEF 允许您设计可扩展的系统。

根据我的经验,您可以设计接口,创建具有这些接口实现的库,并在运行时动态加载它们。您还可以确定应如何加载这些扩展 - 在同一应用程序域中或在新应用程序域中等。您可以将其指向一个目录并告诉它获取某个接口的所有实现,并加载这些实现以在您的应用程序中使用。

因此,因为您的应用程序不需要预先了解其所有功能,并且可以动态加载它们,你可以说它是“可扩展的”。

或者,还有 MAF、托管加载项框架或 .NET 中的 System.AddIn 命名空间。这有一些重叠,但更针对插件或插件模型。它具有管理版本控制以及处理具有不同接口版本的主机和加载项之间的向后兼容性的功能。

要开始使用 MEF,我认为最好的地方可能是这里: http://www.codeplex.com/MEF
那里有很多关于入门、文档、甚至论坛的信息......

MEF allows you to design a system that can be extended.

In my experience, you can design interfaces, create libraries that have implementations of those interfaces, and load them dynamically at runtime.. You can also determine how those extensions should be loaded - in the same application domain, or a new one, etc. You can point it at a directory and tell it to get all of the implementations of a certain interface, and load those to use in your application..

So, because your application doesn't need to know all of its features up front and can load them dynamically, you can say it is "extensible"..

Alternatively, there is also MAF, the Managed Add-in Framework, or the System.AddIn namespace in .NET. This has some overlap, but is more targeted toward an Add-In or Plug-in model. It has features for managing versioning, and handling backward compatibility between hosts and add-ins each with different versions of the interface.

To get started with MEF, I think the best place is probably here : http://www.codeplex.com/MEF
There is a lot of information there on getting started, documentation, and even a forum...

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