From: Brian Candler Date: 2003-03-18T03:05:21+09:00 Subject: Re: ANN: Madeleine 0.1 On Tue, Mar 18, 2003 at 01:18:09AM +0900, Anders Bengtsson wrote: > --- Brian Candler wrote: > > > I don't think your code should have anything YAML-specific, because > > there > > are many other marshalling modules you might want to use (SOAP being > > another > > example). I think it should be up to the end-user to wrap them so > > that there > > is a Foo::load and Foo::dump, if they don't have them already. > > I'll probably ship a few out-of-the-box wrappers for different > marshalling implementations with Madeleine and at the same time give > the user the option to write their own. This won't really affect the > core parts of Madeleine. I thought that SOAP::Marshal didn't need any wrapping: irb(main):001:0> require 'soap/marshal' true irb(main):002:0> a = SOAP::Marshal.dump("abc") "\n\n\nabc\n\n\n" irb(main):003:0> b = SOAP::Marshal.load(a) "abc" but actually it's not compatible with Marshal, because: - you can't pass an IO object to load, it must be a string - you can't pass an IO object as the second parameter to dump (it takes a mappingRegistry instead) I think that's a weakness of soap4r, because if you have a 100MB database, it forces you to create (say) 400MB of XML, and then write it to a file. Suddenly you need 5 times as much RAM as you did originally, and also concatenation of large strings is inefficient in Ruby 1.6. For the purposes of a database, I think it's reasonable for you to require dump(obj,IO) and load(IO). Regards, Brian.