插件系统Delphi应用程序 - bpl vs dll? [英] Plugins system for Delphi application - bpl vs dll?

查看:201
本文介绍了插件系统Delphi应用程序 - bpl vs dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写应该具有加载插件功能的delphi应用程序。我正在使用JvPluginManager作为插件系统/管理器;)现在,在新的插件向导中,他们说最好使用.bpl类型的插件,而不是.dll插件...这个解决方案与dll类型插件有什么优势?
到目前为止,我发现只有这个解决方案的缺点:


  1. 我必须把所有常见的接口单元在单独的包中,以便在加载插件的时候,它不会抛出任何关于其他包含公共单元的包


  2. 的错误,如果让我们说一个插件开发人员决定使用一些知名的单位(如突触),默认情况下没有运行时包,第二个插件开发人员做的相同,比 bump ...它在这里崩溃...


那么实际上使用运行时包编译的bpls而不是dll的优点是什么?



提前感谢

解决方案

BPL的另一个缺点。当您切换Delphi版本时,您将不得不重新分发新的插件。在尝试找到完美的插件系统后,我终于找到了COM,我从未对这个决定感到遗憾。在有8年以上插件需求的商业应用中,应用程序不断向前推进,但是第一次迭代发布的一些插件仍然以其ORIGINAL形式存在。



如果您选择这种方法,请自己动手,并从一个简单的界面开始,然后在其上添加新的界面。你不想改变你的基础界面,所以保持简单和甜蜜。


I'm writing delphi app which should have capability of loading plugins. I'm using JvPluginManager as plugin system/manager ;) Now, in the new plugin wizard they say it's better to use .bpl type plugins instead of .dll plugins ... What are the pros of this solution versus dll type plugins? So far I've found only cons of this solution:

  1. I have to put all the common interface units in separate package so that while loading plugins it won't throw any error about the other package containing common unit

  2. if, let's say, one of plugin developers decides to uses some well-known unit (like synapse), which doesn't have runtime package by default, and the second plugin developer does the same, than bump... it's crash here ...

So, what are actually the pros of using bpls instead of dlls compiled with runtime packages?

Thanks in advance

解决方案

Another disadvantage to BPL's. When you switch Delphi versions you will have to re-distribute new plugins. After many attempts at attempting to find the perfect plugin system, I ended up with COM and I have never regretted that decision. In a commercial application which has had the plugin requirement for over 8 years, the application has continued to move forward and yet some of the plugins that were released with the first iteration still exist in their ORIGINAL form.

If you choose this method, do yourself a favor and start with a simple interface and then add new interfaces upon it. You don't want to ever change your base interface, so keep it simple and sweet.

这篇关于插件系统Delphi应用程序 - bpl vs dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆