nikgoodley-ibboost / funcito

Automatically exported from code.google.com/p/funcito
0 stars 0 forks source link

how about lambdaj #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What are the advantages than lambdaj
http://code.google.com/p/lambdaj/

Original issue reported on code.google.com by haiping....@gmail.com on 26 Jul 2012 at 1:13

GoogleCodeExporter commented 9 years ago
They address different issues, so ti is kind of like comparing apples and 
oranges.  A better question might be "how does Funcito + Guava compare to 
lambdaj?" or "Funcito + Functional Java" or "Funcito + Jedi".  Funcito is not 
meant to provide the full framework to perform functional programming or even 
generalized solutions for applying functionality iteratively to collections.

It is meant as an add-on to existing frameworks with functional idioms that 
don't provide a run-time way of producing function-like-objects without 
requiring anonymous inner classes (noisy), String-based reflection and/or 
enforced naming conventions (possibly unreliable and/or not safe for 
refactoring tools), or APT annotation processing (can complicate builds and IDE 
integration).

Lambdaj is a very nice framework, and from what I have seen of it has some 
great features.  Believe it or not, when I came up with the idea for Funcito 
and searched to see if anyone had done anything similar, I did not initially 
find Lambdaj, even though I had searched pretty thoroughly.  I was actually 
technically inspired by the Mockito mock-object framework.  It wasn't until I 
was about halfway done developing v1.0 that I became aware of Lambdaj.  I had 
to decide whether to continue, and I decided that users of other functional 
frameworks could benefit from similar shortcuts to building their functional 
objects.  And it is *very* easily extendable to additional functional 
frameworks (see Issues for possible plans of additional frameworks that might 
be integrated in future releases).

So advantages?

1. Using one framework with one API (Funcito), you already know how to create 
functional objects wrapping methods for several functional frameworks and take 
advantage of their features which differ from Lambdaj's features.

2. I haven't looked deeply, but I assume that the Lambdaj depends on CGLIB.  
Funcito can use either CGLIB or Javassist for class proxying, *and* it can 
simply use Java dynamic proxies without depending on a bytecode provider at all 
if you rely solely on proxying interfaces.

3. Last, this is personal preference but I much prefer:

Function<CharSequence,Integer> length = 
functionFor(callsTo(CharSequence.class).length());

rather than:

Closure<CharSequence, Integer> length = closure(CharSequence.class); { 
of(this)length; }

I find the latter quite a bit more awkward, and less DSL-like to have to define 
things in a block following the closure declaration.

Thanks for checking out Funcito.  Lastly I'll just say this isn't really an 
"Issue" but more of a question (either for the Wiki, or for the users mailing 
list), and certainly not a defect.  So I am going to close this.

Original comment by kandpwel...@gmail.com on 26 Jul 2012 at 3:49