views:

73

answers:

1

A friend raised this on Twitter: @name_removed doesn't understand why binding generators seem to think writing pages of XML is vastly superior to writing pages of C++...

Having never encountered binding generators before, I decided to look them up. Seems pretty self-explanatory, convert C++ classes to XML format. But now I need someone to explain what they're for.

Yes I have googled, for example, http://www.google.co.uk/search?hl=en&q=binding+generator+useful&meta= . Note that the resulting pages do not actually contain the word useful.

I suppose I can see advantages if you wanted to auto-generate web documentation, but this seems like a demolition ball to crush a walnut. You'd end up with very poor documentation, and you might as well just release the source code.

Any suggestions?

+1  A: 

Several reasons:

  • You focus in writing the protocol itself, not parsers. Writing parsing code is tedious, error prone work, and most of the code is boiler plate code anyway.
  • If you have the protocol specified as XML, you can have the server written in one language and the client in another. In this way you can generate clients in many languages very fast. For example, our server is written in Java, but we have clients written in C++ on Symbian and Windows Mobile, Objective-C for iPhone and Java ME on BlackBerry. Writing the same code on three different platforms is redundant work.

BTW, you don't need to write just schemas today - there are similar tools which do not use XML both for definition and for transport: Protocol Buffers and thrift

David Rabinowitz
Okay, I figured language-to-language transfer might be a reason, but I couldn't see a practical reason to wrap it in huge amounts of XML. Protocol Buffers and Thrift look a lot cleaner, I'll try to remember this. Thanks!
deworde