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?