The Source for Java Technology Collaboration
User: Password:



Start New Message Post a Reply

Subject:  Wrong Direction
Date:  2007-02-06 14:25:53
From:  zero


why the hell does everybody want to ease the defintion of a property (get/set methods)? This is a one time effort and can be auto-genrated by the IDE.

Far more useful would be to improve using them. I'm more annoyed about:

<br/><br/>
vec.setX(++vec.getX());
<br/>
instead of simply doing: <br/>
++vec.x;
<br/>
<br/><br/>

I mean using JavaScript via the JavaScriptingFramework does a great job by allowing to access property as if they were fields.

Of course, if there is a field with the same name, it would have higher precedency:<br/><br/>


E.g.
vec.x
always references the field in following case, not the property:
<br/><br/>

class Vec {
public float x;

public float getX() { .. }
pulic void setX(float x) { .. }
}
<br/>

 Feed java.net RSS Feeds