how to move from java object serialization to xml serialization?

Discussion in 'Java' started by Dimitri Ognibene, Sep 1, 2006.

  1. 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?
    Dimitri Ognibene, Sep 1, 2006
    #1
    1. Advertising

  2. Dimitri Ognibene wrote:
    > 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.
    Andrew Thompson, Sep 1, 2006
    #2
    1. Advertising

  3. 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
    Jean-Francois Briere, Sep 1, 2006
    #3
  4. Dimitri Ognibene wrote:
    > 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
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Sep 1, 2006
    #4
  5. 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?
    Dimitri Ognibene, Sep 2, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    2,240
    deadsea
    Jan 2, 2005
  2. Replies:
    3
    Views:
    1,024
  3. Eduardo78
    Replies:
    0
    Views:
    245
    Eduardo78
    Nov 3, 2005
  4. Ramunas Urbonas
    Replies:
    1
    Views:
    393
    Dino Chiesa [Microsoft]
    Jul 27, 2004
  5. Andrew Tomazos
    Replies:
    2
    Views:
    613
    Nobody
    Dec 12, 2011
Loading...

Share This Page