Re: is serialization really a performance hog?



Daisy wrote:

To implement Externalizable, we would have to send reference objects
separately,

No you don't, you can just call out.writeObject()/in.readObject() inside the writeExternal/readExternal methods respectively and they will be completely reconstructed.

then use some unique identifer/lookup like hashcode to
re-associate the reference objects at the client.

Unnecessary, see above, serialization will do that for you.

QUESTIONS

I wouldn't serialize the simple object. I would just send its five fields directly with the methods of DataOutputStream/DataInputStream, and use serialization just for the context objects. If they're also simple I would send their pieces directly too.

3. Does inheritance complicate serialization?

Not much, it's just a recursion, not much different from handling the reachable objects actually.
.



Relevant Pages

  • Re: Serialization, RMI and deep copy
    ... However you don't have to *explicitly* serialize anything at all, RMI ... > vs what the store now contains). ... > a client of the store and can insert configuration changes. ...
    (comp.lang.java.programmer)
  • Re: Serializing XmlDocument to SerializationInfo
    ... Are you worried about the size of data being transmitted to/from a remoting client? ... If you are using binary serialization over Tcp that will help to decrease the size of messages transmitted to/from a remoting ... Just add the stream reference to the SerializationInfo with a custom key like, ... and serialize a path string. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: problem in InvalidCastException-Return argument has an invalid type
    ... DataSet is always serialized to XML. ... DataSet is not shared between the client and server. ... always serialized to XML, so you can just use WriteXml to serialize it ...
    (microsoft.public.dotnet.framework.remoting)
  • RE: Updating DB with large collections
    ... Large sub-objects –that is an object which is contained in the main object ... this seems like a complex solution to what I imagined should be quite common ... These entities are being sent to the client - where the user might ... I've tried to serialize my arraylists - both ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: problems returning ArrayList from webServices
    ... - Collections are always serialized as simple arrays. ... If you want to serialize as a specific collection class rather than just an ... On the client side, ... > instead of return an ArrayList object, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)