provider
exists, and what it doesprovider
exists, and what it doesThe independent part is the stream layer. It defines the public interface used by applications. It has no knowledge of what kind of server or native library is used to communicate with the server. The stream layer concentrates instead on implementing the stream metaphor.
The provider
layer is database-dependent. It "generifies" the native database library, providing a uniform interface for use by dbstreams
.
What does "generify" mean? It means to create a uniform way to:
"Generification" features
Describe a user or account
Connect to a server
Send a query
Insert and Extract data
Handle errors
Manage the stream state
Before a dbstream
can be used (and normally at construction) the application passes a token (of type provider_type
) designating the provider to be used.
[1]
The dbstream
class instantiates the appropriate provider, storing its address in provider
*pprovider
. All providers are derived from provider
, which defines storage for some member variables and defines the calling interface as a set of pure virtual functions.
Terms used in this document
The public, database-independent classes, used by the application.
The abstract provider
class or one of its concrete implementations.
The C-callable library that is used to communicate with the database server.
[1] | This is unfortunately necessary because there is no way to interrogate the server about its implementation, no way to know from the outside whether we're talking to, say, an Oracle or Postgres server. |