Object Graph Deserialization

As the formatter deserializes an object graph, it will begin allocating and initializing object instances within the object graph as it reads the serialized data from the stream. During deserialization, the formatter keeps track of each object and the object's identifier. Each object member in the serialized object graph can reference one of the following:

• An uninitialized object that hasn't yet been deserialized

• A partially initialized object that has been deserialized

• A fully initialized object that has been deserialized

The formatter might encounter an object member that references another object that the formatter hasn't yet deserialized, such as the <m_sc2> child element of the <a1:SomeClass3> element shown in the preceding example. In that case, the formatter updates an internal structure that associates the object member with the referenced object's identifier. Later, when the formatter deserializes the referenced object from the stream, it will initialize any object members referencing the object. For object members that reference an object that the formatter has deserialized, the formatter initializes the member with that object instance.

0 0

Post a comment