Questions tagged [bpl]

Borland Package Library - special kind of object-oriented DLL with enforced type-safety

Delphi is component-based IDE for its proprietary dialect of Pascal language.
Differing from its competitor Visual Basic, it could "eat its own food" - create those components to extend itself.

Up to 1996 to install them one need to recompile part of IDE, similar to installation in Lazarus/FCL IDE. That resulted in two problems:

  • The more components you install - the heavier IDE becomes, and computers back then had significantly less memory. You could not arrange different components subsets per project.
  • If some component proved cruelly broken and crashed IDE, reconfiguring and rebuilding it without the component becomes less obvious task w/o using IDE.

It also made little help to deploy large programs: one either had to deploy large monolithic EXE which could cause problems in OSes with 16-bit kernel (Windows 9x/ME), or develop traditional Windows DLL sacrificing all type safety and complex types (passing objects and strings on EXE/DLL or DLL/DLL boundary would be extremely fragile, practically impossible for average programmer).

With the release of Delphi 3 in 1997 Borland introduced specific type of DLL, the one with enforced type safety (dependencies are codified at compile-time and checked at load time) and changed one letter: DLL -> DPL - Delphi Package Library.

Next year Borland C++ Builder 1 was released (with built-in Delphi 3.5) and those libraries were renamed again: DPL -> BPL - Borland Package Library.

BPL remains the basement for component-based RAD Studio IDE design up to today.

Drawbacks of BPL:

  • Increases "implementation leakage" problem of Turbo Pascal, source Units of which where introduced before OOP trend. That forces private members and datatypes (worker classes) used be promoted into public unit interface. Later Delphi language designer fixed the problem by introducing partial classes into C#, but in Delphi this feature is missing. Since BPL publishes all interface sections of all the contained units, even internal "worker" units, there is no way to make stable contained API and spaghetti dependencies may easily happen unnoticed.
  • Since every unit is public by definition - and since BPL may be re-used by other apps - the Smart Linker is defeated. If you only need 1% of the library - you either re-work it or you deploy the whole library with 99% of slab. In monolithic EXE mode compiler would record XRefs and the Smart Linker would eliminate unused 99% of the library.
  • This also means you can not have several unit with the same name, like you can with DLLs. It is not big issue but may be inconvenient.
  • This also means that if you re-work some class like adding new internal method (virtual or not) - the class signature changes and all the depending BPLs have to be re-compiled and re-deployed. It is especialyl annoying when you need some fix in stock RTL
  • If you change compiler options or version, this change affects internal classes/functions ABI and all dependent packages should be re-build and re-deployed.
101 questions
3
votes
6 answers

Loading a Delphi Object Run Time using BPL

I have a class in a unit. Usually, when I changed the algorithm of its methods, I have to recompile it and deliver the patch as a whole. I think to create the instance of the class using DLL. After searching in delphi.about.com, I found that instead…
WishKnew
  • 649
  • 2
  • 10
  • 22
3
votes
1 answer

tool to show bpl entry points?

Trying to see why we're getting "entry point not found" when I know it should be in there. Aside from the map, is there a tool that'll "explore" a .bpl or .dll and show the entry points?
Chris Thornton
  • 15,620
  • 5
  • 37
  • 62
3
votes
1 answer

Delphi - .bpl plugins for application - problem while loading > 1 plugin

I'm using TJvPluginManager to build simple application with ability to load .bpl plugins. I have common interfaces declaration in "uIntfs.pas" file, which is kind of SDK ;) The problem is, that if I try to load more than one plugin, the app throws…
michal
3
votes
0 answers

How to obtain Components Name from a bpl on my standalone app

Classes.GetPackageInfo can enumerate all the units and required packages for a package. But I want a Proc like : procedure GetPackageComponents(ModuleName: PChar; ComponentsList: TStrings); which will obtain all IDE-Components from a Designtime…
explorer
  • 56
  • 5
2
votes
5 answers

Getting BPL Versions at program startup

Is it possible to check what version of BPL (ie Rtl70.BPL, Indy70.bpl etc) are installed on a clients computer when the program starts? I have had some programs crash because the BPL on there computer is different to the ones on the build…
Christopher Chase
  • 2,840
  • 6
  • 36
  • 57
2
votes
3 answers

Distributing a design-time package w/third-party UI elements

Now that I am learning more about design time aspects of component development, I have what may turn out to be a couple of IDE "plugins" targeting Delphi 2007 (+ others if compatible). The forms / UI for these, ideally, will utilize some of the…
Jamo
  • 3,238
  • 6
  • 40
  • 66
2
votes
3 answers

Component is specific class - does not work in BPL structure

I am upgrading Delphi software from Delphi 6 (2001) to Delphi 11 Alexandria. This software consists of many BPL's, but this code is not working properly. The is command is not returning True, when checking if the component from a BPL is an TIBQuery…
davepaul12
  • 391
  • 4
  • 15
2
votes
1 answer

Is there a way to avoid linking DCUs to a BPL?

We are using packages to split our code base into smaller pieces, but always deploy as a single monolitic executable. When compiling the packages the units in a package project are linked together into .dcp and .bpl files and finally they are linked…
Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113
2
votes
0 answers

What is the scope of BPL dependencies

I got three BPL : A, B and C. A includes B and B includes C. They are all compiled and working correctly. If I do some changes on C (add/delete attributes and methods) Should I recompile : C, B then A or just C then B to make it works…
cz3ch
  • 409
  • 2
  • 11
2
votes
2 answers

How do I make my program use less memory when built with runtime packages?

I always compile my delphi apps without 'build with runtime packages', but for my latest Project i had to use it (as it started swelling day by day ) . I use some third party VCL (TMS component pack with source code , source code directory is in…
Vibeeshan Mahadeva
  • 7,147
  • 8
  • 52
  • 102
2
votes
1 answer

Dynamically loading BPL fails in LoadLibrary

I would like to load BPL modules dynamically in Delphi 10 Seattle (Update 1) or Delphi 10.1 Berlin project (Enterprise version). But LoadPackage function fails with message (on both 32 and 64 bit target platforms): Project LoadPackageTest.exe…
roumen
  • 563
  • 6
  • 15
2
votes
1 answer

C++ builder package export link error

I create a *.bpl project BPL_A which contain a TForm subclass, say TForm_Sub. The header file Form_Sub.h is like following: class PACKAGE TForm_Sub : public TForm { ... }; extern PACKAGE TForm_Sub* Form_Sub; The source file Form_Sub.cpp is…
odomchen
  • 45
  • 7
2
votes
1 answer

Converted app to BPL and now app dies before Application.Initialize

I have a VCL Forms app that includes a reference to a BPL file that I created. I added the unit name of a frame component from the BPL to the uses clause of the main window of the VCL app. The app builds fine, but when I run it, it dies before…
jspence
  • 21
  • 2
2
votes
3 answers

Can We use dcu (Delphi compiled unit) at runtime?

Can we use dcu an runtime like dll? For example, show form that compiled in dcu file. I have the question because i want to develop plugginable application. As Delphi programmer, as far as i know, i just have two options to do this, dll based or bpl…
2
votes
1 answer

Build project package C++ Builder

I have written a GUI forms application in C++ Builder and am wanting to be able to run the .exe on another computer. I am getting some .bpl errors when trying to run the .exe on another computer. How can I combine all the required files into a…
user1690531
  • 231
  • 1
  • 6
  • 17