• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

What is Serialization?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is serialization? What is the point of making Transient fields non-serialized. Where do we use serialization for a real-world project.
Thank You.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sriram...
Serialization is a process of saving the state of an object or variables etc to a persistent storage and is useful to send them over network.
As far as I know, this is highly useful in RMI: remote method invocation. You're invoking methods remotely from JVM space 'A' on objects which are in JVM space 'B' -- possibly running on another machine on the network.
To make this happen, all arguments of each method call must have their current state taken out of JVM 'A' memory, flattened into a byte stream which can be sent over a TCP/IP network connection, and then deserialized for reincarnation on the other end in JVM 'B' where the actual method call takes place.
If the method has a return value, it is serialized up for streaming back to JVM A. The easiest way to do this is to make sure all your classes implement java.io.Serializable.
Hope this helps to a certain extent.
Thanks
Radha
 
Radha Damera
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sriram...
Serialization is a process of saving the state of an object or variables etc to a persistent storage and is useful to send them over network.
As far as I know, this is highly useful in RMI: remote method invocation. You're invoking methods remotely from JVM space 'A' on objects which are in JVM space 'B' -- possibly running on another machine on the network.
To make this happen, all arguments of each method call must have their current state taken out of JVM 'A' memory, flattened into a byte stream which can be sent over a TCP/IP network connection, and then deserialized for reincarnation on the other end in JVM 'B' where the actual method call takes place.
If the method has a return value, it is serialized up for streaming back to JVM A. The easiest way to do this is to make sure all your classes implement java.io.Serializable.
Hope this helps to a certain extent.
Thanks
Radha
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sriram
I give the explanation in layman terms which may be useful for understanding the concept....My way....
Serialization is a process of making a logical numbering of (putting series of connecting numbers to info,like S.No for a set of table rows)the information.What happens in a network environment, the information is not sent as we write or see.Information is pickedup by the processor by its own logic and sent.
What java does is, it breaks info by its own logic and to add the information correctly it gives connection logic to the broken information.When the information need to be gathered or collected or grouped the java again uses its own logic to assemble the information.
This process is called serialization.As explained by other member in this forum, it is widely used for distributed environments.
In fact this works alongwith TCP/IP protocols.
Fo example you write a letter to your friend.You break the letter in topieces and put in an envelope.You post enevelope to your friend with a clue to assemble all the pieces of the letter.The clue is nothing but the Java Serialization Technique.There are some rules and regulations or logics to make your letter in to pieces and guide lines to assemble back.They are in JVM which you and I can't see.
I hope you understand.
 
Sriram Vadlamani
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you Guys. That really cleared helped.
 
Sriram Vadlamani
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So why do we make transient fields non-serialized. I understand to save the state and not break it up. But how can the non-serialized object be used over a network AS-IS?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic