Introduction to the Database Template Library

Peter Kitson

ISBN : -

Order a printed copy of this book from Amazon --UNAVAILABLE--


Cover Design - Introduction to the Database Template Library
 

For your free electronic copy of this book please verify the numbers below. 

(We need to do this to make sure you're a person and not a malicious script)

Numbers

 




Sample Chapter From Introduction to the Database Template Library
     Copyright © Corwin Joy, Michael Gradman



Abstract:
The goal of this library is to make ODBC recordsets look just like an STL container. As a user, you can move through our containers using standard STL iterators; and if you insert(), erase() or replace() records in our containers changes can be automatically committed to the database for you. The library's compliance with the STL iterator and container standards means you can plug our abstractions into a wide variety of STL algorithms for data storage, searching and manipulation. In addition, the C++ reflection mechanism used by our library to bind to database tables allows us to add generic indexing and lookup properties to our containers with no special code required from the end-user. Because our code takes full advantage of the template mechanism, it adds minimal overhead compared with using raw ODBC calls to access a database.


Background:
Introduced in 1990, STL and templates represent one of the most significant advances in the C++ language in the last decade. The guiding force behind the power of the standard template library is the notion of Generic Programming. At the heart of Generic Programming is the idea of abstracting operations across as broad a set of data types as possible to create algorithms that are as generic as possible. This kind of design leads to abstractions that are centered around a set of requirements on the data types themselves. Examples in STL include notions such as iterators, containers and set operations. We have taken these abstractions and applied them to the problem of representing tables in a database. In what follows, we will show how this simplifies the task of manipulating data and provides instant access to a broad range of algorithms that come with the standard template library.