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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

applications, <strong>XML</strong>.serialization is key technology that you must absolutely be familiarwith. We'll exam<strong>in</strong>e <strong>XML</strong> serialization <strong>in</strong> Chapter 11.Let's look now at how ADO.<strong>NET</strong> and <strong>XML</strong> classes can be used to read and processrelational data expressed <strong>in</strong> a hierarchical shape.<strong>XML</strong> Data Readers.<strong>NET</strong> Framework applications delegate all their low-level data access tasks to a specialbreed of connector objects called managed data providers. The object model aroundthese connector components is known as ADO.<strong>NET</strong>. Basically, a data provider is thesoftware component that enables any .<strong>NET</strong> Framework application to connect to a datasource and execute commands to retrieve and modify data.A .<strong>NET</strong> Framework data provider component <strong>in</strong>terfaces client applications through theobjects <strong>in</strong> the ADO.<strong>NET</strong> namespace and exposes any provider-specific behaviordirectly to consumers. A .<strong>NET</strong> Framework data provider component creates a m<strong>in</strong>imallayer between the physical data source and the client code, thereby <strong>in</strong>creas<strong>in</strong>gper<strong>for</strong>mance without sacrific<strong>in</strong>g functionality.A .<strong>NET</strong> Framework data provider is fully <strong>in</strong>tegrated with the surround<strong>in</strong>g environment—the .<strong>NET</strong> Framework—so any results that a command generates are promptly andautomatically packed <strong>in</strong>to a familiar data structure—the ADO.<strong>NET</strong> and <strong>XML</strong> classes—<strong>for</strong> further use.A key architectural goal <strong>for</strong> .<strong>NET</strong> Framework data providers is that they must bedesigned to work on a rigorous per-data source basis. They expose connection,transaction, command, and reader objects, all work<strong>in</strong>g accord<strong>in</strong>g to the <strong>in</strong>ternalcapabilities and structure of the DBMS. As a result, the programm<strong>in</strong>g <strong>in</strong>terface of, say,the <strong>Microsoft</strong> Access data provider will not be completely identical to that of the SQLServer provider. An area <strong>in</strong> which this difference is palpable is <strong>in</strong> <strong>XML</strong> data queries.OLE DB and .<strong>NET</strong> Framework Managed Data ProvidersPrior to the advent of the .<strong>NET</strong> Framework, OLE DB was considered the emerg<strong>in</strong>gdata access technology. It was well positioned to def<strong>in</strong>itively replace <strong>in</strong> the heart, andthe code, of developers another well-known standard <strong>for</strong> universal data access—opendatabase connectivity (ODBC).OLE DB is the data access technology that translates the Universal Data Access(UDA) vision <strong>in</strong>to concrete programm<strong>in</strong>g calls. Introduced about five years ago, UDAdescribes a scenario <strong>in</strong> which all the data that can be expressed <strong>in</strong> a tabular <strong>for</strong>matcan be accessed and manipulated through a common API, no matter the actual b<strong>in</strong>ary<strong>for</strong>mat and the storage medium. Accord<strong>in</strong>g to the UDA vision, special modules—theOLE DB providers—would be called to expose the contents of a data source to theworld. Another family of components—the OLE DB consumers—would consume suchcontents by <strong>in</strong>teract<strong>in</strong>g with the providers through a common API.In design<strong>in</strong>g the <strong>in</strong>termediate API <strong>for</strong> OLE DB providers and consumers tocommunicate through, <strong>Microsoft</strong> decided to use the key software technology of thetime: the Component Object Model (COM). In this design approach, the consumer had293

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

Saved successfully!

Ooh no, something went wrong!