Prev | Advanced Operations Guide | Next |
Dynamic Binding
Rather than load a hard-coded file name, upstream components that require the functionality of a downstream component now can specify what functionality and what revision they require. An upstream component loads before a downstream component. For example, the application loads the Btrieve interface component, or BIF. The BIF then loads the MicroKernel interface module, or MIF. In this example, the BIF is an upstream component, and the MIF is a downstream component.
Upstream components load their downstream components with the help of a component called the Abstract OS Services DLL (Services DLL). The upstream component provides the Services DLL with a binding rule, specifying the type and minimum functional level of the required downstream component. Based on the binding rule, the Services DLL constructs a file name template and searches for a file that can deliver at least the required functionality. When it finds such a file, it returns the full path to the calling component, which then loads the specified downstream component.
When the engine is first started, the operating system searches the default path for W3BTRV7.DLL and W3SCMV7.DLL. On Windows 98, these DLLs are installed into the system directory.
Once these DLLs are loaded, when looking for additional downstream components, Smart Components first explore the directory specified in the engine's "InstallInfo\InstallDir" registry key. This registry key is written silently during product installation in the Pervasive Software registry pathway based on the target installation directory. If the requested component is not found in the directory specified in the registry, Smart Components then searches on the platform's default path.
The Services DLL employs a best first match search algorithm, meaning that it stops in the first directory where it finds an acceptable match and then returns the highest minor functional level of the specified component that exists in that directory.
For example, if a component requires W1MIF101.DLL or later, the Services DLL searches until it finds an instance of W1MIF1xx.DLL, where xx is 01 or greater. Then, the Services DLL searches that directory for the instance of W1MIF1xx.DLL with the greatest value of xx. This file name is then returned to the calling component. For example, if W1MIF101.DLL and W1MIF102.DLL are present in that directory, W1MIF102.DLL is returned. If there is an instance of W1MIF103.DLL in a different directory later on the search path, it is never reached.
Prev Unique Component Naming |
Contents Up Check for Revisions | Next Pervasive.SQL Event Logging |