|
ado.net objective model for micorsoft dot net |
Written by d v suresh

Sunday, 06 April 2008
|
The .NET Framework is designed to change dramatically the developer's
current style of developing applications, including the data access
features. For the .NET applications, the primary data access technology
to be used would be ADO.NET — the latest addition to the ADO model. The ADO.NET Object Model is primarily divided into two levels: Connected Layer: Consists of the classes that comprise the Managed Providers Disconnected Layer: Is rooted in the DataSet Managed Providers Managed Providers are a collection of classes in the .NET Framework that provide a foundation for the ADO.NET programming model. The .NET Framework allows you to write language-neutral components, which can be called from any language, such as C++ or Visual Basic. In the .NET Framework, the OLE DB and ADO layers are merged into one layer. This results in high performance, and at the same time allows components to be called from any language. The Managed Data Providers include classes that can be used for the following: Accessing data from SQL Server 7.0 and later Accessing the other OLE DB providers The Managed Provider for ADO.NET is the System.Data.OleDb namespace, which allows you to access OLE DB data sources. This namespace includes classes that are used to connect to OLE DB data sources and execute database queries to access and manipulate data. DataSet class The DataSet comprises the Disconnected Layer of ADO.NET. The DataSet consists of a local buffer of tables and relations. the DataSet object model consists of Tables, Columns, Relations, Constraints, and Rows. A DataSet contains a collection of DataTables (the Tables collection). Unlike RecordSets, which are equivalent to tables in ADO, DataSets keep track of the relationships between tables if any. The DataSet is designed with a rich programming model. Th e following code creates a new DataTable with the name ProductInfo: Dim dset As DataSet = New DataSet("ProductInfo") Later, you can add columns to the DataTable. The columns are added to the DataTable by using the Add method on the Columns collection, and the column is assigned a name and a datatype. Finally, data is added to the table by calling the NewRow method on the DataTable and storing the column values in each DataRow. Basics of ado.net Interoperability The ADO.NET model is designed to take maximum advantage of the flexibility provided by the large industry acceptance of XML. ADO.NET uses XML for transmitting datasets among components and across tiers. Any component that is capable of reading the XML format can process the data. It is not necessary for the receiving component to be an ADO.NET component. The component that is sending or transmitting the dataset can simply transmit the dataset to its destination without bothering with how the receiving component is implemented. The component asking for the dataset, the destination component, can be implemented as a Visual Studio application or any other application. However, the important point to be considered is that the receiving component should be capable of accepting the XML file formatted as a dataset. Maintainability After an application is deployed, there might be a need for changes in the application. For example, the application might need substantial architectural changes to improve its performance. As the performance load on a deployed application server grows, system resources can become inadequate, resulting in higher response times. As a solution to these problems, the application might need to undergo architectural changes by adding tiers. Here, the problem is not the multitier application design, but rather the problem lies in increasing the number of tiers after an application is deployed. This transformation becomes easier if the original application is implemented in ADO.NET using datasets. In ADO.NET, the communication between tiers is relatively easy, because the tiers can transmit data through XML-formatted datasets. Programmability The ADO.NET model uses typed programming to manipulate objects. In typed programming, the programming environment or programming language itself recognizes the types of things that are important to users. To take full advantage of typed programming, you must know the things that are of interest to programmers and to end users. Consider the following code using typed programming in ADO.NET: If TotalQty > DataSet1.ProductInfo("Baby Food").QtyAvailable his code is equivalent to a line using non-typed programming and is easier to read by end users. An end user who has little or no programming experience can easily grasp the meaning of the condition being tested. Also, in non-typed programming, if the developer makes a spelling mistake by chance (for example, ProductInfo is spelled as ProdcutInfo), a run-time error will get generated. On the other hand, in typed datasets,errors in the syntax caused by misspellings are detected at compile time rather than at run time. Performance In ADO, while transmitting data across tiers using COM marshalling in the form of disconnected RecordSets, the values must be converted to data types that are recognized by COM. This results in poor performance. On the other hand, ADO.NET is designed to use disconnected data architecture, which in turn is easier to scale because it reduces the load on database (does not require any data type conversions). Thus, in the ADO.NET model, everything is handled at the client side, which in turn improves performance. Scalability The Web-based, data-centric applications require multiple users to access data simultaneously. This increases the demand on data to be accessed, making scalability one of the most critical features. Applications that use resources, such as database connections and database locks, cannot support more users to access data simultaneously, because eventually the user demand for the limited resources will exceed their supply. Because ADO.NET uses disconnected data access, applications do not retain database locks or active database connections for long durations. Hence, ADO.NET accommodates scalability by encouraging programmers to conserve limited resources, and allows more users to access data simultaneously. You can find further information at http://dotnetpoint.blogspot.com Article Source: http://www.ArticleBlast.com |
You are welcome to publish this article free of charge on your website, newsletter, or e-zine, provided:
- You don't change the article in any way
- You include the entire article, including the "about the author" box
- All hyperlinks must remain intact, including email addresses, and the link to ArticleBlast.com at the bottom
- In doing so you agree to indemnify the article's author, and ArticleBlast.com and its directors, officers, employees and agents from and against all losses, claims, damages and liabilities which arise out of its use
- It is also recommended that you provide a courtesy copy of your publication to the author of the article
