how to move from java object serialization to xml serialization?

  • Thread starter Dimitri Ognibene
  • Start date
D

Dimitri Ognibene

I've some classes that contains matematical models, I was used to save
and load them thorogh java serialization, now I wish to switch to xml..
can anyone help?
 
A

Andrew Thompson

Dimitri said:
I've some classes that contains matematical models, I was used to save
and load them thorogh java serialization, now I wish to switch to xml..
can anyone help?

Probably not until you identify a problem.
Did you have a specific question?

Andrew T.
 
J

Jean-Francois Briere

You could use the XMLEncoder XMLDecoder classes but it probably won't
fit your needs.
A simple Google with keywords "java xml serialization" gives XSteam at
the first result.
It's good. I've tried it in the past. There are others available
though.

Regards
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Dimitri said:
I've some classes that contains matematical models, I was used to save
and load them thorogh java serialization, now I wish to switch to xml..

JAXB maybe ?

Arne
 
D

Dimitri Ognibene

there is not a standard way to do this work?

Another think, I want to do this change because I could need to
change my java code, but still need the data I've obtained in an older
version...
so.. sometime the data are exactly the same, some time there are some
new fields,
which i would set by hand to default values in the serialized version..
but I can't even read
the file in the first scenarion with standard serialization, the second
scenarion is quite sci-fi :D
So I think xml could feet my needs...
but I've seen many way and many libraries to do this in java..
I'd like to do the change with less effort possible.
Thank you

ps.
I've seen http://java.sun.com/products/jfc/tsc/articles/persistence4/,
http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html and
some other sun reference.. just in this moment.. what are the pros and
cons of this class?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,166
Latest member
DollyBff32
Top