3

In building components for installation, I know that registration units are generally a "should be separate" thing, but what are the guidelines for when one should divide the component installation into two separate packages (typically one being runtime, and the other being design time).

Bonus question: What are the accepted package naming conventions, for when runtime and designtime packages are separate?

mghie
  • 32,028
  • 6
  • 87
  • 129
Jamo
  • 3,238
  • 6
  • 40
  • 66

3 Answers3

4

Anything that is specific to use within the IDE like interacting with the designers, the object inspector (property editors...) or the components registration (icon, palette info...) should go into a design-time package, usually prefixed by dcl.

Anything else that is the minimum necessary to use the components in an application goes into the run-time package. Any reference to the Design units are forbidden in the run-time package.

It is common to have the compiler version number as a suffix to both design-time and runtime package: dclMyPackage120.bpl and MyPackage120.bpl (for D2009 which is version 20.0 of the compiler and sets the define VER200; for D2007 it was version 10.5 and a mixed bag of *100.bpl and *105.bpl thanks to binary compatibility).

Francesca
  • 21,452
  • 4
  • 49
  • 90
  • 1
    Actually it is common to suffix the Delphi compiler version to the packages, not the package's own version. There is also some magic project settings (which I currently can't look up because I have no Delphi at hand), that automates this and ensures that the corresponding .dcp-File does not have that suffix. See also the Delphi wiki on packages: http://delphi.wikia.com/wiki/Creating_Packages – dummzeuch Apr 18 '09 at 08:30
  • 1
    What does "dcl" stand for?... anyone know for sure? – Jamo Apr 19 '09 at 22:12
  • I'm not sure but there was an explanation floating around as "Design Component Library" – Francesca Apr 20 '09 at 17:08
2

Have a look at the Delphi Wiki on that topic: http://delphi.wikia.com/wiki/Creating_Packages Does it answer your question? If not, maybe, you should restate it.

dummzeuch
  • 10,975
  • 4
  • 51
  • 158
  • Hi. Your article state that if I compile with runtime packages, then I need to deploy stuff like "rtl100, vcl100, MyPackage100" with my app. I don't want that!!! I want to deliver one single EXE and nothing else. So, what now? – Gabriel Mar 08 '23 at 19:30
  • 1
    @GabrielMoraru then it doesn't make much of a difference whether you split your package into runtime and designtime or not. – dummzeuch Mar 09 '23 at 08:08
  • Yeah, I imagined that :) And now a followup question: if the main purpose of this was to prevent the designtime editors binary code from being shipped with the EXE file, to make the EXE file smaller - does it still make sense today? I mean, if you want to install a java or C# program, you will have to download 500MB. With or without a design editor in it, a Delphi EXE file will still be 4-5MB large. At today's Internet speed, the download time is... 0.1 to 1 seconds? – Gabriel Mar 10 '23 at 09:07
  • 1
    @GabrielMoraru there are still reasons why somebody would like to build his executables with runtime packages even if you don't. And given that, there are two reasons why you don't want to ship designtime code with your exe: 1. They are not necessary. 2. They require designtime packages of the IDE which you are not allowed to ship. – dummzeuch Mar 10 '23 at 14:03
  • Yes. I guess the second part makes the things complicated. But the first part is irrelevant today, as I said previously. So, in the end the issue resumes to "an embarcadero" issue. – Gabriel Mar 10 '23 at 14:44
  • 1
    @GabrielMoraru if by "an embarcadero issue" you mean that somebody (more 25 years ago at Borland) made a design decision that still affects how packages have to be created today, then you are right. But it's not only the legal issue of not being allowed to ship these packages, they will probably also not work outside the Delphi IDE. – dummzeuch Mar 10 '23 at 17:25
  • Yes. Let's simply say that the packages in Delphi are a bit more convoluted than they should be :) Also a bit unsafe. – Gabriel Mar 11 '23 at 17:07
  • "more 25 years ago at Borland" - The "now" is always the best time to start the change :) – Gabriel Mar 11 '23 at 17:07
  • PS: +1 for your wikia article. Good stuff! And a +1 one for taking care of the GExperts plugin. Great stuff! – Gabriel Mar 11 '23 at 17:09
0

Naming of packages is more or less up to you, but you should try to mimic one of the package naming schemes other providers are using.

The goals of proper package naming are to:

  • group packages of one provider and separate them from those of other providers
  • clearly separate runtime and design time packages
  • make parallel installation of various incompatible versions of the product as well as for various versions of Delphi / BCB possible

So generally the name of the package should consist of a short letter combination for the company / product, one or two digits for the version number, one of the accepted Delphi / BCB keys (like D5, D2007 or BCB6). For design time packages there is usually a "ds" or similar in the name, which is otherwise identical to that of the runtime package.

mghie
  • 32,028
  • 6
  • 87
  • 129