Linq
for the JVM
Irving Cordova
irving@irvingc.com
What is linq?
"an innovation ... that bridges the gap between the world of objects and the world of data"
(Microsoft)
What's wrong?
- Errors are found at run time
The Linq way
"You write queries against strongly typed collections of objects by using language keywords and familiar operators"
(Microsoft)
Has been attempted...
but it has not been really successful.
"In order to get Linq-like method-chain syntax in Java that looks and works like what's in C#, you need two things Java doesn't support; extension methods (static methods that can be applied to an instance as if it were an instance method), and lambda expressions (anonymous delegates)".
extension methods
in the JVM?
Why there is even a JVM language named around it :-)
My project
Bring LinQ to the JVM using Xtend.
The grammar
(just a segment)
currently implemented
- Support for "iterables" (no support for SQL connections or other types)
- Support for "select"
- Support for "where"
- Support for "min", "max", "average" selectors
- Support for "single"
The Road Ahead
- Stop losing type information
- Strong checking on the parameters inside the query
Questions?
Irving Cordova