Shared services

<< Click to Display Table of Contents >>

Navigation:  Basic concepts >

Shared services

Previous pageReturn to chapter overviewNext page

The Borland Database Engine (BDE) is based upon a software component model. To ease driver development and maximize reuse, the BDE infrastructure provides the following shared services.

Note:These shared components are mostly internal to BDE and its drivers; they are described here to help you understand the BDE architecture.

Buffer Manager

BDE's priority-based buffer manager enables all BDE drivers to share the same buffer pool. Buffers owned by different drivers can coexist in this buffer pool. BDE drivers are not required to use the common buffer manager, but using it maximizes overall system resources.

Sort Engine

BDE's high-performance sort engine is used internally by the query engine and by the Paradox and dBASE drivers.

OS services

BDE's OS services isolate the BDE environment from all OS and platform dependencies, including file I/O, network access, and OS level memory allocation. This makes BDE highly portable.

Memory manager

BDE's memory manager provides a sub-allocation service, minimizing OS overhead for small memory allocations.

BLOB cache

BDE's BLOB caching service makes BLOB access as efficient as possible, so that programmers don't need to use their own caching schemes. The BLOB cache is accessible to all BDE drivers. Multiple BLOBs can be simultaneously opened. The BLOB cache automatically overflows into a shared physical file to handle large BLOBs. The BLOB cache makes random access to BLOBS possible, eliminating the need for application developers to transfer BLOBs to files. This facility is available from BDE even when the data source/server does not provide random access to BLOBs.

Query Engine

The shared query engine supports both SQL and QBE query languages with data format independence.

SQL Generator

The query engine supports QBE as an alternate query language, which is more intuitive to end users than SQL. When the QBE query is directed toward a SQL-based server, the SQL generator module of the QBE engine translates the query into an equivalent SQL query.

Restructure

A restructure service is currently available for Paradox, dBASE, Access, and FoxPro formats. Restructuring enables the application developer to add, drop, or modify fields and drop or modify any structural aspects of a table. This module creates new tables when appropriate, translating and copying data to the new table as necessary.

Batch table functions

A set of generic batch services is available. These include copying data from one format to another, reading and writing blocks of records, and renaming tables.

Data translation service

BDE's data translation service enables many BDE functions and services to do cross-database operations. Given any two compatible formats, the data translation service calculates the optimal conversion. Data is translated from the database's native physical data format to the common BDE logical data format, and vice versa.

Linked cursors

BDE implements linked cursors to automatically support one-to-many relationships between two tables. A linked detail cursor tracks its master cursor using the join key and the records accessible by the detail cursor are constrained by the master record. Developers can use linked cursors to build sophisticated multi-table applications with little programming.

In-memory tables

In-memory tables provide efficient access to unlimited virtual memory in a table format. The sort engine uses in-memory tables to create intermediate batches. SQL drivers use in-memory tables for caching data locally. Developers can create and access in-memory tables by using BDE function calls used for accessing persistent tables. See DbiCreateInMemTable.

Note that in-memory tables cannot be:

made permanent

indexed

moved in batches

saved to disk

SQL driver services

All SQL-based drivers (including the ODBC connectivity module) are built using SQL driver services. The following driver services are included:

Mapping navigational BDE calls to SQL, making it possible to upsize Paradox and dBASE applications transparently.

Local caching of records, making it possible to browse on query results.

Schema inquiry services.

BLOB handling services that are built using the BLOB cache module.

Debugging by using the SQL Trace facility to track SQL statements sent to servers by BDE functions.

System manager

The system manager manages all system-level resources. It loads drivers on demand and keeps track of open databases and cursors. When an application exits, the system manager frees the resources allocated to that application.

Configuration manager

The configuration manager maintains the BDE global system configuration information in the Windows Registry and application-specific information in the BDE configuration file (IDAPI.CFG). At startup time this information is used to customize the BDE environment.

The BDE functions DbiOpenCfgInfoList, DbiAddDriver, DbiDeleteDriver, DbiAddAlias, and DbiDeleteAlias give the application access to the configuration file. You use the BDE Administrator (BDEADMIN.EXE) to register drivers and aliases, set date format options, and customize BDE drivers.

Language drivers

BDE architecture incorporates language drivers to address the needs of the international market. Each language driver encodes the collating sequence, capitalization rules, and OEM/ANSI translation rules to suit its particular language.

All the native BDE drivers and all BDE shared services support these language drivers, so that the entire BDE environment is automatically "international" enabled. No porting is necessary. Application developers can deploy applications in international markets using the same engine. See International compatibility for more information on this.

Resources

All resources, such as error messages, for a language are placed in a separate dynamic link library. BDE can simultaneously support resources in different languages. An application can register its language at startup time.