From: jbritt@... Date: 2003-03-19T23:47:21+09:00 Subject: Re: XML too hard (YAML opportunity?) > So the fact is the parser of YAML infers (through rules) the types of > the elements it parses is bad from your perspective? In most of my use cases, yes. If I want typing info, it's easy enough to add when and where I want it. I prefer it to be an option, not a requirement. > The issue is > SOMETHING has to know this. Its either written in some parser function > and mapped (from XML) into your internal object structure, or read in > directly from YAML. Right. And in some cases this information is business logic. This is less the case when serializing objects, where the type of the object and its constituents are part of the metadata you're concerned with. > As we did with FreeRIDE, the classes that are > serialized to YAML are, in fact, utility classes that YAML is > serializing for us. We just maintain those files (in Ruby). This is > far better than writing an emitter/parser pair for an XML format. I get > to code in my language...and don't worry about the data format. This may be the best thing for object serialization. > > Think of it this way: > > > In XML we have to update our emitter and parser. In your example, yes, and the same would be true for YAML if one wrote custom YAML parser/emitter code for every case. A better comparison might show the use of XmlSerialization or SOAP4R to do the XML serialization. In any event, it may be easier to do this sort of thing with YAML in Ruby; I don't really know. But that's a different matter from the merits of the actual markup. James > > -rich > > > >