PACKAGES in Delphi 7

Please discuss general Delphi programming topics here.

PACKAGES in Delphi 7

Postby Johan Theunissen » November 11th, 2009, 2:27 pm

The handling of runtime packages confuses me (Delphi 7). The way I understand it is like this:

You have to compile with “build with runtime packages” ticked in project-options-packages.

If a package does not appear in the “edit runtime packages list” the units it contains will be smart linked into the executable.

If a package appears in the “edit runtime packages list” and any unit it contains appears anywhere in the Uses clause’s of the application the package will automatically be statically loaded at startup of the executable.

If a package appears in the “edit runtime packages list” and none of the units it contains appears anywhere in a Uses clause of the application it will not be statically loaded at runtime but has to be dynamically loaded with loadpackage.

What happens with units that are Used by a unit in the CONTAINS part of the package (in other words a unit in a package in the REQUIRES clause of the package)?? Does the “required” packages get compiled into the package even though these units are already declared in the apllication’s Uses clauses? That could lead to a unit in a package being linked into the executable at compile time and the again loaded if the package is loaded with loadpackage at runtime.

Turbo Pascal had a very efficient overlay manager to handle called routines from overlay files. The delphi package (BPL ) handling is obviously not as efficient?? Maybe the Codegear guys could give us something similar in Delphi. Even in these times of bloated software and powerful hardware, one has to look at ways and means of optimising ones applications if they become quite large.

Hey you clever guys out there please enlighten me on my lack of knowledge regarding packages. Thanks!!!
Johan Theunissen
Active Member
Active Member
 
Posts: 9
Joined: November 6th, 2008, 7:26 pm

Re: PACKAGES in Delphi 7

Postby Kambiz » November 24th, 2009, 12:26 pm

AFAIK, the “required” packages of the runtime packages load dynamically at runtime.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2421
Joined: March 7th, 2003, 7:10 pm

Re: PACKAGES in Delphi 7

Postby Johan Theunissen » December 5th, 2009, 8:01 pm

Thank you for your reply. I also found this by experimenting.

It is a pitty there is not support for overlay files in Delphi as was the case in Turbo Pascal 7. That was a very efficient way of breaking large applications up into smaller parts. I suppose with the huge memory available on modern hardware this should not be really necessary anymore. I can still remember working with Turbo Pascal 1 on a IBM XT with 2 floppy drives 160Kb and RAM of 64Kb. Man o man then you had to be efficient with your code.
Johan Theunissen
Active Member
Active Member
 
Posts: 9
Joined: November 6th, 2008, 7:26 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron