Re: RE: What is XML For?
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. ABS -- A city is like a large, complex, rabbit - ARP
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format