Having played with this a bit, I have a better handle on the problem now. I also have a much richer appreciation for what CDO does for me ;-)
Making the client objects work on the server seems doable, but does require either changes to the velocity templates or the context provided to them. Right now, the issues I see are: 1) Serialization -- Fields are controlled by getters/setters and as such should probably be marked transient, allowing a fault to resolve values upon deserialization. 2) Runtime relationships -- Need to have accessor methods in superclass. Likely requires change to context. 3) Reverse relationships -- Need some way of handling this in the superclass that doesn't produce a recursive loop. #1 I've addressed locally by marking the fields transient. There's probably a better way of handling this, but it works for now. #2 I've addressed locally by modifying the data map to specify all reverse relationships. #3 I haven't dealt with yet. A rough approach is to have public accessors that take the single target parameter and a set of private setters that take the target plus a Boolean that indicates whether to set the reverse relationship. This could be done all in the velocity template and would take care of the recursive call problem. -- Kevin -----Original Message----- From: Andrus Adamchik [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 3:53 AM To: [email protected] Subject: Re: Cleaning up ROP Hi Kevin, CayenneDataObject approach is fundamentally different from other persistent object implementations that are all variations of POJO. So I think a different approach may work better - using current client objects on the server (instead of using current server objects on the client). Andrus
