ADO.NET 3.0 Data Access Options and LINQ to SQL ( DLinq )
by David Hayden ( ASP.NET C# SQL Server Developer )
During TechEd, the developer world got their first look at the new ADO.NET 3.0 Entity Framework, which introduced the concept of the Entity Data Model ( ADO.NET 3.0 Framework - Entity Data Model - Entity SQL - LINQ - A Thing of Beauty ). The big question on everyone's mind was how does LINQ to SQL fit into the Microsoft Data Access Strategy now that we have LINQ to Entities ( LinQ for SQL ( DLinq ) and LinQ for Entities for .NET 3.0 Framework? - O/R Mapping Tools ).
You can essentially look at LINQ to Enties and LINQ to SQL as competing solutions to allowing our applications to break free of the database schema and view the data in more of a conceptual model. The relationship and necessity of both LINQ to Entities and LINQ to SQL has still yet to be resolved within Microsoft, but I am sure we will here more about this in the near future.
Although I am still trying to position the various technologies coming down the pike with respect to Data Access, we seem to have a few different alternatives to working with relational data coming from Microsoft:
- Connected and Disconnected ADO.NET - This is your typical use of DbConnection, DbCommand, and DbDataReader objects in the connected world, and DataSet, DataTable ( and the DbDataAdapter Bridge ) in the disconnected world. LINQ to DataSets will enrich the use of DataSets.
- Mapping Providers - This appears to be a suite of technologies allowing developers with existing database applications that use DbConnection, DbCommand, and T-SQL an easy migration path to the Entity Data Model. The idea here is to implement the Entity Data Model and replace your current DbConnection with MapConnection, DbCommand with MapCommand, and T-SQL with Entity SQL.
- Entity Data Model - For new applications, you can jump right into using the Entity Data Model, which allows you to create a custom view of the database schema tailored for your application. You've got two ways to query: Entity SQL and LINQ to Entities. Entity SQL is more of an interim step for querying until LINQ to Entities ships.
- LINQ to SQL ( DLinq ) - Sidesteps the Entity Data Model for when you want an O/R Mapper that works in the conventional sense with the database schema. This remains a bit of a puzzle, but we will see how this technology evolves.
So, after seeing the ADO.NET 3.0 Framework Screencasts as mentioned in my previous blog post, this is where I see things at the moment. I am pretty excited about the Entity Data Model, LINQ to Entities, and the code generation capabilities that we will see in the future around these technologies. As always, all of this is subject to change, but I like where Microsoft appears to be going with data access.
Be sure to catch the video on Channel 9 that talks briefly about LINQ and Entities in the ADO.NET 3.0 Framework.
Source: David Hayden ( ASP.NET C# SQL Server Developer )
Filed: ADO.NET 3.0