Which JDK is required ?

The version 1.1-SNAPSHOT requires jdk 1.5 to run. If you need a jdk 1.3 or 1.4 version, submit a request to trackers. It's possible to backport (or create another version).

[top]

Is it ready to use ?

I had applied the solution (public attribute + GetAndSetAdder) on a EJB3/JSF project. And it currently works. Because I'm a rooky in AOP, currently I keep few getters for computed property.

[top]
What are the advantages of public attributes (vs getXxx/setXxx)
  • It's the natural way to declare and use it (before the Getter/Setter practice). Other modern programming language (C#, D, ...) or scripting languages (Groovy, Beanshell) manage public attribute like property.
  • More readable declaration (no need of methods or annotations)
  • Less typing (declaration, call, javadoc) when you create a field (and no need to call IDE Generator), and you refactor it (with tool or by hand) : rename, remove, update comments...
  • Easy to keep attribute, getter, setter in synch (name, type, comments) : localized in one place
  • More concise/compact/readable code and javadoc (in source and html generated)
  • No more work than with getter/setter when the internal structure changes : 90% of the time get/set reflect the internal structure, and the caller must follow changes.
  • More readable for caller code (IMHO) (less (), visibles changes of attributes...)
  • Already compliant with IDE and compiler (javac)

And why not using public attribute ? it is in java since the beginning.

[top]

Why using GetAndSetAdder ?

There is lot of frameworks/libraries accessing properties by reflection (eg: view framework of web stack like jsf, velocity, freemarker,...)

[top]

Why using AOP ?
  • AOP tools allow to enhance/modify code when application try to read/write instance's attributes. So we think it's a perfect solution to decorate access to public attribute (one of the main cause of using getter/setter).
  • AOP allows to separate/centralize concerns. Some common cases where developper doesn't need basic getter/setter are:
[top]