[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help



On Sat, 29 Apr 2000, Mahesh Halyal wrote:
> Thanks for your reply. Can u please help me in defining
> this serialVersionUID.
> 
> I will explain u my problem.
> 
> I have an interface named "ozoneSave" which extends ozoneRemote,
> it has one update method to store my object, and another method
> to get that object, namely getPart & savePart respectively.
> I have a class called "ozoneSaveImp" which implements "ozoneSave"
> interface and extends ozoneObject. This class implements the methods
> declared in interface.
Is the class that you want to store (probably Part or something) a database
class itself? If no, then your design is not very ozonish. You should making
Part a database class instead of having a container that con store/fetch a Part
object.

> 
> Now where do I declare this variable serialVersionUID ?
> in ozoneSaveImp or in the java object ( PartSaveImpl.java)
> which I wants to store ?
In all database classes (classes that extend OzoneObject).

> 
> How do I compute the value of serialVersionUID ?
The value is meaningless.

> 
> Is it that simple so that I just declare a single
> variable called serialVersionUID with some
> value and my existing code will work fine ?
Yes.

> 
> Are there any default values to be used
> for serialVersionUID. I am using jdk1.2
no.

> 
> I know I am bothering U too much, but please bear
> with me and clarify my, hopefully last set of doubts.
No problem. Please send your questions to the list next time.


Falko

> 
> Thanks and regards,
> Mahesh
> 
> Falko Braeutigam wrote:
> 
> > On Fri, 28 Apr 2000, you wrote:
> > > Hello,
> > >
> > > I am using ozone for saving my java object.
> > > I would like to clarify few of my doubts.
> > >
> > > I am saving java object in to a ozone, suppose
> > >
> > >     1. If I just recompile the entire package
> > >         including the stored object without any
> > >         modification, Is it possible to read the
> > >         old objects stored before recompiling.
> > Yes, if there are serialVersionUIDs defined in the code of the database classes.
> >
> > >
> > >     2.  If I add new methods only in the object
> > >         to be stored, and compile it, then
> > >         in this case is it possible to load
> > >         the old objects ?
> > Yes, if...
> >
> > >
> > >     3. If I add a new member veriable to
> > >         the object to be stored and compile
> > >         it, then  in this case is it possible to
> > >         load  the old objects ?
> > Yes, if...
> >
> > >
> > >       Overall My question is when it is not
> > >         possible to load the old objects from
> > >         ozone ? if so are there any ways
> > >         to restore the old objects ?
> > This depends on the serialization mechanism that you use. If you are just using
> > Serializable then it's not possible to change the type of a meber or remove it
> > and then loading old data with new classes.
> > If you are using Externalizable to to serialize your objects than its
> > completely up to you to define the stream format. So you can always add code
> > that deal with backward compatibility with old object data.
> >
> > Falko
> > --
> > ______________________________________________________________________
> > Falko Braeutigam                         mailto:falko@softwarebuero.de
> > softwarebuero m&b (SMB)                    http://www.softwarebuero.de
-- 
______________________________________________________________________
Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de