I would love to use closures in Java. I have read that they may or may not make it into Java 7. But an open-source project called functional-java has implemented functional features including closures.
How safe would it be to use such a library in an enterprise production app?
Is there a better way to add closures to Java currently?
If you are looking for a lighter solution to have closures in plain Java check out the lambdaj project:
http://code.google.com/p/lambdaj/
Closures will definitely not make it into Java 7, due to a lack of consensus around a single implementation. See here.
The Functional Java library is thoroughly tested and actively developed. If you browse the source you will see that it's just simple bog-standard Java, and there's not a lot that could go wrong. I know at least one mission-critical enterprise app that uses it in production. This application has more than a million users.
Go for it.
Functional Java does not requires that you use closures -- the source compiles with any Java 1.5 compiler. Functional Java is far more complete than Google collections and just happens to allow you to use it well with BGGA.
Hope this helps.
I think you are looking at this issue from the wrong perspective.
I would love to use closures in Java. ... How safe would it be to use such a library in an enterprise production app?
Your decision making on what technology to use in an enterprise production app should be based on what is going to be best for the enterprise in the long term. You should be asking questions like:
In general, statements like "I would love to use Xxx" should have no place in enterprise decision making. (There are counter-examples; e.g. startups that bet the company on some new technology, but the real success rate is ... umm ... open to speculation.)
To sum it all up, if you are building enterprise production apps, you need to be conservative, and resist the temptation to use shiny new technology "for fun". Try to think like an IT manager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With