In my experience with these technologies,

- Marshalling is used to describe taking the object(s) and making it
ready for passing it as a parameter in some invocation.

- Serialization is taking the object(s) and linearizing it for storage
(or transmission) so it can be recovered later.

These two are related in that you can use Serialization for Marshalling
arguments, but that is not necessarily the case.  The key issue is that
when you are doing a call, you can take into account, at call time,
information on the sender and receiver (plus the types, etc).  For
example, if the caller and the receiver are in the same space, the
marshalling process can just pass a pointer through.  The Spring OS (and
others) have done interesting things in this space.

- Externalization is very similar in spirit to Serialization.

In the Java Platform, tagging a class with Serializable and
Externalizable have very specific meanins.  In Serializable, the
top-level representation of the object is mandated by the Serialization
specification; the author of the class can control the details inside
the "top-level" (the preamble + others) but not that top-level.  In
Externalizable, the class author can control all the details of the
external representation.

Serializable is an easier to use interface, Externalizable gives more
control.  Part of the preamble in the Serializable format gives the
class name + hash information, etc, so one can deserialize an object
without knowing what is in there.

Informally, we talk about both Serializable and Externalizable objects
as serializable objects.

Taking a DOM object and representing it as an XML document cannot
correspond to a Serialization operation, although we can described as
'serializing'.  If you were to use the Serializable interface you would
get a preamble plus internal stuff.  The mapping can be done using
Externalizable, though.

We introduced both Serializable and Externalizable as part of JavaBeans,
and Noah was a key member of that team.  But we have not pursued
Externalizable as much as we should.  Hans Muller (now lead for Swing)
was also part of that team and also worked on the
Serializable/Externalizable area; Swing has been exploring some issues
in this space but nothing is really cooked yet.

Hope this helps,

        - eduard/o

Reply via email to