Hi all

Touching on an old subject that has now become more important with field-based 
Data Objects.

All of my DataObjects use accessor methods without the "get"-prefix. This was 
fine with Map Based data objects (where a MapAccessor would get property values 
by name), but now that my objects are field based, along comes BeanAccessor 
which is hardcoded to have every getter prefixed.

I propose that BeanAccessor be modified to allow accessor methods without the 
"get"-prefix. Methods with "get" would get precedence, but if no method with a 
"get"-prefix exists, check for the existence of a method with only the property 
name.

Although it's a minimal change in code, I realise it comes with a bit of 
potential baggage WRT testing. But this is not just to scratch a personal itch; 
once Cayenne 4.0 is out I want to start a large scale introduction of Cayenne 
to the EOF world where the get prefix is generally not liked and this change 
would have a big appeal. Besides, I'm not a big fan of the get-prefix myself, I 
find it a bit redundant :).

An alternative would be to adhere to the Bean standard, and make BeanAccessor 
read bean meta information (usually specified in *BeanInfo classes) and get 
names of getter/setter methods from there. But that would be a much larger 
change than just checking for a method with propertyName if the getPropertyName 
method doesn't exist.

What do you think?

Cheers,
- hugi

Reply via email to