Berkeley DB Reference Guide:
Java API Tutorial

PrevRefNext

Summary and next steps

In summary, the Java API tutorial has demonstrated how to create different types of formats and bindings, as well as how to use the basic facilities of the Java API: the database environment, stores, indices, collections, and transactions. The final approach illustrated by the last example program, Serializable Entity, uses tuple keys and serial entity values. Hopefully it is clear that any type of object-to-data binding may be implemented by an application and used along with standard Java collections.

The following table summarizes the differences between the examples in the tutorial.

ExampleKeyValueEntityComments
BasicSerialSerialNoThe shipment program
IndexSerialSerialNoIndices and foreign keys
EntitySerialSerialYesCombining the key and value in a single object
TupleTupleSerialYesCompact ordered keys
Serializable EntityTupleSerialYesOne serializable class for entities and values

Next Steps

There are two directions to go from here. The first direction is toward a deeper understanding of the Java API and the underlying Berkeley DB capabilities. The next section, Overview of the Java API, along with the other material in the Reference Guide, will take you there.

The second direction is toward understanding how other types of bindings might be implemented. The bindings shown in this tutorial are all external bindings, meaning that the data classes themselves contain none of the binding implementation. It is also possible to implement internal bindings, where the data classes implement the binding.

Internal bindings are called marshalled bindings in the Java API, and in this model each data class implements a marshalling interface. A single external binding class that understands the marshalling interface is used to call the internal bindings of each data object, and therefore the overall model and API is unchanged. To learn about marshalled bindings, see the Marshal and Factory example programs. These examples continue building on the example programs used in the tutorial. The Marshal program is the next program following the Serializable Entity program, and the Factory program follows the Marshal program. The source code comments in these examples explain their differences.


PrevRefNext

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.