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
5
votes
2 answers

External modules implementation

What is the best way to implement an external module system for a DELPHI application? What I need is very basic really: The main APP detects if a module is present and loads it(Run time) Modules can store form Modules can store DataModules Modules…
Jlouro
  • 4,515
  • 9
  • 60
  • 91
5
votes
1 answer

rtl100.bpl was not found?

I am learning a component from TMS. I got "...rtl100.bpl was not found...". probably this error was happened if I use "Build with runtime packages" that contains "rtl". Where is rtl100.bpl (I am using D2007)? What should I do to fix this error?
Ina Ira
  • 247
  • 6
  • 14
4
votes
2 answers

How to fix bpl loading issue in Delphi XE while opening a project?

Very often when I try to open any project in Delphi XE the following issue raises for a few popular bpl-packages: Can't load package "Name1.bpl". Component "Name2" can't be registered by package "name1.bpl" because it has already been registered…
Dmitry
  • 14,306
  • 23
  • 105
  • 189
4
votes
1 answer

How to extract a resource from within a BPL?

If I've got a resource in an EXE and I want to extract it, it's pretty simple. Something like: stream := TResourceStream.Create(HInstance, ResourceName, RT_RCDATA); This works because the global variable HInstance is a handle to the EXE. Is there…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
4
votes
2 answers

Dynamically loaded BPL's sharing code / passing objects

I was toying around with the idea of using dynamically loading BPL's and passing object instances from the main app to a method in a BPL. This poses a problem units between used by the application and by the BPL. I wrote a small little prototype…
Darian Miller
  • 7,808
  • 3
  • 43
  • 62
4
votes
5 answers

Can't load package %s error while installing a package

I'm testing on Delphi 2007 and my groupproject is composed by 2 packages. PackageRun.bpl It's marked as "runtime only" and contains a unit named "uMyTestRun.pas" in which is defined an empty TFrame descendant: unit uMyTestRun; interface uses …
Fabrizio
  • 7,603
  • 6
  • 44
  • 104
4
votes
3 answers

Can one build an EXE project against a BPL/DCP with "Build With Runtime Packages" unchecked, based solely on the BPLs/DCPs?

I have a BPL project (with some base stuff) and an EXE project which has in it's Search Path the location of the other project's output (BPL and DCP). When the EXE project is built with "Build With Runtime Packages", it builds fine. However, it…
drakorg
  • 404
  • 4
  • 14
4
votes
1 answer

Missing .bpl files

After compiling a FireMonkey project and executing the app on another PC I've encountered an error - "rtl190.bpl is missing". So I searched google and I found the "solution" which didn't work for me. It said that I should uncheck "Link with Dynamic…
user2225809
  • 101
  • 1
  • 2
  • 7
4
votes
1 answer

I can't build a static executable in RAD Studio C++ Builder XE

I need to build my C++ Builder XE project with linked static library so I can get a large executable file in the Project's Debug\Win32 directory but I can't. Everytime I try to build my project, it doesn't builds the executable with the Runtime…
Jessie M
  • 498
  • 1
  • 9
  • 23
4
votes
2 answers

Get BPL File Name

From within a BPL, is it possible to get its own file name? e.g. C:\foo\bar.bpl (dynamically loaded and delphi7, if it matters)
Christopher Chase
  • 2,840
  • 6
  • 36
  • 57
3
votes
1 answer

Cannot dynamically link to components in a custom bpl

While drafting the following post I found a solution, but I thought it might be still worthwhile to post here for reference. See solution below. In RAD studio (C++), I have a project group with multiple dlls and exes that rely on a standard set of…
Hendrik
  • 569
  • 3
  • 12
3
votes
1 answer

Delphi BPL search path

Every BPL-related question found by me in Internet refers to some BPL already shipped with Delphi or at least installed globally, into Delphi folders. I would like to make my own application to find a run-time BPL file made by me, without saving…
Paul
  • 25,812
  • 38
  • 124
  • 247
3
votes
1 answer

Delphi, How to install a component with the same name in two different package

I need to install two different component packages, the first one uses BDE connection and the second one uses FireDAC connection, both of them contain a component called "TKsAnalExpr", which is contained in a unit named "UAnalExpr". I installed one…
3
votes
2 answers

Delphi XE4 : Closing Internal Package Form Causes Application Termination

i have a test.bpl package in my application and it has a form named myPackageForm. after loading my Package when i want to close myPackageForm, Application will Terminate. Main Project Initialization:…
Mohammad Gohari
  • 241
  • 3
  • 12
3
votes
0 answers

How to apply a patch to soap rtl in Delphi?

I have corrected an error in a soap unit (Soap.OPToSOAPDomConv.pas), but I don't know how to rebuild soaprtl170.bpl (Delphi XE3). I need to do this as I have a component to install in the ide that requires that bpl, and when dropping it in a form…
Gonzalo
  • 31
  • 2