No question, this can be useful. Where this gets in the way is with
our elusive goal of providing persistence for POJOs without a
framework-mandated superclass.
The good news is that ClassDescriptor design can accommodate any type
of objects (as long as you can force it to use ObjectContext
callbacks). So while it is beneficial to eliminate object structural
gap between ROP and "normal" Cayenne, it looks like support of
separate hierarchies of POJOs (preferably without framework
superclass), and generic objects is in our future (unless we totally
give up on the POJO idea and keep extending CayenneDataObject
everywhere).
Now, if we do support both types of objects across the entire stack,
it will be a user's choice what to inherit from (and as a result
either use read/writeProperty methods or not).
Andrus
On Nov 19, 2009, at 1:12 PM, Andrey Razumovsky wrote:
2009/11/19 Andrus Adamchik <[email protected]>
Also Cayenne's own object access since 3.0 is fully based on
pluggable
ClassDescriptors, so declaring read/writeProperty on the object is
not
needed for Cayenne, and technically only the generic objects need
such
user-facing methods.
For that, I'll disagree. I've used DataObject.read/writeProperty a
lot in my
code for unified processing of DataObjects (non-generic) and prefer
those
method stay in interface (moreover, appear in client-side objects).
Vice
versa, read/writeProperty methods should through ClassDescriptors