13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>for</strong>matter access the source data through the methods of the ISerializable <strong>in</strong>terface.The <strong>for</strong>matter obta<strong>in</strong>s raw data that it then packs <strong>in</strong>to the expected output stream.In the alternative serialization model, the DataSet object itself starts and controls theserialization and deserialization process through a group of extra methods. TheDataTable object does not offer public methods to support such an alternative andembedded serialization <strong>in</strong>terface, nor does the DataView object.In the end, both the official and the embedded serialization eng<strong>in</strong>es share the same setof methods. The overall architecture of DataSet and DataTable serialization isgraphically rendered <strong>in</strong> Figure 9-1.Figure 9-1: Both the DataSet object and the DataTable object implement the ISerializable<strong>in</strong>terface <strong>for</strong> classic .<strong>NET</strong> Framework serialization. The DataSet object also publiclyexposes the <strong>in</strong>ternal API used to support classic serialization.All the methods that the DataSet object uses <strong>in</strong>ternally to support the .<strong>NET</strong> Frameworkserialization process are publicly exposed to applications through a group of methods,one pair of which clearly stands out—ReadXml and WriteXml. The DataTable object, onthe other hand, does not publish the same methods, although this feature can be easilyobta<strong>in</strong>ed with a little code. (I'll demonstrate this <strong>in</strong> the section "Serializ<strong>in</strong>g FilteredViews," on page 417.)As you can see <strong>in</strong> the architecture depicted <strong>in</strong> Figure 9-1, both objects always pass<strong>XML</strong> data to .<strong>NET</strong> Framework <strong>for</strong>matters. This means that there is no .<strong>NET</strong> Framework-325

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!