Isomorphic persistence, Isomorphic versus simple persistence – HP Integrity NonStop J-Series User Manual
Page 178

Click on the banner to return to the user guide home page.
©Copyright 1996 Rogue Wave Software
Isomorphic Persistence
Isomorphic persistence is the storage and retrieval of objects to and from a stream such that the
pointer relationships between the objects are preserved. If there are no pointer relationships,
isomorphic persistence effectively saves and restores objects the same way as simple persistence.
When a collection is isomorphically persisted, all objects within that collection are assumed to have
the same type. (A collection of objects of the same type is called a homogeneous collection.)
You can use isomorphic persistence to save and restore any Tools.h++ class listed in Table 2 above.
In addition, you can add isomorphic persistence to a class by following the technique described in
Designing Your Class to Use Isomorphic Persistence
.
Note that in this implementation of Tools.h++, isomorphic persistence of types templatized on
pointers is not supported. For example, saving and restoring
RWTValDlist
[19]
In this case, we suggest that you use
RWTPtrDlist
Category
Description
Rogue Wave Standard C++
Library-based collection classes
RWTValDeque,
RWTPtrMap
,...
RWCollectable
(Smalltalk-like)
classes
RWCollectableDate,
RWCollectableString...
Note that
RWCollectable
classes also provide polymorphic
persistence (see
)
RWCollection
classes that derive
from
RWCollectable
RWBinaryTree
,
RWBag
,...
Rogue Wave Tools.h++ 6.x
templatized collections
RWTPtrDlist
,
RWTValDlist
,
RWTPtrSlist
,
RWTValSlist,
RWTPtrOrderedVector
,
RWTValOrderedVector,
RWTPtrSortedVector
,
RWTValSortedVector,
RWTPtrVector
,
RWTValVector
Isomorphic versus Simple Persistence
Let's look at a couple of illustrations that show the difference between isomorphic and simple
persistence. In Figure 2, a collection of multiple pointers to the same object is saved to and restored
from a stream, using simple persistence. Notice that when the collection is stored and restored in
Figure 2, each pointer points to a distinct object. Contrast this with the isomorphic persistence of the
same collection, shown in Figure 3, in which all of the restored pointers point to the same object, just