On Nov 27, 2006, at 2:58 PM, Raymond Feng wrote:

Hi,

The SCA spec says "Independent of whether the remotable service is called remotely from outside the process where the service runs or from another component running in the same process, the data exchange semantics are by-value."

I plan to add this support. To trigger more discussions, here are some points to brainstorm.

1) It will apply to a wire with remotable interfaces for the source and target.

2) We need to take "AllowsPassByReference" into consideration in the ServiceContract

3) An interceptor will be added to the invocation chain to enforce the "pass-by-value" semantics by data transformation if necessary

4) How we copy the value depends on the databinding for the given argument or return value of an operation. A databinding provider can implement the "copy" method to control how the copy will be made.
We should find a way to not make this necessary in the programming model except for maybe a few edge cases. This was related to the discussion a while back about not having to specify the data binding type as annotations. Like you mention below, in addition to cloning and serializable (maybe without the need to marshall class descriptors) we could support XStream for POJOs? I think the end user experience should be really simple and this copy will hopefully in 90% of the cases transparent. Also, we should probably tell people that they should use @AllowsByReference in all cases possible since performance of the copy will introduce significant overhead for remotable services.

   Object copy(Object source, TransformationContext context);

5) For objects without exlicit databinding (in which case, we assume it's plain java databinding), we'll use techniques: * Serilization followed by a deserialization (Serialize the data in source context and deserialize it in target context) * Cloning? (If the object is Cloneable, can we use the clone() to make the copy?)

6) Some optimaization can be applied, for example, for immutable jdk classes such as "java.lang.String" we don't have to make a copy
As one thought, it would be an interesting experiment to see if a copy-on-write strategy could be done and whether that would improve or degrade performance. For example, any interface-based parameter could have a proxy substituted. I'm not sure if this would degrade performance or make any improvements.

7) For composite services/references with bindings, can we assume that "pass-by-value" semantics will be automatically enforeced by the protocol layer for inter-process calls?

I would say yes, we leave this to the binding.

Any thoughts?

Thanks,
Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to