MEF OSGi 是否适用于 .NET?
我只是想了解 托管扩展性框架 (MEF)目前正在深入研究。 我有 Eclipse 背景,所以我脑子里目前有这样的方程:
MEF =~ OSGi for .NET
基于我到目前为止所听到的。 我的做法正确吗?
I'm just trying to get my head around the Managed Extensibility Framework (MEF) at the moment and digging into a bit. I have an Eclipse background so in my brain I currently have the equation:
MEF =~ OSGi for .NET
Based on what I have heard so far. Am I on the right lines?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Scott Hanselman 在他与 Glenn Block 的播客 148 中帮助强调了有关 MEF 的细节。
与 OSGi 相比,MEF 构建于“控制反转”之上,而 OSGi 则不然:它 (OSGi )将通过基于生命周期层的不同机制发现新的捆绑包。
由于最后一点可能会令人困惑,播客的转录可以提供帮助:
结论:(之一)主要区别是发现原理(IoC 与生命周期)
Scott Hanselman helped to highlights the specifics about MEF in his podcast 148 with Glenn Block.
Compared to OSGi, MEF is built upon "Inversion of Control" and OSGi is not: it (OSGi) will discover new bundle through a different mechanism based on a Life Cycle Layer.
Since the last point can be confusing, the transcripts of the podcast can help:
Conclusion: (one of) the main difference is the discovery principle (IoC vs. lifecycle)
请注意,OSGi 的设计使得 IoC 容器可以作为模块在其之上提供,实际上,OSGi 有多个可用的 IoC 容器以及其他机制:DS、iPOJO、Blueprint 以及毫无疑问的其他机制。
Notice that OSGi is designed so that an IoC container can be provided on top of it as a module, actually, there are multiple IoC containers for OSGi available as well as other mechanisms: DS, iPOJO, Blueprint, and undoubtedly others.
只是偶然发现了这一点,但 Prism 似乎是最接近 OSGi 的东西在.NET中我见过! 查看他们的模块化应用程序开发部分在文档中。
只需看看他们的模块依赖关系示例(几乎相当于捆绑包!):
在 Microsoft,Patterns & 似乎已经结束了。 实践团队相当于 OSGi 联盟。
Just stumbled upon this, but Prism seems to be the closest thing to OSGi in .NET I've seen! Look at their Modular Application Development section in the docs.
Just look at their example of the module dependencies (almost equivalent to bundles!):
It seems like over at Microsoft, the Patterns & Practices team serves as a kind-of OSGi Alliance equivalent.