O'Reilly logo

Component Development for the Java™ Platform by Stuart Dabbs Halloway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.8. Object Replacement

Both object streams and objects themselves have the ability to nominate replacement objects at serialization time. This object replacement feature has many uses. If your object graph contains an object that is not serializable, you can replace it with an object that is serializable. If you are doing distributed programming, you can replace an object's state with an object's stub, causing the receiver to get a reference to the remote object, instead of a local by-value copy of the object. RMI uses object replacement for this purpose. Replacement may also be useful if you want to add additional semantics to serialization that go beyond the capabilities of the readObject and writeObject methods.

4.8.1. Stream-Controlled Replacement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required