插件式的建筑风格在.NET建筑风格、插件、NET

2023-09-03 08:56:32 作者:你若安好哎哟卧槽

我想要的执行的一个插件,如应用。我知道已经有一些解决方案,在那里,但是这仅仅是将是概念验证,仅此而已。这个想法是使应用程序的主应用程序几乎在默认情况下无特色,然后让插件了解对方,让他们有实现所有需要的功能。

I'm trying to implement a plug-in like application. I know there are already several solution out there but this is just going to be proof of the concept, nothing more. The idea would be to make the application main application almost featureless by default and then let the plugins know about each other, having them have implement all the needed features.

几个问题就出来了:

我想要的插件在运行时彼此相互了解,通过我的申请。这并不意味着,在code时,他们不能引用其他插件的组件,以便他们可以使用它的接口,仅插件,功能初始化应该总是通过我的主要应用程序。例如:如果我有两个插件X和Y加载和Y想要使用X的功能,它应该注册利息虽然我的应用程序中使用的特点。我必须有一种在我的应用程序字典中,我存储所有的加载插件。在我的应用程序注册的利息,插件Y就应该得到一个引用是X,因此可以使用它之后。这是一个很好的方法? 在当前编码任何使用X插件Y,我需要引用X的组件,所以我能抵挡它的接口程序。有版本的问题。如果我code我的插件Ÿ对过时的版本插件的X?我应该总是使用中央的地方,所有的组件都具有存在始终是最新版本的程序集?

是否有偶然什么书在那里,专门处理这些类型的设计为.NET?

Are there by chance any books out there that specifically deal with these kinds of designs for .NET?

感谢

编辑:我认为人们渐行渐远的2个问题我做了。我可以看看两个MEF和#develop,但我希望得到具体答案,我做了问题。

edit: I think people are drifting away from the 2 questions I made. I can take a look at both MEF and #develop, but I'd like to get specifics answers to the questions I made.

推荐答案

查找到 System.AddIn 命名空间。这是一个有点低级别比MEF,所以应该给你的实现它自己你要找的,经验

Look into the System.AddIn namespace. It's a little lower-level than MEF, and so should give you the "implement it myself" experience you're looking for.