• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialization in Java

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Could anyone please help me to know real world example of where serialization is required.
Actually i'm looking for where persistent data is used in real world application, but i think need of serialization would also help me in clarifying this?

I tried to find on google but did not satify.

Please help in this.

Thanks in Advance.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There might be many uses of serialization. You can use it to transfer data from one machine to another or use it as a replacement to a DB (although there are many features in a databases which are not in serialization)...
 
K. Tsang
Bartender
Posts: 3457
14
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Shukla wrote:Could anyone please help me to know real world example of where serialization is required.
Actually i'm looking for where persistent data is used in real world application, but i think need of serialization would also help me in clarifying this?


Hmm There are many real examples when you need serialization. Bank account withdrawals, database modification, etc.

Persistent data? That would be what I'm been doing lately I guess. Imagine a plain file and many clients accessing this file wanting to read and modify data in it. If the read/modify is not synchronized, clients will deadlock waiting to read/modify data because clients are waiting for the lock of the object in order to continue.

Hope this helps.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization is never "required" - there are always other ways of achieving the same purposes. Long-time persistence in particular is not something I'd use serialization for.

Note that Java has two built-in serialization mechanisms: the binary Java-only way using the Serializable interface and Object[In|Out]putStream, and the XML way using java.beans.XML[De|En]coder classes if the Java object follow JavaBean semantics.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic