Most Read Latest News Blog Resources

Select * From IQF




October 1, 2005 — 
Microsoft’s Integrated Query Framework (IQF) and Language Integrated Query (LIQ)—code-named Project Clarity—are the most important low-level innovations in mainstream programming languages in a decade. Not since Java showed that memory management and machine abstraction could be combined with an easy-to-learn object-oriented syntax has there been such an appealing marriage of power and potential. Virtually every application accesses data, and a large minority manipulates XML, so IQF’s entry into the mainstream seems assured. Equally important, IQF revitalizes (indeed, for the mainstream, introduces) data-structure manipulation as a primary tactic in the development of functionality.

IQF is available to all .NET languages and provides a set of standard query operators that are “relationally complete,” that is, they support the six operations of selection, projection, Cartesian product, set union, set difference and rename. These operators work on any type that implements the generic type IEnumerable<T>, which may be called a “sequence type.” Types that implement this interface include arrays, generic collection classes, database query results and XML documents. For database and XML queries, there are separate subprojects charged with producing efficient implementations of sequences. Importantly, though, the intermediate and final products of a query are not a runtime hodge-podge of reflection-based generators, but real classes, with all the performance, typing and security advantages that stem from them.

At its implementation level, IQF is nothing more than a clever library built on top of the capabilities in the forthcoming .NET 2.0 Common Language Runtime. Indeed, many of the 2.0 changes within the CLR were made with IQF in mind. Anders Hejlsberg, whose title at Microsoft is “Distinguished Engineer” and who likely is the most respected language-level software engineer active today, heavily influences IQF, the CLR and, of course, C#. Suddenly, anonymous delegates, parameterized types taking predicate types, and lightweight code generation snap into place neatly.

There are still many, many details to be gone over as IQF preview bits become available: How is “diamond inheritance” handled when objects are joined? Will the query language satisfy both SQL and XQuery users? And, most important, will the semantics fit with the mental models of both object and data viewpoints?

Language Integrated Query is the concept of implementing IQF query operators within a particular .NET language. It’s not part of the Common Language Specification, which means that implementing LIQ is optional for language designers. At the recent Microsoft Professional Developers Conference, Hejlsberg previewed the LIQ features of C# 3.0, while technical lead Paul Vick said the next version of Visual Basic would have LIQ, probably with a “more SQL-like” syntax.

To support LIQ, C# 3.0 will gain type inferencing of local variables, a concise object initialization syntax, anonymous types, an even more concise anonymous delegate syntax for constructing expression trees, and extension methods that will allow new methods to be grafted onto existing types. Together these could well double the length of time to learn the C# language were they not so clearly tied together within the context of LIQ. Even so, the next few years will be busy for those who write books on C#.

Database access and XML manipulation are the sharp side of the wedge that will drive IQF and LIQ into common use. They are not, however, what most excites me. Those of us programmers who are of a certain age will remember that “Algorithms + Data Structures = Programs.” In the object-oriented age, and with more and more of the programming burden shifted onto libraries, the idea that the connections between objects are as important as the objects themselves has been lost. Yet I would think that every programmer has experienced the triumph of a knotty problem suddenly giving way when the data is stacked in a new way.

I was briefed on IQF and LIQ by Hejlsberg and Vick a few weeks prior to the PDC. I had trouble following some of the demos, because even though the demos were focused on straightforward data access, my mind continually ran off on tangents: What about a parser-construction kit based on this? What about classes dynamically stitched from applying “expando” properties to recursive queries of XML hierarchies? What are the implications for CLRs hosted inside a database? How can they get good performance when creating dynamic types on large datasets?

I expect that IQF and LIQ will be recurring topics in this space, and I’d love to hear your thoughts on the subject, pro or con. For the moment, I have rarely been more eager to get my hands on a tool.

Larry O’Brien is a technology consultant, analyst and writer. Read his blog at www.knowing.net.


Share this link: http://www.sdtimes.com/link/28886
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading



 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 3/15/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Google Code turns 5
Google Code Turns 5, and adds a Paxos Algorithm to make the system more stable and reliable.
03/17/2010 11:16 AM EST

Test your Visual Studio 2010 know-how
Microsoft is offering free beta certification exams for Visual Studio 2010.
03/17/2010 11:08 AM EST

Microsoft lifts the hood on IE9
Microsoft is previewing IE9.
03/16/2010 01:10 PM EST

 

Events calendar tab
3/22/2010 to 3/25/2010
Santa Clara, Calif.
The Eclipse Foundation

4/12/2010 to 4/14/2010
Las Vegas
Penton Media

4/12/2010 to 4/15/2010
Santa Clara, Calif.
O'Reilly Media

4/19/2010
New York City
Flagg Management

4/25/2010 to 4/28/2010
Overland Park, Kans.
IIUG