English 中文(简体)
网上执行金字节
原标题:Interface for plugins to implement in .Net

我想在我的蚊帐应用中安装一个插头系统,而不用使用微型信贷。

我的申请负荷,并举出一些类型的例子,这些实例载于《土地法》。

有一个接口(IPluginContract),即主要应用组使用重荷型,而这种接口则由批量项目(插头)使用。

因此,不同的项目需要进入同一个接口。

我可以通过将接口班推向单独的级图书馆来达到这一要求,即主要仪器和插盘都将参考。

解决上述问题是否正确?

最佳回答

Yes, pushing your interfaces out into a shared library is a preferred solution. You then only need to distribute this library to plugin developers, which could be considered as lightweight, but the plugin will be coupled to an exact version of the interface.

另一种解决办法是基于公约的解决办法,即原始作者有“符合”接口的类型,例如,他们可以通过汇票证明的类别有适当的方法。 然后,你可以利用思考、IL的生成等,把这一连接到具体的内部接口。 这里的好处是,金刚石不会被混入特定的接口版本,因此在版本上更具灵活性。

您还可以考虑通过保持所有版本的接口,例如IPlugin_1、IPlugin_2等。 然后,它要让一些原始作者执行哪一种版本,并能够处理每种版本。

问题回答

我们根据当时的情况(市场、执行困难、内部接触关切等)成功地采取了两种不同的办法处理这一问题:

(1) 将接口输入自己的DLL。 如果gin子不需要你主要应用DLL的其他任何支持目标/功能/数据,或者如果你不想把主编DLL中的公众成员暴露在原始作者身上,那么这项工作就好了。

2) 离开主要DL的接口。 我们主要利用了这一因素,即当调整成本以转移接口和相关课程时,或者当gin果完全自足时(即我们为客户撰写)。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签