Search This Blog

Monday, March 1, 2010

What is LINQ?

Language Integrated Query (or LINQ, pronounced “link” for short), is a set of Microsoft .NET technologies that provide built-in language querying functionality similar to SQL, not only for database access, but for accessing data from any source.

There is no one definition for LINQ, but it aims to solve the problem where we currently use different techniques for manipulating and selecting data from databases versus XML versus object collections; LINQ aims to make our life easier by giving us a coordinated, consistent and efficient syntax from our development environment and by using your one chosen programming language, rather than switching between programming languages.

The current LINQ family of technologies and concepts allows an extensible set of operators that work over objects, SQL data and XML data sources. The generalized architecture of the technology also allows the LINQ concepts to be expanded to almost any data domain or technology, so what LINQ is today will expand in the future.
.NET Language Integrated Query defines a set of general-purpose standard query operators that allow traversal, filter, and projection operations to be expressed in a direct yet declarative way in any .NET-based programming language. The standard query operators allow queries to be applied to any IEnumerable-based information source. LINQ allows third parties to augment the set of standard query operators with new domain-specific operators that are appropriate for the target domain or technology. More importantly, third parties are also free to replace the standard query operators with their own implementations that provide additional services such as remote evaluation, query translation, optimization, etc. By adhering to the conventions of the LINQ pattern, such implementations enjoy the same language integration and tool support as the standard query operators.
-------------------------
Key Features of LINQ:
----------------------------
Delayed Execution
LINQ queries don't execute until they must
Retrieve specific values
Iterate through the collection
Perform an operation

Write Data Access Code directly

Compile time syntax and schema checking (intellisense too)
no need of inline sql or to wait until runtime to see if it is ok

LINQ data access code abstracted from underlying data
consistent syntax across various data sources
can join information from different sources.
-------------
LINQ to SQL (formerly known as DLinq)
-------------
Object-relational mapping (ORM)
Records become strongly-typed objects.
Includes tracking of changed objects and persistence.
Ensures that you will not obtain multiple objects for the same underlying row in the database ( Fowler’s Identity Map)
Data context is the controller mechanism
Facilitates update, delete & insert
Type, parameter and injection safe

No comments:

Post a Comment