openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phill Moran" <>
Subject Forced getter/setter access
Date Wed, 04 Apr 2007 05:01:42 GMT
Can anyone explain why this rule is in effect:

When using property access, only the getter and setter method for a property
should ever access the underlying persistent field directly. Other methods,
including internal business methods in the persistent class, should go through
the getter and setter methods when manipulating persistent state. (section 2.1.4
OpenJPA manual)

This seems rather execution costly. If ,for instance, I have a Size class with
hieght, width and length then to calculate and return volume I suffer a three
method call overhead:
return getWidth() * getLength() * getHieght();

This is opposed to a more efficient

Return height * width * length 


View raw message