<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Steve Vinoski's Blog &#187; code generation</title>
	<atom:link href="http://steve.vinoski.net/blog/category/code-generation/feed/" rel="self" type="application/rss+xml" />
	<link>http://steve.vinoski.net/blog</link>
	<description>Ask forgiveness, not permission.</description>
	<lastBuildDate>Thu, 09 May 2013 03:00:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Ruby and WS</title>
		<link>http://steve.vinoski.net/blog/2008/01/29/ruby-and-ws/</link>
		<comments>http://steve.vinoski.net/blog/2008/01/29/ruby-and-ws/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 04:39:51 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[code generation]]></category>
		<category><![CDATA[dynamic languages]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[WS-*]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[Artix]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[dynamism]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/2008/01/29/ruby-and-ws/</guid>
		<description><![CDATA[Via Stefan Tilkov: Assaf Arkin talks about his upcoming book, Ruby in Practice. I don&#8217;t know anything about the book, but it sounds interesting. Assaf talks about having a nice Ruby interface for WS, and also talks about wrapping Websphere MQ with Ruby. It reminded me of some work I was doing about a year [...]]]></description>
				<content:encoded><![CDATA[<p>Via <a href="http://www.innoq.com/blog/st/2008/01/ruby-and-ws.html">Stefan Tilkov</a>: <a href="http://blog.labnotes.org/2008/01/28/ruby-in-practice-rest-soap-websphere-mq-and-salesforce/">Assaf Arkin talks about his upcoming book</a>, <em><a href="http://manning.com/mcanally/">Ruby in Practice</a></em>. I don&#8217;t know anything about the book, but it sounds interesting.</p>
<p>Assaf talks about having a nice Ruby interface for WS, and also talks about wrapping Websphere MQ with Ruby. It reminded me of some work I was doing about a year and a half ago, when I still worked for IONA: developing a Ruby wrapper for <a href="http://www.iona.com/products/artix/">Artix</a>. I left there before it ever saw the light of day, so I doubt anyone will ever see it, but it was pretty cool. It was implemented using only customer-visible C++ APIs, and it afforded at least an order of magnitude reduction in the number of lines of code required to get anything done. It used <a href="http://www.ruby-doc.org/stdlib/libdoc/wsdl/rdoc/index.html">WSDL4R</a> to interpret a WSDL definition at runtime and dynamically generate accessor functions for the service, i.e., there was no up-front static code generation. You could point the client at the service, and if the service supported access to its WSDL (typically via a <code>?wsdl</code> query string added to the service URI), the client could download the WSDL and dynamically generate everything required to access that service. I wrote about how to develop such Ruby extensions in my <a href="http://dsonline.computer.org/portal/pages/dsonline/2006/10/w5tow.html">Sep/Oct 2006 IC column</a>.</p>
<p>I remember presenting an example of the system in an internal sales engineering meeting where the original C++ and Java code required 70-80 lines of code while the equivalent Ruby code was only 7 lines. It wasn&#8217;t 7 lines of obfuscated expert-only Ruby, either; it was quite easy to read and understand. The SEs, most of whom worked only in Java and C++, kept looking at it and scratching their heads. They&#8217;d say, &#8220;Hey, you forgot to do this!&#8221; and I&#8217;d say, no, that happens right here. And they&#8217;d say something similar about another required action, and the answer was always the same: no, it&#8217;s in there. Basically, Ruby allowed me to hide a bunch of crufty, verbose, uninteresting but required boilerplate and focus only on service interactions. Waaay nicer than the equivalent Java and C++, for sure.</p>
<p>On a related note, just prior to that project, I did some work with <a href="http://incubator.apache.org/cxf/">Apache CXF</a> to develop a <a href="http://dsonline.computer.org/portal/pages/dsonline/2006/06/w3tow.html">server-side JavaScript and E4X JAX-WS capability</a>. Since I no longer work in the middleware or WS worlds, I haven&#8217;t kept track of that code, so I don&#8217;t know if CXF still supports it or not. But either way, given the fact that <a href="http://jruby.codehaus.org/">JRuby</a> now exists, there&#8217;s no reason that someone couldn&#8217;t take that work and redo it in JRuby. It would be pretty straightforward.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2008/01/29/ruby-and-ws/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>IDLs vs. Human Documentation</title>
		<link>http://steve.vinoski.net/blog/2008/01/16/idls-vs-human-documentation/</link>
		<comments>http://steve.vinoski.net/blog/2008/01/16/idls-vs-human-documentation/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 05:23:20 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[code generation]]></category>
		<category><![CDATA[CORBA]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[IDL]]></category>
		<category><![CDATA[WSDL]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/2008/01/16/idls-vs-human-documentation/</guid>
		<description><![CDATA[Patrick Mueller responded to my previous blog posting on interface definition languages, and I wanted to comment on his response. Long ago Patrick was involved in defining the Smalltalk bindings for CORBA IDL, so he&#8217;s a CORBA veteran like me, and in the big picture we agree on many things. It&#8217;s nice having him cast [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://pmuellr.blogspot.com/2008/01/steve-vinoski-on-schema.html">Patrick Mueller responded</a> to my <a href="/blog/2008/01/14/lying-through-their-teeth-easy-vs-simple/">previous blog posting</a> on interface definition languages, and I wanted to comment on his response. Long ago Patrick was involved in defining the Smalltalk bindings for CORBA IDL, so he&#8217;s a CORBA veteran like me, and in the big picture we agree on many things. It&#8217;s nice having him cast a critical eye on this stuff.</p>
<p>Note that Patrick mostly talks about data schemas, whereas my posting talks only of interface definition languages. These are two <em>very</em> different things, which I&#8217;ve noted in comments on his blog. In a reply comment he said they&#8217;re both metadata, which is true, but still, they&#8217;re very separable. REST depends heavily on data definitions, but it doesn&#8217;t require specialized interface definitions because it promotes a uniform interface. For data definition REST relies on and promotes <a href="http://www.iana.org/assignments/media-types/">media/MIME types</a>, and the standardization of such data definitions is critical to allowing independently-developed consumers and providers to interact correctly. I doubt Patrick and I really disagree on this last point.</p>
<p>One area where we apparently do disagree, though, is in the area of documentation. In my previous post I said that users of services ultimately rely on human-generated and human-readable documentation, not interface definition languages, to ensure their consuming applications interact correctly with those services. Patrick commented:</p>
<blockquote><p><em>The documentation? What documentation? I&#8217;m picturing here that Steve has in mind a separate document (separate from the code, not generated from the code) written by a developer. But human generated documentation like this is still schema, only it&#8217;s not understandable by machines, pretty much guaranteed to get out of sync with the code, probably incomplete and/or imprecise. Not that machine generated schema might fare any better, but it couldn&#8217;t be any worse.</p>
<p>But there are more problems with this thought. The notion of hand-crafted documentation for an API is quaint, but impractical if I&#8217;m dealing with more than a handful of APIs.</em></p></blockquote>
<p>I understand what Patrick&#8217;s saying here. Yes, documentation can get stale and out of sync. Still, I disagree. I&#8217;ve been near interface definition languages for at least 20 years now, and never once &mdash; <em>not even once</em> &mdash; have I seen anyone develop a consuming application without relying on some form of human-oriented documentation for the service being consumed. Such documentation might be as simple as a conversation with a developer across the hall, or reading comments in the definition language file itself, or might be from a README, email, a web page, a wiki, a Word document, a PDF, or a whole formal specification. I mean, what if the OMG had published only the ORB and Object Services IDL interfaces without the accompanying reams of human-oriented description and definition? Or if WSDL were enough, why the need for <a href="http://www.tbray.org/ongoing/When/200x/2004/09/21/WS-Research">so many pages of human-oriented WS-* documentation?</a></p>
<p>Like I said in my previous post, interface definition languages exist for machines to generate code. They&#8217;re totally inadequate, though, for instructing developers on how to write code to use a service. The need for human documentation in this context isn&#8217;t quaint or impractical at all &mdash; it&#8217;s simply reality.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2008/01/16/idls-vs-human-documentation/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
