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

Re: Upgrading ozone applications



> > class fooStore{
> >  int classVersion;
> >  Object oldMember;
> >  Object newMember;
> >
> >  void objectOnActivate(){
> >   if(classVersion < 1){
> >     newMember = oldMember;
> >     oldMember = null;
> >     classVersion = 1;
> >   }
> >  }
> > }
>
> But isn't that similar to my subversion-number-read/writeExternal-approach
?

In principle, yes.

I would just prefer to stay away from the serialization part of the classes,
because you might not always have access to them, if they come from a
different party. Sometimes serialization might also be used for tasks other
than storing to ozone.

Did you also propose to store the version ID with the objects? Sorry for
intrusion, I might not have read all the mails to this theme too thoroughly.


> The problem of Lasse is that oldMember becomes
> oldMember _and_ newMember. How
> would solve this ?

There is no problem in doing that with the above mechanism. In this case you
would of course also need to store the version ID of each oldMember with
each oldMember.

The point is:
The execution needs to be triggered by the stored ID, not by any other
conditions.

Kind regards,
Carl
---
Carl Rosenberger
db4o - database for objects - http://www.db4o.com