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

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

问题描述

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

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. 我必须将所有通用接口单元放在单独的包中,以便在加载插件时不会抛出有关包含通用单元的其他包的任何错误

  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

如果一个插件开发者决定使用一些众所周知的单元(比如突触),默认情况下它没有运行时包,而第二个插件开发者也这样做,那么 bump...这里崩溃了...

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 ...

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

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

提前致谢

推荐答案

BPL 的另一个缺点.当您切换 Delphi 版本时,您将不得不重新分发新插件.在多次尝试寻找完美的插件系统之后,我最终选择了 COM,并且我从未后悔过这个决定.在一个已经有 8 年以上插件需求的商业应用程序中,该应用程序不断向前发展,但第一次迭代发布的一些插件仍然以其原始形式存在.

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天全站免登陆