| 1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 |
<title>Chapter 7. Summary</title> |
| 7 |
<link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 |
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 |
<link rel="start" href="index.html" title="Berkeley DB Collections Tutorial" /> |
| 10 |
<link rel="up" href="index.html" title="Berkeley DB Collections Tutorial" /> |
| 11 |
<link rel="prev" href="removingredundantvalueclasses.html" title="Removing the Redundant Value Classes" /> |
| 12 |
<link rel="next" href="collectionOverview.html" title="Appendix A. API Notes and Details" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div xmlns="" class="navheader"> |
| 16 |
<div class="libver"> |
| 17 |
<p>Library Version 11.2.5.3</p> |
| 18 |
</div> |
| 19 |
<table width="100%" summary="Navigation header"> |
| 20 |
<tr> |
| 21 |
<th colspan="3" align="center">Chapter 7. |
| 22 |
Summary |
| 23 |
</th> |
| 24 |
</tr> |
| 25 |
<tr> |
| 26 |
<td width="20%" align="left"><a accesskey="p" href="removingredundantvalueclasses.html">Prev</a> </td> |
| 27 |
<th width="60%" align="center"> </th> |
| 28 |
<td width="20%" align="right"> <a accesskey="n" href="collectionOverview.html">Next</a></td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<hr /> |
| 32 |
</div> |
| 33 |
<div class="chapter" lang="en" xml:lang="en"> |
| 34 |
<div class="titlepage"> |
| 35 |
<div> |
| 36 |
<div> |
| 37 |
<h2 class="title"><a id="Summary"></a>Chapter 7. |
| 38 |
Summary |
| 39 |
</h2> |
| 40 |
</div> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
<p> |
| 44 |
In summary, the DB Java Collections API tutorial has |
| 45 |
demonstrated how to create different types of bindings, as well as |
| 46 |
how to use the basic facilities of the DB Java Collections API: |
| 47 |
the environment, databases, secondary indices, collections, and |
| 48 |
transactions. The final approach illustrated by the last example |
| 49 |
program, Serializable Entity, uses tuple keys and serial entity |
| 50 |
values. Hopefully it is clear that any type of object-to-data |
| 51 |
binding may be implemented by an application and used along with |
| 52 |
standard Java collections. |
| 53 |
</p> |
| 54 |
<p> |
| 55 |
The following table summarizes the differences between the |
| 56 |
examples in the tutorial. |
| 57 |
</p> |
| 58 |
<div class="informaltable"> |
| 59 |
<table border="1" width="80%"> |
| 60 |
<colgroup> |
| 61 |
<col /> |
| 62 |
<col /> |
| 63 |
<col /> |
| 64 |
<col /> |
| 65 |
<col /> |
| 66 |
</colgroup> |
| 67 |
<thead> |
| 68 |
<tr> |
| 69 |
<th>Example</th> |
| 70 |
<th>Key</th> |
| 71 |
<th>Value</th> |
| 72 |
<th>Entity</th> |
| 73 |
<th>Comments</th> |
| 74 |
</tr> |
| 75 |
</thead> |
| 76 |
<tbody> |
| 77 |
<tr> |
| 78 |
<td> |
| 79 |
<a class="xref" href="BasicProgram.html" title="Chapter 2. The Basic Program"> |
| 80 |
The Basic Program |
| 81 |
</a> |
| 82 |
</td> |
| 83 |
<td>Serial</td> |
| 84 |
<td>Serial</td> |
| 85 |
<td>No</td> |
| 86 |
<td>The shipment program</td> |
| 87 |
</tr> |
| 88 |
<tr> |
| 89 |
<td> |
| 90 |
<a class="xref" href="UsingSecondaries.html" title="Chapter 3. Using Secondary Indices"> |
| 91 |
Using Secondary Indices |
| 92 |
</a> |
| 93 |
</td> |
| 94 |
<td>Serial</td> |
| 95 |
<td>Serial</td> |
| 96 |
<td>No</td> |
| 97 |
<td>Secondary indices</td> |
| 98 |
</tr> |
| 99 |
<tr> |
| 100 |
<td> |
| 101 |
<a class="xref" href="Entity.html" title="Chapter 4. Using Entity Classes"> |
| 102 |
Using Entity Classes |
| 103 |
</a> |
| 104 |
</td> |
| 105 |
<td>Serial</td> |
| 106 |
<td>Serial</td> |
| 107 |
<td>Yes</td> |
| 108 |
<td>Combining the key and value in a single object</td> |
| 109 |
</tr> |
| 110 |
<tr> |
| 111 |
<td> |
| 112 |
<a class="xref" href="Tuple.html" title="Chapter 5. Using Tuples"> |
| 113 |
Using Tuples |
| 114 |
</a> |
| 115 |
</td> |
| 116 |
<td>Tuple</td> |
| 117 |
<td>Serial</td> |
| 118 |
<td>Yes</td> |
| 119 |
<td>Compact ordered keys</td> |
| 120 |
</tr> |
| 121 |
<tr> |
| 122 |
<td> |
| 123 |
<a class="xref" href="SerializableEntity.html" title="Chapter 6. Using Serializable Entities"> |
| 124 |
Using Serializable Entities |
| 125 |
</a> |
| 126 |
</td> |
| 127 |
<td>Tuple</td> |
| 128 |
<td>Serial</td> |
| 129 |
<td>Yes</td> |
| 130 |
<td>One serializable class for entities and values</td> |
| 131 |
</tr> |
| 132 |
</tbody> |
| 133 |
</table> |
| 134 |
</div> |
| 135 |
<p> |
| 136 |
Having completed this tutorial, you may want to explore how other types of |
| 137 |
bindings can be implemented. The bindings shown in this tutorial |
| 138 |
are all <span class="emphasis"><em>external bindings</em></span>, meaning that the data classes |
| 139 |
themselves contain none of the binding implementation. It is also |
| 140 |
possible to implement <span class="emphasis"><em>internal bindings</em></span>, where the data |
| 141 |
classes implement the binding. |
| 142 |
</p> |
| 143 |
<p> |
| 144 |
Internal bindings are called <span class="emphasis"><em>marshalled bindings</em></span> in the |
| 145 |
DB Java Collections API, and in this model each data class |
| 146 |
implements a marshalling interface. A single external binding class |
| 147 |
that understands the marshalling interface is used to call the |
| 148 |
internal bindings of each data object, and therefore the overall |
| 149 |
model and API is unchanged. To learn about marshalled bindings, see |
| 150 |
the |
| 151 |
|
| 152 |
|
| 153 |
<span class="pdf;html"> |
| 154 |
<code class="literal">marshal</code> and <code class="literal">factory</code> examples that |
| 155 |
came with your DB distribution (you can find them in |
| 156 |
|
| 157 |
<code class="filename"><INSTALL_DIR>/examples_java/src/com/sleepycat/examples/collections/ship</code> |
| 158 |
where <code class="literal"><INSTALL_DIR></code> is the location where you |
| 159 |
unpacked your DB distribution). |
| 160 |
</span> |
| 161 |
|
| 162 |
These examples continue building on |
| 163 |
the example programs used in the tutorial. The Marshal program is |
| 164 |
the next program following the Serializable Entity program, and the |
| 165 |
Factory program follows the Marshal program. The source code |
| 166 |
comments in these examples explain their differences. |
| 167 |
</p> |
| 168 |
</div> |
| 169 |
<div class="navfooter"> |
| 170 |
<hr /> |
| 171 |
<table width="100%" summary="Navigation footer"> |
| 172 |
<tr> |
| 173 |
<td width="40%" align="left"><a accesskey="p" href="removingredundantvalueclasses.html">Prev</a> </td> |
| 174 |
<td width="20%" align="center"> </td> |
| 175 |
<td width="40%" align="right"> <a accesskey="n" href="collectionOverview.html">Next</a></td> |
| 176 |
</tr> |
| 177 |
<tr> |
| 178 |
<td width="40%" align="left" valign="top"> |
| 179 |
Removing the Redundant Value Classes |
| 180 |
</td> |
| 181 |
<td width="20%" align="center"> |
| 182 |
<a accesskey="h" href="index.html">Home</a> |
| 183 |
</td> |
| 184 |
<td width="40%" align="right" valign="top"> Appendix A. |
| 185 |
API Notes and Details |
| 186 |
</td> |
| 187 |
</tr> |
| 188 |
</table> |
| 189 |
</div> |
| 190 |
</body> |
| 191 |
</html> |