|
Implement Serializable for remote processing makes sense for me. Tomcat's complain about my java bean is not Serializable threw me off a bit and got me thinking if I need to implement it on my java bean. I'm still learning java and web programming. Currently trying to create a shopping cart web app just to get my feet wet in these areas (need to brush up my html though. The screen looks ugly than a green screen. lol). From your responds, I don't think I need to implement Serializable yet. Unless, I want to create a very sophiscated one that like you mentioned. thanks for everybody's respond. -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]On Behalf Of Ivan Hurtado Sent: Monday, December 20, 2004 12:15 PM To: Java Programming on and around the iSeries / AS400 Subject: RE: Beginner java question: Serializable As long as that particular session is active you are correct that you do not need to serialize anything because you have your data stored as objects in the session scope. But what happens if the user walks away for lunch and his session times out? You would hope that the last state of the user's session was somehow saved in order to start him back up where he left off. The two commonly used methods to do this are to either store the data in a database, or to serialize the data just prior to the session being invalidated. Then when the user logs back on, your app can restore the data from one of those. Obviously, you're not going to serialize every instance of a serializable class... only when you need to. But in order to do so, you have to declare your class as implementing the Serializable interface, or as a sublass of something else that does so. FYI - As mentioned previously, serializable has been used for remote processing across separate JVMs, and is also used on occasion to clone objects. Cloning objects in java can be a bit cumbersome sometimes, especially with user defined objects. Serializable allows for a quick & easy save/restore mechanism. One word of caution though... serialized objects are a potential security hole for hackers. Once the data is serialized, it can be tampered with. So be careful where you place it. Thanks, Ivan Hurtado
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.