• Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization vs marshalling  RSS feed

 
Shanmuga Raja
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between Serialization and Marshalling?



Thanks
 
Cay Horstmann
author
Ranch Hand
Posts: 197
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization is a general technique for converting objects to sequences of bits that can be transported to a different VM. Core Java vol. 1 chapter 12 shows how you can peek into the bit format if you are so inclined.

Marshalling means bundling up parameters for a remote method call. Under RMI, marshalling uses serialization. Under SOAP, marshalling uses an entirely different approach, translating parameters to XML. (See Core Java vol. 2 chapter 5.)

Finally, I'd like to make a pitch for long-term JavaBeans persistence, which is similar to serialization, but it works even when the participating classes evolve over time (Core java vol. 2 chapter 8.)

Cheers,

Cay
 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization is process of breaking the object(to be sent across network) into form that can be sent across the network (that is converting it into to a sequence of bytes).

Marshaling is process of encoding object to put them on the network (on one end) (and then Unmarshal the object to decode the object and place it in the address space on the other end).

In distibuted environment, while sending the object from client to server side, the object is marshelled on stun side , sent across the network and on skeleton side its unmarshelled (given to server for necessory processing).

Once the processing is done by server the response object is marshelled by the skeleton , sent across the network to the client and hece to stub and again unmarshelled and given to client.

So basically marshelling is encrypting phenomenon while transeferring the object on network.

Necessarily, before sending the object across network , it must be serialized.

And Marshelling is next step of sending the encrypted object(which is serialized) across the network.
 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization is process of breaking the object(to be sent across network) into form that can be sent across the network (that is converting it into to a sequence of bytes).

Marshaling is process of encoding object to put them on the network (on one end) (and then Unmarshal the object to decode the object and place it in the address space on the other end).

In distibuted environment, while sending the object from client to server side, the object is marshelled on stun side , sent across the network and on skeleton side its unmarshelled (given to server for necessory processing).

Once the processing is done by server the response object is marshelled by the skeleton , sent across the network to the client and hece to stub and again unmarshelled and given to client.

So basically marshelling is encrypting phenomenon while transeferring the object on network.

Necessarily, before sending the object across network , it must be serialized.

And Marshelling is next step of sending the encrypted object(which is serialized) across the network.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

marshelling is encrypting phenomenon while transeferring the object on network

Actually, it is not an encrypting, rite? It should be just, say, a hasing process, or just a transformation.

Nick
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd treat them as near enough synonymous to not worry much about the difference. Java's "serialize" method is a particular form of serialization that is Java specific and provided in the JRE. You could write your own code serialize to XML or some proprietary format to communicate between different languages. Marshalling is usually discussed with RPC, but I'm not sure that's really essential.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!