The Artima Developer Community
Sponsored Link

Java Community News
Anders Norås Releases Quaere, a LINQ-like DSL for Java

1 reply on 1 page. Most recent reply: Sep 20, 2007 12:08 AM by Eirik Maus

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Anders Norås Releases Quaere, a LINQ-like DSL for Java Posted: Sep 14, 2007 1:35 PM
Reply to this message Reply
Summary
Anders Norås released the initial version of Quaere, a DSL for language-integrated queries in Java. Quaere provides language extensions to filter, enumerate and create projections over collections and other queryable sources.
Advertisement

At the JavaZone conference earlier this week, Anders Norås released the initial version of his language-integrated query tool, Quaere. The key benefit of this tool is that it allows querying of Java collections and other queryable data sources based on arbitrary query criteria:

Quaere is an internal domain specific language that adds a querying syntax reminiscent of SQL to Java applications. The language is modeled [on] Microsoft’s Language Integrated Query (LINQ) project, which adds similar capabilities to a range of Microsoft .NET languages. The Quaere project allows users to use an internal DSL to filter, enumerate and create projections over a number of collections and other queryable resources using a common, expressive syntax.

The Quaere DSL is very flexible and it lets you perform a wide range of queries against any data structure that is an array, or implements the java.lang.Iterable or the org.quaere.Queryable interface.

In a blog post announcing Quaere, Norås compared several features of Quaere to Microsoft's LINQ project that provides language-integrated querying for .NET:

Quaere supports the same conversion operators as LINQ, the only difference is that some of the operators have different names to match the Java conventions better. For instance, if you’d like your query result to be a List you can do this:

String[] words = {"cherry", "apple", "blueberry"};
List sortedWords =
        asList(
            from("w").in(words).orderByDescending("w.length()").select("w")
        );

What do you think of Quaere, and of language-integrated querying, in general?


Eirik Maus

Posts: 15
Nickname: eirikma
Registered: Oct, 2005

Re: Anders Norås Releases Quaere, a LINQ-like DSL for Java Posted: Sep 20, 2007 12:08 AM
Reply to this message Reply
I was at the talk, getting the full presentation, and I must say I am really impressed. Quaere looks very promising indeed, and it will be even better when closures becomes path of java. It is currently based on fluent interfaces (rather than embedded language, like LINQ), but the difference is basically only that you separate the words with dots instead of spaces.

I'm sure we will use this in the next project.

Flat View: This topic has 1 reply on 1 page
Topic: Groovy 1.1 Beta 3 Released Previous Topic   Next Topic Topic: Lorenzo Puccetti on Event-Driven Architecture

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use