Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BEANS @@  RSS feed

 
ankush walia
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI EVERYONE;
WHY IS IT THAT EVERY BEAN SHOULD EXTEND FROM
"SERIALIZABLE INTERFACE"??AND WHAT EXACTLY IS SERIALIZATION??
ANKUSH!!!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java objects only exist in RAM. When you turn off the computer they are gone. If you want your object to be remembered from session to session you need to find some way of saving it. This is called persistance.
Serialization is taking the object and converting it to a bit stream that can be saved on a storage device (like your hard drive). The during the next session you can have code that reads it back in and re-creates the object in RAM.
I would attempt to answer the part about beans being required to implement Serialization, but I really don't know beans about beans (weak attempt at humor).
I will move this question over to J2EE and EJB (the forum on beans) and hope that they are more imformed.
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Implementing the Serializable interface is simply a specification, that is, if your class doesn't implement Serializable, it is not a JavaBean, by definition.
There are other things your class must do to 'legally' be a Bean. You can download the specification from http://java.sun.com/products/javabeans/
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!