25 März 2008

Quaere == LINQ?

A few weeks ago I discovered LINQ in C# .NET. This is a very nice lean approach to integrate queries into the language. Here's an example:

var emps = from emp in edb.Employees
where emp.name.StartsWith("S")
orderby emp.name
select emp;

foreach (var emp in emps) {

Today I found Quaere that seams to be the same:

Iterable groups = from("city").in(cities).
for (Group group : groups) {
Unfortunately it's far from beeing the same, because LINQ in C# is strong typed! emp in the first example is a variable but city in the second is a string!

It needs a lot of integration in the programing language to achieve the functionality of LINQ as it is done in C#.

Maybe Sun will integrate LINQ as well in Java. We'll see ;-)

So the answer of Quaere == LINQ? is FALSE!

Keine Kommentare: