Results 1 to 3 of 3
  1. #1
    XmisterIS is offline Member
    Join Date
    Aug 2010
    Posts
    35
    Rep Power
    0

    Default To serialize or not to serialize?

    I have a requirement to be able to read/write objects to/from an output/input stream.

    I suppose I can either use the Serialize interface, or I can write my own architecture.

    I do like the serialize interface because it's quick - with a few lines of code I can make an object serializable.

    BUT ... I forsee two problems (at least):

    1) it seems that were I to change any of my objects, then previously serialized objects of the same type can't be read back into new objects.

    2) the Serialize interface seems like a bit of a hack in its implementation.

    What I'd like to do is to write my objects out in XML format so that various pieces of information can be stored alongside the field data for the object (e.g. version number, the name of each field, to name but a couple of data items that I'd wish to store). There are a whole load of other benefits associated with reading/writing XML format too.

    So ... can this be achieved via the Serializable interface? Or do you suppose I would be better off writing my own interface?

  2. #2
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    have a look at this

    XStream - About XStream

  3. #3
    XmisterIS is offline Member
    Join Date
    Aug 2010
    Posts
    35
    Rep Power
    0

Similar Threads

  1. Using JSTL to capture HTTP referer data and serialize into a variable
    By jeremy.wilson in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 05-19-2011, 01:44 PM
  2. Can I Serialize "this"??
    By Sandia_man in forum New To Java
    Replies: 8
    Last Post: 08-29-2010, 04:36 AM
  3. serialize to web service?
    By theartz in forum Advanced Java
    Replies: 2
    Last Post: 08-16-2008, 02:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •