Hi,
I'm reading Mastering
EJB Chapter 3, 4th ed. p66.
From what I understand, for remote clients, parameters are passed by value. This means that they are serialized, and the bean is uninterested in what the client does with the value, as the client is operating on a copy.
Now, EJB's also support a local view for performance. These parameters are passed by reference. This means that "if the bean does not want the client to modify the returned value, it needs to explicitly copy the return data into another variable and pass that to the client.". That makes sense.
"EJB does support both local and remote client views.... the bean developer is just required to define POJI (plain old
java interface) business interfaces for lo0cal and remote clients of the bean". That's fine.
"Alternatively, the same business interface can be used to serve both local and remote clients". But hang on... When writing a method used by both interfaces, how do I know whether parameters are coming at me in a value or reference form? Is the rule 'code for value if you don't want them changed, reference otherwise'.
I hope this question makes sense. Perhaps this is answered later in the book, but hey, I'm impatient. :-)