My favorites | Sign in
Project Home Downloads Wiki Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

News

11/05/2009: fluentjava 0.3 Released.

The whole EnumerationProtocol was implemented, as you can see here, with a little closure coercion as well. Fluent Sets, Fluent Maps and Fluent lists can be easily be created from other collections libraries. Lazy methods on enumeration protocol, so that you can cascade, filter, map, take and only invoke the actual closures when you actually need the result. And much more.

Get started here.

Introduction

Project that attempts to reduce the verbosity, lack of fluency and unfriendly interface that is common to several tasks in Java, such as:

  • Blocks of code manipulation (Closures)
  • Collection manipulation
  • Reflection
  • Input/Output
  • Raw Type conversion

Next few Steps

  • Really planned list
  • Deprecated as 14/01/2010 by Mark Reinhold's assertion that lambda expressions or even full blown closures will be brought to java7. Ok, evidences are (here, here and here): java 7 will very likely not have closures, which made me reconsider adding it to this project, while making it backwards compatible with all the bringing closure to java attempts. Automatic object to Closure coercion is vital to this, and little AOP can make it even more fluent.
  • New File-like returning reades/writers, streams, and ExtendedIterators for paths and lines of content for simple files/Files for directories (many features are already included on commons-io, but all as top-level functions). Fluent style.
  • Make Files a Composite: File-like structure composed of folders and files.
  • Mirror getting Maps as input/output
  • Mirror being able to convert types like Spring does on its IoC
  • Fluent output. System.out just doesn't cut. Also use Xstream to allow output of any object in XML format.
  • Generic Decorators that turn any object into Serializable (via Xstream in the generic case) and Comparables (receiving Comparators)
  • Create Order objects, which require only lessThanMethod to be implemented (no more 0, -1 or negative, or +1 or positive that Comparators need). Comparator built from Orders. Inspiration: Python.

General Concepts

A few links to clear things up.

Similar Projects

  • Apache Commons (formerly known as Jarkata Commons): similar feature-wise mostly to the features encompassed by commons lang, commons io and commons collections.
  • Jaggregate: great project of Smalltalk-like collections. The project has its downfalls though, such as using Java collections classes names, which can be confusing.
  • Generic algorithmns for java: closure api to Java. Still not as terse as real smtalltalk, python, ruby or scheme's syntax, but provides quite a few pre-made closures.
  • Google collections: also provides some closures, not as much as jga. Has several kinds of collections though, and several utility methods on them as well.
  • Hamcrest Collections: very fluent interface for collections. Development is still at the beginning, and uses a lot of Global Scoping technique, which mostly comes from Hamcrest.
  • http://functionalj.sourceforge.net/: Another project that tries to bring functional programming to java world. Yeah google did it a long time ago, and Hadoop did it again. Yes, map and reduce are functional concepts.
  • gparallelizer By using Groovy, it wrapps around Fork-join and make it more usable.
Powered by Google Project Hosting