Results 1 to 3 of 3
- 09-18-2010, 10:26 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 35
- Rep Power
- 0
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?
- 09-18-2010, 01:04 PM #2
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
have a look at this
XStream - About XStream
- 09-21-2010, 01:37 PM #3
Member
- Join Date
- Aug 2010
- Posts
- 35
- Rep Power
- 0
Similar Threads
-
Using JSTL to capture HTTP referer data and serialize into a variable
By jeremy.wilson in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 05-19-2011, 12:44 PM -
Can I Serialize "this"??
By Sandia_man in forum New To JavaReplies: 8Last Post: 08-29-2010, 03:36 AM -
serialize to web service?
By theartz in forum Advanced JavaReplies: 2Last Post: 08-16-2008, 01:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks