Persistent Collections
Persistent collections are classes which handle dynamically sized collections of data that can be stored in the database. These collections provide three categories of service:
- persistent strings,
- generic arrays of data, and
- commonly used instantiations of arrays.
Persistent strings are concrete classes that handle sequences of characters based on both ASCII (normal 8-bit) and Unicode (16-bit) character sets.
Arrays are generic classes, that is, they can hold a variety of objects not necessarily inheriting from a unique root class. These arrays can be instantiated with any kind of storable or persistent object, and then inserted into the persistent data model of a user application.
The purpose of these data collections is simply to convert transient data into its persistent equivalent so that it can be stored in the database. To this end, the collections are used to create the persistent data model and assure the link with the database. They do not provide editing or query capabilities because it is more efficient, within the operative data model of the application, to work with transient data structures (from the TCollection package).
For this reason:
- the persistent strings only provide constructors and functions to convert between transient and persistent strings, and
- the persistent data collections are limited to arrays. In other words, PCollection does not include sequences, lists, queues, sets, stacks and so on (unlike TCollection).
Persistent string and array classes are found in the PCollection package.
In addition, the PColStd package provides standard, and frequently used, instantiations of persistent arrays, for very simple objects.