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
1
vote
1 answer

Can I make the `requires` clause in a package conditional?

I'm using Anders Melander's DragDrop package. It works fine in Win32 mode, but needs adjustment for 64 bit. I do this by adding {$IFNDEF CPUX64} to comment out the references to the designIDE. However when I change the package source…
Johan
  • 74,508
  • 24
  • 191
  • 319
1
vote
2 answers

Catch missing runtime packages exception error

I deploying an application built with runtime packages. Is there any way to catch the error exception for missing packages files? I would like to change the text and display some more system information. As the application won't even start cause it…
Schill
  • 35
  • 4
1
vote
1 answer

How split a Delphi solution into reusable run-time packages?

I'm starting with Delphi XE5 and I would like to split my application in one exe and multiple reusable libraries. That means I don't want to split the running *.exe application in DLLs or runtime Packages. To achieve this, I have seen that in…
1
vote
0 answers

Delphi, Compile and install component in a bpg via command line

I have a bpg, and within this bpg have a list of 8 dpk's / bpl, I need to build all these dpk's via command line, and install these dpks too .. How can I do this via the command line? The idea is to make a installer like jedi components, I've been…
Linces Marques
  • 644
  • 1
  • 10
  • 24
1
vote
0 answers

Delphi BPL FMX XE3 Form Resource TForm1 not found

I have made a Form which I want to distribute in a BPL. So I created a new Package and a new Form, added registerClass to the initialization section of my form's unit and tried to manually load the BPL file with roughly the following code: var …
Maru
  • 894
  • 1
  • 12
  • 29
1
vote
1 answer

Delphi XE2 error building a package

I have a package where a unit uses JCL. When I try build the package it states E2225 Never-build package 'Jcl' must be recompiled So I load the package Jcl.dproj / Jcl160.bpl file into Delphi and build it. No errors here. But I still get the same…
Tom
  • 3,587
  • 9
  • 69
  • 124
1
vote
3 answers

Returning a string from a BPL function

have a function, simplified below, that is exported from a BPL function DoA(amount: currency; var Info: string): Currency; stdcall; begin result := amount * 19; Info:= 'Some Text about the result'; end; its loaded from the main program with…
Christopher Chase
  • 2,840
  • 6
  • 36
  • 57
1
vote
0 answers

Borland C++ BCB 5 - EAccessViolation DynamicArray Array too large

I am using BCB 5 and I have a DynamicArray that works perfectly under normal conditions, but recently i have been forced to use it for a large dataset(About 7000 items) and my exception handler throws this EAccessViolation. This happens…
0
votes
1 answer

Project settings for building release .exe that run on all machines

I am prototyping a user interface using C++Builder XE2. I need this project to run on all Windows PCs, whether they have developer tools installed or not. How can I get all the required libraries to be linked into the .exe that I distribute to…
Ondřej Mirtes
  • 5,054
  • 25
  • 36
0
votes
1 answer

Delphi XE2 Cannot get BPL plugin work

I tried to implement a simple module system with XE2 but couldn't get it to work. When I try to run it under IDE, I can get a handle from LoadPackage() but cannot get the class with GetClass() (even though it was RegisterClass()ed within…
Brian Hawk
  • 728
  • 2
  • 12
  • 24
0
votes
0 answers

Custom Delphi Tool Palette Grayed out

I am moving a project from Delphi XE8 to 11.2. I have a custom Tool Palette .bpl that I have loaded into Delphi 11.2 using "Install Packages". I can see pre-existing custom components in the .dfm files, but the components are grayed out in the Tool…
cab327
  • 9
  • 2
0
votes
0 answers

Delphi 10.4 error with missing class and library

I am trying to run a project on Delphi 10.4, with the BusinessSkinForm library (all library files are in the root folder of the project), the project is launched but open any .dfm form is not possible because delphi does not find classes from…
Nickana
  • 3
  • 5
0
votes
1 answer

How to deploy custom bpl with a datamodule unit?

I have a group project: PkagDemmo.exe(main application) AppAddin.bpl(load/unload bpl and create Form utilities) PkgData.bpl(DataModeule unit for Data access utilities) Pakage1.bpl(Form1 bpl and show data) Pakage2.bpl(Form2 bpl and show…
Mitchell Hu
  • 105
  • 1
  • 6
0
votes
0 answers

Create bpl - Delphi Can't load package the specified module cannot be found

Recently, I tried install a package .bpl on my computer but it always shows "Delphi Can't load package the specified module cannot be found" I found the problem was that one of the unit if I export the Function (pre-define) then it will show this…
Hsuan
  • 1
0
votes
1 answer

Delphi RAD Server 10.4.2 Two packages sharing common units - Error to load package

I had a RAD Server package ProjA.bpl with several endpoints and some of them use a unit called UntAccess.pas. Now I created another server package ProjB.bpl with different endpoints than ProjA and adjusted emsserver.ini configuration file section…
JRG
  • 513
  • 9
  • 23