This article is from the Object-Oriented
Technology FAQ, by Bob Hathaway email@example.com with numerous
contributions by others.
9.3) Odapter/OpenODB: Odapter and C++
For C++ developers, once the corresponding C++
model is created, Odapter provides the abilility to
manage C++ objects stored in the underlying
relational database, as shown in Figure 4.
ODBType Flight ("Flight");
Figure 4 shows a C++ version of the Smalltalk
example in Figure 3. That is, Figure 4 shows how to
access all the flight objects shown in Figure 2 and
prints the flight number associated with each
The Odapter C++ library includes a set of classes
(e.g. ODBType, ODBClass, ODBFunc, ODBBag) and
corresponding member functions (e.g. allObjects).
User-defined classes (Flight) and member functions
(flightno) are also shown. In Figure 4, all Odapter
calls are in italics.
Odapter and C-linkable Languages
For traditional developers using C, or any
languages linkable with C, the object-oriented
features are provided by Odapter. Odapter objects
are manipulated by embedding OSQL statements in the
C program, similar to the db.execosql call shown in
Figure 4. In addition, the C interface requires the
conversion of data types from Odapter to C.
By embedding Odapter calls in a C program, the C
language becomes object-oriented.