From: Chris Morris Date: 2002-03-19T09:51:43+09:00 Subject: RE: [ANN] Xml Serialization for Ruby > I agree that that smells ... the inconsistency of "root element is class > name, all other nodes are instance var names" ... but I'm almost positive > this is how C# does it, and when I was working with it felt quite natural > from a 'user' standpoint. The inconsistency never occurred to me > until now. > Of course, I need to double check -- work has detoured me from my > C# lately. More on this. If I have this class: class Person attr_accessor :name, :age, :height ... end I'd rather see this xml: Chris Morris 30 72 ... than this: Chris Morris 30 72 ... because my first thought is -- "Why doesn't the xml look like the class declaration? Where'd all these types come from? -- I don't care about that so much as putting in the data. I thought this was Ruby." :) I don't think -- "hey, that first xml is inconsistently structured" (even though it is) ... To me, the first structure comes off very much like I typed up the Ruby class. And the first structure is faster to grok -- my eye tends to brush over attributes at first shot. I think it has better PoLS. But again, I guess I shouldn't add any fuel to this fire, because I'm willing to support multiple formats; it's simple enough to do and I'd hate to have a tool like this work great for small stuff, than fail just because I need to ramp it up a bit in the typing department -- plus for me to go with a strictly typeless xml option, I have to have a fully initialized object, and I don't want to force that on anyone either -- give them the option of type info in the xml or a fully initialized object. Chris