RAD Studio |  |

Working with Packages and Components: Overview
See Also
Collapse All

A package is a special dynamic-link library used by applications, the IDE, or both. Runtime packages provide functionality when a user runs an application. Design-time packages are used to install components in the IDE and to create special property editors for custom components. A single package can function at both design time and runtime, and design-time packages frequently work by calling runtime packages. To distinguish them from other DLLs, package libraries are stored in files that end with the .bpl (Borland package library) extension.

Like other runtime libraries, packages contain code that can be shared among applications. For example, the most frequently used VCL components reside in a package called vcl . Each time you create a new default VCL application, it automatically uses vcl. When you compile an application created this way, the application's executable image contains only the code and data unique to it; the common code is in the runtime package called vcl90.bpl. A computer with several package-enabled applications installed on it needs only a single copy of vcl90.bpl, which is shared by all the applications and the IDE itself.

Several runtime packages encapsulate VCL components while several design-time packages manipulate components in the IDE.

You can build applications with or without packages. However, if you want to add custom components to the IDE, you must install them as design-time packages.

You can create your own runtime packages to share among applications. If you write Delphi components, you can compile your components into design-time packages before installing them.

See Also

Overview of Component Creation

Why Use Packages?

Packages and Standard DLLs

Runtime Packages

Loading Packages in an Application

Loading Packages with the LoadPackage Function

Deciding Which Runtime Packages to Use

Custom Packages

Design-time Packages

Installing Component Packages

Creating and Editing Packages

Creating a Package

Editing an Existing Package

Understanding the Structure of a Package

Naming Packages

Requires Clause

Avoiding Circular Package References

Handling Duplicate Package References

Contains Clause

Avoiding Redundant Source Code Uses

Editing Package Source Files Manually

Compiling Packages

Package-specific Compiler Directives

Weak Packaging

Compiling and Linking From the Command Line

Package Files Created by Compiling

Deploying Packages

Deploying Applications that Use Packages

Distributing Packages to Other Developers

Package Collection Files

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!