Krishnan Subramanian wrote:

> ...

 >

> Taking the case of value objects, if an entity bean creates a value
> object (representing its CMP or subset of CMP fields) and returns this
> value object to a session bean in the same process using PbR
> semantics, I still cannot modify immutable CMP fields by just setting
> these in the value object. Performance of course might be faster
> because the ejb container does not perform a copy of the value object
> when returning it to the session bean via its local interface,
> but as an ejb developer, I cannot do any fancy PbR thingies with
> the value object unless of course I use mutable objects as CMP field
> types.


If you call:

    myValueObject = myEntity.getValueObject();

then it is agreed that setting fields on myValueObject does not directly
change the corresponding CMP fields, you would need to add:

    myEntity.setValueObject(myValueObject);

to apply your changes. However these get/set methods (for a large
value object) would perform much better.

Also, quite apart from performance considerations one of the key
requirements for value objects are where pass-by reference semantics
are 'required' to support passing of local object references between
beans. Local object references cannot be marshalled.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to