Feeds

Mind your languages with Microsoft LINQ

Data-access sticking plaster?

HP ProLiant Gen8: Integrated lifecycle automation

We've been hearing a growing amount this year about LINQ - Microsoft's Language Integrated Query. You can expect a lot more next year, starting in February as Microsoft launches Visual Studio 2008 and SQL Server 2008. LINQ promises to close the skills and knowledge gap for developers using C# and VisualBasic trying to connect to different data types and sources.

Before Visual Studio and SQL Server 2008 hit, here's what you as a programmer need to know about LINQ.

LINQ was created as the solution to a communication problem. Most modern programming languages are Object-Oriented (OO) while much of the world's data is stored in relational databases. Application programmers are used to dealing with things such as objects, classes and methods but they are not usually familiar with SQL - the language used to query relational databases.

As Anders Hejlsberg - the noted language expert and designer of Microsoft's C# - has argued, this has created: "An impedance mismatch today between general-purpose programming languages and databases. LINQ adds native query capability into programming languages such as C# and VisualBasic."

At a very simplistic level, LINQ can be seen as an OO querying language that can be understood and used by OO programmers and yet run against relational structures. But whilst this describes the way that it will often be used, LINQ actually does a lot more and is described by Hejlsberg and colleague Don Box here as: "General-purpose query facilities added to the .NET Framework [that] apply to all sources of information, not just relational or XML data."

So LINQ allows application programmers of an OO mindset to query any data source (Relational, OO and XML) in a way that they find intuitively easier. It is not, despite what some people have written, a replacement for SQL. To be explicitly clear about this, whilst DBAs are, of course, free to use LINQ if they so wish, there is no suggestion that it will become their language of choice.

For programmers, one of the best resources I've found for getting one's brain around LINQ is the intriguingly labeled 101 LINQ Samples for Visual C# that can be found here. Intriguing, why? Because there are actually 99 samples. Oh, those Microsoft clowns.

So does LINQ open the door to a pain-free world? I never said that. Most people would agree that there is an "impedance mismatch" between general-purpose programming languages and databases. We can, though, essentially address this problem from either end.

The Power of One eBook: Top reasons to choose HP BladeSystem

More from The Register

next story
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
EU dons gloves, pokes Google's deals with Android mobe makers
El Reg cops a squint at investigatory letters
Chrome browser has been DRAINING PC batteries for YEARS
Google is only now fixing ancient, energy-sapping bug
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Reducing security risks from open source software
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.