To insulate your applications from the details of diverse data types, SourcePro DB uses a data model that automatically normalizes data types. By normalizing data types, we mean that SourcePro DB converts data from database-dependent data types to DB Interface Module classes that represent the data in a standard, vendor-neutral way. Figure 3 shows how this data model works within the SourcePro DB architecture:
As Figure 3 shows, SourcePro DB consists of the DB Interface Module and a vendor-specific DB Access Module that bridge your application and the database. The SourcePro DB data model consists of three layers: the database layer, the value layer, and the pointer layer.
The database layer resides in the various DB Access Modules, and provides an interface to each database vendor's API. DB Interface Module code with any reference to database-dependent data types is restricted to this layer. The function of this code is to move data between the Open SQL class RWDBTBuffer<T> and the native database API.
The value layer consists of the DB Interface Module classes that pass data by value. C++ types, like int, float, and so on, are used directly by this layer. They are augmented by a small number of concrete classes used for storage and manipulation of structured data: RWCString, RWWString, RWBasicUString, RWDBMBString, RWDecimalPortable, RWDBBlob, RWDateTime, RWDBDateTime (deprecated), and RWDBDuration. Additionally, class RWDBValue is used for data type neutral data access and for data type conversion. The value layer spans the DB Interface Module and your application program.
In the pointer layer of the DB Interface Module, pointers to all data are encapsulated in instances of class RWDBTBuffer<T>. Data moving to or from a database is stored here by pointer. The pointer layer spans the DB Interface Module and the various DB Access Modules, and your application program as well, depending on the classes of the DB Interface Module that you use. When your application passes pointers to the value-based classes or uses Open SQL, you use the pointer layer directly.
All classes of the DB Interface Module produced from an RWDBDatabase or RWDBTable instance, such as RWDBSelector, RWDBInserter, and so on, can accept input from, or deliver output to, the C++ types and concrete classes listed above. Insulation from the data type and data transport peculiarities of various databases makes SourcePro DB applications portable and reusable. The remainder of this chapter describes each layer of the data model in detail.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.