aspose file tools*
The moose likes Servlets and the fly likes can someone explain implements Serializable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "can someone explain implements Serializable " Watch "can someone explain implements Serializable " New topic
Author

can someone explain implements Serializable

Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
I have a javabean that deals with connections to a backend server. On the web site, every jsp page hits the bean if i implement Serializable will this improve performance?


SCJO, SCJD, SCWCD, I-Net+, A+, Network+, MCSD, MCDBA, MCP, MCT
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
No it won't improve performance. Why would you think it would? All that happens when you implement Serializable (which, remember is a "Tag" interface that does not define any methods) is that that object can now be Serialized to a Stream or File by the Java object Serialization framework. That is useful (for instance) if you are using Session clustering of any sort, since session clustering mechanisms either (a) Serialize things to a stream to send them from one machine to another or (b) Serialize them into a Binary Large Object column in a database so it can be shared among multiple application servers.
So, while making your objects stored in your sessions serializable won't improve performance, it *may* improve the scaleability of your app, which is a related matter. However, you must remember that things like back-end connections CANNOT be serialized at all. They must remain transient. So if you have a lot of set-up data, or some cached data from the back end, this may help, but if you don't then it won't even help scaleability.

Kyle
[ April 20, 2002: Message edited by: Kyle Brown ]

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Greg Whelan
Ranch Hand

Joined: May 18, 2000
Posts: 52
Out of curiousity, do you know if there is a predominant implementation approach? Sending by stream or BLOB?
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Neither is predominant. Just read your Application Server's documentation to see which one they use...
Kyle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can someone explain implements Serializable