Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Serializing objects that contain an instan ce of nu.xom.Document, part II

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: dirk bergstrom <dirk AT juniper.net>
  • Cc: xom-interest AT lists.ibiblio.org, Brendan.Johnston AT wellsfargo.com
  • Subject: Re: [XOM-interest] Serializing objects that contain an instan ce of nu.xom.Document, part II
  • Date: Thu, 19 Feb 2004 18:46:11 -0500

At 2:44 PM -0800 2/19/04, dirk bergstrom wrote:

The people asking for Java serialization probably don't really care about
the above argument. They just want to use XOM as the XML package in an
application that *requires* Java serialization (eg. EJB).

It appears that saying "XOM won't be serializable" is equivalent to saying
"XOM can't be used in EJB". This is perhaps a reasonable thing to say,
perhaps not, but it's almost entirely orthogonal to a discussion of which
serialization method is "better".

That's been said. I've yet to be convinced that statement is true though. I don't know enough about EJB to judge whether "EJB requires object serialization" is actually a true statement for myself. To convince me, you're going to need a compelling use case, and an EJB expert who confirms that that use-case really does need XOM objects to be Serializable. For instance, you'll need to explain to me why you can't just call toXML and serialize the resulting string. Hell, you coudl even do this in your own subclass that implemented Serializable and provided readObject and writeObject methods (or would it have to implement Externalizable for complete control? I forget.) Either way, that seems like a simple fix for any system that simple doesn't work with serializing XOM objects.

If good reasons were provided, then I would begin to consider whether implementing Serializable was practical. It may not be. But so far, I remain unconvinced it's even useful.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page