Kent Dahl wrote:
> Michael Neumann wrote:
> > Try SOAP or XML-RPC for marshalling Ruby objects in a language-independent
> > format (requires SOAP4R or xmlrpc4r to be installed):
> 
> I looked at these some months ago, but I had a new look now on SOAP.
> (xmlrpc4r wouldn't install properly, I'll try again later.)
> 
> Nonetheless, it (SOAP) does not seem adequate for my needs:
>  1) Language/implementation specific metadata in datafile (still lots of
> type attribs)
>  2) I can't seem to get referential integrity.
>  3) The XML is less human-readable that I'd wish, mostly due to 1)
> 
> Seeing as point 2 is the show-stopper (for me), I'll elaborate.
> 
> <CODE>
> dad = Person.new
> son = Person.new
> son.father = dad
> people = [ dad, son ]
> aString   = SOAP::Marshal.marshal( people )
> xdad, xson = SOAP::Marshal.unmarshal( aString )
> </CODE>
> 
> Then 
> a) xdad.id != xson.father.id

Yes, the object will be stored twice.
With SOAP there could be a way to fix that problem, but I don't know how yet, perhaps 
it's possible with a SOAPReference.
 
> b) xdad.type != dad.type

Are you sure? Should be equal if you include SOAP::Marshallable into class Person.

> So then I wonder, does SOAP, XMLRPC, XMarshal or any other XML based
> method of marshalling maintain referential integrity? (If that is the
> right word for it)

XML-RPC definitly not.

I just read SOAP4R's release notes. Under section Restrictions the following is noted:

   "Marshalling references to href/id (Unmarshalling is OK)"

That means, generally it is possible with SOAP but not yet with SOAP4R.

Regards,

  Michael

-- 
Michael Neumann
merlin.zwo InfoDesign GmbH
http://www.merlin-zwo.de