JDK 8 and properties
scolebourne at joda.org
Thu Oct 6 02:28:38 PDT 2011
On 6 October 2011 09:18, Bruce Chapman <brucechapman at paradise.net.nz> wrote:
> On 6/10/2011 5:45 a.m., Loic Descotte wrote:
>> Yes lombok-like features would be great
>> It's a shame to be forced to use an external tool to do this :(
> I am fairly certain that a lombok style solution can be made to work in
> a standard way. If that is the case, then it is not a language feature
> at all.
Simply generating the getter, setter, equals and hashcode is only part
of the problem. There also need to be a way to enumerate/loop over the
properties. Without this, each framework will continue to write their
own "bean introspector".
My work in this area is Joda-Beans, http://joda-beans.sourceforge.net/
which uses simple but effective repetitive code generation (ie. not
one-off code generation). I'd love to have someone join the project
and write an Eclipse plugin to regenerate within the IDE and hide/fold
the auto-generated code. There is also an opportunity for someone to
add invoke dynamic for a Java 7 specific version.
Part of the purpose of Joda-Beans is to test out an API and design for
properties. Being used in OpenGamma http://developers.opengamma.com/
(a large open source stack for finance) is the perfect test.
More information about the coin-dev