1.

How To Deserialize Objects With Multiple References?

Answer»

When you deserialize OBJECTS that you have referenced MULTIPLE times, you should reconstruct the objects only once. You should use a HASHTABLE to keep track of objects that you must reconstruct. When you READ an object for the first time, you add the reference to the hashtable along with the object's ID value. If you encounter the object a second time, you use the reference that is stored in the hashtable.

When you deserialize objects that you have referenced multiple times, you should reconstruct the objects only once. You should use a hashtable to keep track of objects that you must reconstruct. When you read an object for the first time, you add the reference to the hashtable along with the object's ID value. If you encounter the object a second time, you use the reference that is stored in the hashtable.



Discussion

No Comment Found