Small property support. (original) (raw)

Ruslan Ruslan.Lazukov at digia.com
Wed Mar 18 07:23:54 PDT 2009


Hello.

David Goodenough wrote:

On Wednesday 18 March 2009, Ruslan wrote:

Hello.

Yes, i have read it. But we are trying to fix different things: - You are trying to get rid of strings in "Beans Binding of JPA Criteria API" As a matter of interest, how would I pass a property reference using your proposal? My proposal have another goal. Goal is to have synthetic sugar like for-each for property. And in my case there is not property reference, so you can not pass it.

Property references can be added at next release (5 years later ;) ).

- And my point is to make property code readable and get rid of getters/setters when use Dependency Injection.

For simple getters and setters, my proposal does actually get rid of getters and setters, in that the Property object will do the work for you using the Field get and set (and some snake oil to handle PropertyChangeSupport). Yes, that is true. And my proposal are not using Property or Field. It's like macros for property get/set generation. David PS my goal is to avoid situation like this: private int i;

public String getI() {
    return Integer.toString(i);
}

public void setI(long i) {
    this.i = (int)i;
}

What is the type of property 'i' ?

private int i;

public int getJ() {
    return i;
}

public void setI(int i) {
    this.i = i;
}

IS everyone see that there is not getter for 'i' - we have getter for 'j'. But compiler will not fix this error, because it is a logical error, not language.

Ruslan.



More information about the coin-dev mailing list