I am developping a CORBA like inter object protocol that would support object aggregate transmission.
When objects of an aggregate are serialized, they may have references to objets serialized later. These are forward references. A simple example is a circular list. If each object has a reference to the previously serialized object, the first object will have a reference to the last serialized object to close the loop.
When deserializing and instantiating an object containing such a forward reference, its value is not known. It is only when the corresponding object is deserialized and instantiated that the reference value is known and could be set.
In C or C++ I use the reference (pointer) itself to hold the list of references to the same object to set when it is instantiated. In Java this is not possible.
How could I implement such delayed reference setting in Java ?