Justin James provides an introduction to ADO.NET, LINQ, Entity Framework, NHibernate, WCF Data Services, WCF RIA Services, and ODBC in his back to basics .NET series.
For the second installment of my TechRepublic series that highlights various .NET technologies and explains what they are, I am focusing on .NET's data capabilities.
- ActiveX Data Objects .NET (ADO.NET) is a collection of technologies that encompasses basic data connection functionality. Things like the ability to connect to a database are part of ADO.NET. Don't let the ActiveX in the title confuse you — that's just some branding on Microsoft's part from ages ago to help ease developers' minds about the technology. ADO.NET is part of the .NET Framework.
- Language Integrated Query (LINQ) was introduced in .NET 3.5; it provides a standardized set of SQL-like expressions to be used inline in other .NET languages such as C# and VB.NET. Objects may provide LINQ providers so they can be queried (including updates and deletions).
It may not seem obvious at first, but using a SQL-like language to query data is very useful. LINQ is more than just about querying databases — it can be tied to XML data, objects in memory, Web services, ORM systems, and more. As a result, having a standardized way to work with data regardless of the backing storage system allows you to build applications with much less learning and effort. Some common LINQ providers are:
- LINQ-to-objects — objects that implement IEnumerable.
- LINQ-to-XML — the XML objects in the LINQ namespace.
- LINQ-to-Entities — Entity Framework.
- LINQ-to-NHibernate — NHibernate.
- LINQ-to-SQL — SQL Server databases.
- Entity Framework (aka "EF") is Microsoft's ORM built on top of ADO.NET technologies. Its initial release was widely panned as being feature poor and overly complex. The second release (confusingly called Entity Framework 4) contains a lot of improvements and addresses many of the concerns about the initial release. EF can be used through LINQ.
- NHibernate is an open source ORM based on Hibernate for the Java platform. NHibernate has found favor within the .NET community for being a well-made product. LINQ can query NHibernate. NHibernate competes directly with Entity Framework and is well supported by the community.
- Windows Communication Foundation (WCF) Data Services are built on top of the WCF platform. These services allow a simple Web service to be built to access an underlying data source, and can be automatically generated from a data source. If you need to expose data to an external client, WCF Data Services is your best bet. It allows for very granular and discrete permissions for the security minded. WCF produces XML, RDF, or JSON. WCF Data Services creates a RESTful Web service.
- WCF RIA Services, another sub-set of the WCF platform, specializes in creating N-tiered applications with Silverlight. WCF RIA Services encompasses the server side and the client side. On the client side, it generates classes that are aware of CRUD operations (but not the underlying logic) on the server, so that operations on the client can easily trigger the appropriate logic on the server.
- Open Database Connectivity (ODBC) is the granddaddy of all Windows data connectivity systems. While ODBC is not a .NET-specific technology, ADO.NET can connect to ODBC datasources.
What technology would you like to see in the next edition of this series, which will publish in about a month?