The Source for Java Technology Collaboration

Home » java.net Forums » JavaDesktop Announcements » JavaDesktop Product Announcements

Thread: jga: Generic Algorithms for Java release 0.8.1

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 0 Threads: [ Previous | Next ]
david_hall

Posts: 153
jga: Generic Algorithms for Java release 0.8.1
Posted: Sep 16, 2009 6:59 AM
  Click to reply to this thread Reply

[nobr]jga is a functors library: the intent is to explore and exploit functors as a design and implementation tool to reduce boilerplate coding. A functor is an object that encapsulates a function or expression: it can take arguments and produce results, as can any method, expression, or function (in other languages that support functions). Unlike an expression, as an object it can be passed as an argument without being executed; it can be persisted to a database or file; it can be serialized and passed from client to server (and back); and it can be instantiated at runtime based on information unavailable at compile-time.


How many times have you...


  • ...found a method that does almost exactly what you want, except for one or two lines?
  • ...created a new class in order to override one simple method, because it is almost what you need?
  • ... written a boilerplate implementation of an interface that knows about your specific business objects or your specific application?
  • ... copied an entire class to change the one line or method rather than refactoring it?

Functors provide a mechanism that can reduce all of the design problems: they allow you to (in effect) pass a line of code as an argument to a constructor or method, giving you a way to parameterize objects on simple behavour.


The hilights of this release are;


  • More support for variable length Functors in the API and in JFXG. Functors now support compound forms, allowing arguments to be bound, generated, or computed by nested functors.
  • New Algorithms: Flatten (return the contents of two dimensional data structures in a single iterator), Compare (compares the contents of two data sources), and Summarize.lookup (returns the first value in a data source that meets some arbitrary criteria).
  • JFXG is now a JSR-223 compliant scripting langauge, with additional support for functors that take an arbitrary number of arguments, local variables, and assignment forms.

The release can be obtained from:
[/nobr]




 XML java.net RSS