• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Bean class is inherited from Serializable interface?

 
Soumya Rout
Ranch Hand
Posts: 49
Java Java ME Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could any one make clear this in detail ?

 
Jitendra Takalkar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization is the process of converting an object into a sequence of bits (binary). it can be persisted on a storage medium or transmitted across a network. Bean classes mainly used as a reusable components and can be transfer across a network, Thats why Bean class is inherited from Serializable interface. In the trasmitted network JVM reread the sequence of bits (binary) and for the instance of object again.
 
Soumya Rout
Ranch Hand
Posts: 49
Java Java ME Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I compare the model class (The helper file ) with the Bean.

Coz both are having get and set methods?
 
Jitendra Takalkar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can compare Bean classes.
Please refere org.apache.commons.beanutils.BeanComparator for more details from Apache commons - Apache Common BeanUtil
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jitendra Takalkar wrote:Serialization is the process of converting an object into a sequence of bits (binary).

I'd be happy if this read:
Serialization -as it relates to the Serializable interface- is the process of converting an object into a sequence of bits (binary).

but as it is I'm going to quibble with the wording, because serialization doesn't have to result in a binary representation. These days, it's quite common to use an XML representation, for example when sending data through a web service. And especially for objects that adhere to the JavaBeans standard, it's much better to use the XMLEncoder and XMLDecoder classes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!