[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: RE: What is XML For?

java serialise
On Tuesday 29 October 2002 12:59, Anthony B. Coates wrote:

> Larry Cable once apologised to me for 2 things in Java, while he was still
> at Sun: applets & Java serialisation.  He felt then that XML was a far
> better solution than Java serialisation.  Not that I've kept up with how
> Java serialisation has moved on since then (2000), but I wonder if it has
> really improved enough, particularly the fact that deserialisation was
> slower than parsing the equivalent XML.

Ha ha ha, don't think so; I wrote my own serialisation. More efficient in 
space and time by handling basic types from java.lang and java.util as 
special cases with tailored encodings, and better support for versioning by 
stating that new fields should either have a default value set in the default 
constructor for the class, and that the system would (for each field in the 
class that did not have a value in the input data stream) execute a method 
called "handleNotSupplied<fieldname>" if one existed which would provide an 
opportunity for arbitrary code to work out what value should be there. And if 
fields get removed in later versions, no problem; if there's a method called 
"handleSupplied<fieldname>(<field type>)" then it gets called if a value of 
that field is specified.

You could handle a field changing type by providing a handleSupplied... 
method for the old type which did appropriate conversions.

There are problems with classes that override their own serialisation in 
terms of traditional serialisation - I don't think I found a way around this, 
and had to just serialise them the old way and embed that in my own data 
stream, but I didn't finish that part of it.

> 	Cheers,
> 		Tony.


A city is like a large, complex, rabbit
 - ARP


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.