What is an Objectivity/DB persistent collections? A persistent collection is an aggregate persistent object that contains a variable number of elements. An element of a persistent collection can be any kind of persistent object—a basic object of an application-defined class or an object of an Objectivity/DB persistence-capable class. What scalable collections are available? Objectivity/DB provides various classes from which you can create persistent collections. Among these are classes for scalable collections, which can increase in size with minimal performance degradation, and nonscalable collections, which cannot. Scalable collections are split into two categories: scalable ordered collections and scalable unordered collections. Scalable ordered collections (lists, sorted sets, and sorted object maps) are implemented as variants of self-balancing binary-search trees (B-trees). The B-tree organization supports efficient binary search and reduces the runtime overhead of inserting elements into the middle of the collection. Scalable unordered collections (unordered sets and unordered object maps) are implemented with an extendible hashing mechanism that allows the unordered collection to increase in size with minimal performance degradation. Adding elements may cause individual portions of the collection to be rehashed, but the entire collection never needs to be rehashed. Objectivity/DB scalable-collection classes:
➤ ooHashSetX represents unordered sets of persistent objects. ➤ ooTreeSetX represents sorted sets of persistent objects. ➤ ooHashMapX represents unordered object maps. ➤ ooTreeMapX represents sorted object maps. What nonscalable collections are available? Objectivity/DB supports one type of nonscalable unordered collection, namely name maps. Name maps are implemented with a traditional hashing mechanism:
➤ Hash values are computed from the key of each element. The hash table of a name map can grow dynamically; however, increasing its size requires rehashing the entire hash table. |
|||
