Polymorphic Persistence Click on the banner to return to the user guide home page. The objects created from those classes may be any of the different types derived from RW Collectable . A group of such objects, where the objects may have different types, is called a heterogeneous collection. Table 7 lists the classes that use polymorphic persistence. When these operators are used in polymorphic persistence, not only are objects isomorphically saved and restored, but objects of unknown type can be restored.
Polymorphic persistence uses the operators listed below.
Even nil pointers can be saved. The persistence mechanism determines the object type at run time by examining the class ID that was stored with the object. The persistence mechanism determines the object type at run time by examining the class ID that was stored with the object. Since the restored objects are allocated from the heap, you are responsible for deleting them when you are done with them. Designing your Class to Use Polymorphic Persistence Note that the ability to restore the pointer relationships of a polymorphic object is a property of the base class, RW Collectable .