Here's an interesting concept that I'm trying to sort out in my head..

Passing objects by value - creates a copy of the object and changes made to that copy aren't reflected in the original value.

Passing objects by reference - passes a reference to the original object and changes made are reflected immediately.

Passing Serializable objects by reference - The object is actually passed by value, but the .Net Framework treats the copy as a reference to the original object. Changes made to the copy are passed back to the calling code when the operation is complete and then the original object is replaced with a reference to the new copy!

Previous references made to the original object still point to the original value so there is the possibility of having two copies floating around at this point. Should we follow a true SOA model, encapsulating our logic so that we are only exposing the contracts, this is perfect for distributed environments.

Serializable Contact object instantiated in client app domain -> passed to application server where data access methods are called and attributes populated -> passed back to client. This allows for perfect n-tier distributed implementations.

With the Framework itself determining when to create that additional copy (e.g. it will not create a seperate copy if passed within the same machine from layer to layer), this seems like the way all object-oriented systems should work..

I wonder how Java handles that?