Introducing LINQ (3) Infrastructure

[LINQ via C# series]

This image shows the infrastructure of LINQ:

introducing-linq-infrastructure-1

FCL and LINQ providers

As mentioned in part 2, LINQ is independent to data source. The concrete functionalities of querying a .NET array, or querying a table in SQL Server database, are implemented by certain classes and methods defined in .NET 3.5 FCL. Those classes are called LINQ providers.

.NET 3.5 FCL provides these built-in LINQ providers:

  • LINQ to Objects: provides the LINQ implementation on .NET objects
  • LINQ to SQL: provides the LINQ implementation on SQL Server
  • LINQ to XML: provides the LINQ implementation on XML data
  • LINQ to DataSets: provides the LINQ implementation on DataSet
  • LINQ to Entities: provides the LINQ implementation on relational databases like SQL Server, etc.

LINQ to Objects, LINQ to SQL, and LINQ to XML are talked about in part 1. There are also other third part LINQ providers, like the LINQ to Wikipedia in part 1.

Again, LINQ providers are just some class libraries. The detail of LINQ provider will be explained later.

Managed programming languages

In C# 3.0 and VB 9.0, native language features are added for programmers to use LINQ. Those features includes:

  • Query expressions (the queries used in the samples in part 1)
  • Anonymous types with static type inference
  • Extension methods
  • Lambda expressions

etc., which will be all covered in the following posts.

CLR

There is nothing new for CLR in .NET 3.5. As part 1 mentioned, .NET 3.0 and 3.5 are using the CLR of .NET 2.0. The differences are:

  • In .NET 2.0 there is CLR 2.0, and C# 2.0
  • .NET 3.0 uses CLR 2.0; it added several class libraries(WCF, WPF, WF and WC) to FCL; C# is still 2.0
  • .NET 3.5 uses CLR 2.0; it added LINQ (related interfaces / classes and several LINQ providers) to FCL; Because some new features are added to managed programming languages, C# becomes 3.0
  • .NET 4.0 will introduce CLR 4.0 and C# 4.0

The following posts will explain those C# 3.0 new features are just some syntactical sugars. In the CLR’s perspective, C# 2.0 and C# 3.0 work the same.

Published Tuesday, November 24, 2009 1:02 PM by Dixin
Filed under: , ,

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)