如何使我的应用程序支持插件?

时间:2022-09-01 14:27:27

I'm work in an aplication that need be capable of support plugins, but i dont know how this work.

我正在使用一个需要能够支持插件的应用程序,但我不知道这是如何工作的。

3 个解决方案

#1


See Design Pattern for implementing plugins in your application?
The answers tend to get very platform specific. It also depends on how much control of your core app data and logic the plugin must have.

请参阅设计模式以在您的应用程序中实现插件?答案往往非常具体。它还取决于您的核心应用程序数据和插件必须具有的逻辑控制程度。

The C++ QT4 book has a good description of adding a file-type plugin to it's architecture, there area also a bunch of modeling apps (openscenegraph, blender, povray ) that have good documentation for their plugin architectures.

C ++ QT4书籍很好地描述了在它的架构中添加文件类型插件,还有一些建模应用程序(openscenegraph,blender,povray),它们的插件架构都有很好的文档。

#2


You need to design your application's API in such a way that plugins can be created, and you need to add the necessary plugin management interfaces and supporting code to invoke the plugins. There is no catch-all way of managing plugins.

您需要以可以创建插件的方式设计应用程序的API,并且需要添加必要的插件管理接口和支持代码来调用插件。管理插件没有全面的方法。

#3


Take a look at the open source application called Rawr (c#). Each addin is a seperate .dll and the main app uses reflection to access the code. Very nicely done.

看一下名为Rawr(c#)的开源应用程序。每个插件都是单独的.dll,主应用程序使用反射来访问代码。做得很好。

www.codeplex.com/Rawr

#1


See Design Pattern for implementing plugins in your application?
The answers tend to get very platform specific. It also depends on how much control of your core app data and logic the plugin must have.

请参阅设计模式以在您的应用程序中实现插件?答案往往非常具体。它还取决于您的核心应用程序数据和插件必须具有的逻辑控制程度。

The C++ QT4 book has a good description of adding a file-type plugin to it's architecture, there area also a bunch of modeling apps (openscenegraph, blender, povray ) that have good documentation for their plugin architectures.

C ++ QT4书籍很好地描述了在它的架构中添加文件类型插件,还有一些建模应用程序(openscenegraph,blender,povray),它们的插件架构都有很好的文档。

#2


You need to design your application's API in such a way that plugins can be created, and you need to add the necessary plugin management interfaces and supporting code to invoke the plugins. There is no catch-all way of managing plugins.

您需要以可以创建插件的方式设计应用程序的API,并且需要添加必要的插件管理接口和支持代码来调用插件。管理插件没有全面的方法。

#3


Take a look at the open source application called Rawr (c#). Each addin is a seperate .dll and the main app uses reflection to access the code. Very nicely done.

看一下名为Rawr(c#)的开源应用程序。每个插件都是单独的.dll,主应用程序使用反射来访问代码。做得很好。

www.codeplex.com/Rawr