• Post Reply Bookmark Topic Watch Topic
  • New Topic

Serlization?  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In simply laymen terms what is serlization ?

And what can it be used for ?

Examples would be great, not asking for coding.
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In broad strokes, serialization is the process of translating the state of an object from its in-memory representation at runtime to some other representation that allows it to be persistently stored or transmitted between systems over a network. Deserialization is the opposite i.e. reconstructing a runtime instance of a particular class with specific state, based on the serialized representation. In Java, the java.io.Serializable interface is a marker interface that allows this process to be conveniently performed by the JVM (with certain preconditions) for objects of a class that implement this interface. It uses a specific binary representation that offers little control. Another example would be the JAXB API, that allows translation of objects to and from an XML representation. This process is also commonly refered to as marshalling / unmarshalling.

As mentioned, this mechanism can be used for persistent storage of an object's state or to transmit an object's state across a network. An example of this could be a webservice that marshals an object to an XML or JSON representation and sends it as (part of) a response to the client. Another example would be HTTP session replication between servlet containers, where the HTTP session for a client is serialized and transmitted from one container to another container, allowing the two containers to handle load-balanced requests for the same client.
 
Mahboob Baig
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,

Still trying to understand how it would work in the real world.

I understand the fact your making data into object bytes ?

How is it helping or how can it be useful

Sorry if I am annoying you guys .
 
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Jelle Klap's post above:
Jelle Klap wrote:
As mentioned, this mechanism can be used for persistent storage of an object's state or to transmit an object's state across a network. An example of this could be a webservice that marshals an object to an XML or JSON representation and sends it as (part of) a response to the client. Another example would be HTTP session replication between servlet containers, where the HTTP session for a client is serialized and transmitted from one container to another container, allowing the two containers to handle load-balanced requests for the same client.


If that doesn't explain it to you then you will have to expand on what is confusing you about the above.
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!