Alibabra
Alibabra
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Originally posted by Alibabra Sanjie:
Thanks, but still not get it.
Let me rephase the question. If a method in a bean class has a reference type param or return, we should code the method differently according to the client view (interfaces) is local or remote, and we are passing the param or return will be by reference or by values. My question is how to code differently, or what is the difference?
Alibabra
Originally posted by Alibabra Sanjie:
[QB]Ok, if the client is local, my method return should be a reference, just like a normal Java return a reference. But if the client is remote, my method return should be a copy of value (assuming the return type is RMI/IIOP), do I have to do anything to make the reference to be a copy of value and return to the remote client?
That meant what you are trying to explain. I guess if the return type is RMI/IIOP, I don't have to do anything and simply return the reference. Right?!"...myClass which is RMI/IIOP compatible..."
Alibabra
Originally posted by Alibabra Sanjie:
At the my first posted question, I said: That meant what you are trying to explain. I guess if the return type is RMI/IIOP, I don't have to do anything and simply return the reference. Right?!
Alibabra
But you have to be more careful with local EJBs. If client get an object from an EJB and modifies a variable inside that object that variable will also be changed on EJB side. With remote EJB you don't have to worry about that. So your client code might be different depending if it is a local or remote client.
Alibabra
Consider Paul's rocket mass heater. |