jedi

Jedi

A functional programming library for Java

Jedi provides a library of routines inspired by more powerful languages such as Lisp, which support first order logic, filtering, iteration, type conversion of collections, etc. It makes extensive use of higher order functions and closures (also known as ‘blocks’ or ‘lambdas’), but the key is that you do not have to write them yourself.

The problem with closures in Java is that, while they really represent functions, they must be presented as objects. Since methods / functions are not first class objects in Java, any closure must be ‘wrapped’ in an object, which means creating a class, either named or anonymous. Jedi helps with this by providing JDK 1.5 annotations which will generate the necessary code. If annotations are used, JDK 1.5 is required at build time. However, the compiled code can be run under JDK 1.4 (using the javac -target jsr14 flag). No use is made of JDK 1.5 APIs in the generated code or the Jedi APIs, although generics are used to great effect.

The generated code supports unit testing by providing several different ways to inject dependencies. You can therefore select the mechanism which supports your style of programming and testing.

Jedi has been developed principally by three comitters with a few others making contributions here and there. It is about 1 year old and has been used on four investment banking projects and a project for a large ISP.

Powered by OpenXource Xircles™ (Version: 0.1-04d84d4433367a63a98bcfea427a04658ee0d936)