• Post Reply Bookmark Topic Watch Topic
  • New Topic

Its a bean iff....  RSS feed

 
Ryan Waggoner
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When your creating a bean, its said it always has to be serializable what does this mean exactly, and why must a bean has this property?
 
Edwin Keeton
Ranch Hand
Posts: 214
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serialization simply means representing an object, or specifically a "bean", as a stream of bytes. Doing this allows you to stream those bytes to a storage medium, perhaps your local file system. It also allows you to send the object or bean over a network to another system.

Later you can "hydrate", "inflate", or "de-serialize" your bean back to its original state.

The good news is that most of it occurs by magic. You simply declare that your bean implements the Serializable interface and use ObjectOutputStream and ObjectInputStream to move it around. Serializable is merely a marker interface that has no methods to actually implement.

This link has more information you may find interesting:


http://java.sun.com/developer/technicalArticles/Programming/serialization
[ July 23, 2007: Message edited by: Edwin Keeton ]
[ July 23, 2007: Message edited by: Edwin Keeton ]
 
Ryan Waggoner
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.

Would love to see that link
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!