<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Zettelkasten</title>
	<atom:link href="http://victorvolle.wordpress.com/feed" rel="self" type="application/rss+xml" />
	<link>http://victorvolle.wordpress.com</link>
	<description>Shouts and Murmurs of a "Powerpoint" Architect</description>
	<pubDate>Thu, 24 Apr 2008 11:04:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>Groovy makes Java Strings mutable</title>
		<link>http://victorvolle.wordpress.com/2008/04/23/groovy-makes-java-strings-mutable/</link>
		<comments>http://victorvolle.wordpress.com/2008/04/23/groovy-makes-java-strings-mutable/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 19:58:18 +0000</pubDate>
		<dc:creator>victorvolle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://victorvolle.wordpress.com/?p=23</guid>
		<description><![CDATA[Just stumbled about an entry in the Groovy mailing list
def input = '''&#60;tag id="12" /&#62;'''
def tag = new XmlParser().parseText(input)
tag.attribute("id").value = "ABCD"
println tag.attribute("id")
==&#62;
AB
Oops. The object returned by tag.attribute(&#8221;id&#8221;) is of type String (i.e. java.lang.String) and not of some type XmlAttribute. And the &#8216;value&#8217; is the private final (sic!) variable containing the String&#8217;s content (a char array). [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just stumbled about an <a href="http://www.nabble.com/XMLParser%3A-attribute-gets-truncated-when-updated-to16777925.html">entry</a> in the Groovy mailing list</p>
<pre>def input = '''&lt;tag id="12" /&gt;'''
def tag = new XmlParser().parseText(input)
tag.attribute("id").value = "ABCD"
println tag.attribute("id")
==&gt;
AB</pre>
<p>Oops. The object returned by tag.attribute(&#8221;id&#8221;) is of type String (i.e. java.lang.String) and not of some type XmlAttribute. And the &#8216;value&#8217; is the private final (sic!) variable containing the String&#8217;s content (a char array). And Groovy allows us to change that value &#8230; making String mutable.</p>
<p>Even funnier:</p>
<pre>...
println tag.attribute("id").value
==&gt;
[A, B, C, D]</pre>
<p>I always had the feeling, that Groovy was programmed first and then designed afterwards.  In the last years they progressed nicely, but this makes me doubt again. <span style="text-decoration:line-through;">This issue has been known since <a href="http://jira.codehaus.org/browse/GROOVY-1875">May 2007</a>. But </span>I think they just realized what it means: &#8220;<a id="nabble.link16779041" href="http://www.nabble.com/forum/ViewPost.jtp?post=16779041&amp;framed=y" target="ViewPost">Yikes! String is mutable!</a>&#8220;</p>
<p>Update (April, 24th): Created a <a href="http://jira.codehaus.org/browse/GROOVY-2774">new issue</a>, because the <a href="http://jira.codehaus.org/browse/GROOVY-1875">existing issue</a> is only concerned with violating the &#8220;private&#8221; contract and not with violating the &#8220;final&#8221; contract.</p>
<p>Please <a href="http://jira.codehaus.org/browse/GROOVY-2774">vote</a> for the issue to be fixed.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/victorvolle.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/victorvolle.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/victorvolle.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/victorvolle.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/victorvolle.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/victorvolle.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/victorvolle.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/victorvolle.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/victorvolle.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/victorvolle.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/victorvolle.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/victorvolle.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=victorvolle.wordpress.com&blog=3236731&post=23&subd=victorvolle&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://victorvolle.wordpress.com/2008/04/23/groovy-makes-java-strings-mutable/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/victorvolle-128.jpg" medium="image">
			<media:title type="html">victorvolle</media:title>
		</media:content>
	</item>
		<item>
		<title>REST vs. WS-* &#8230; Does it help me to achieve my goal?</title>
		<link>http://victorvolle.wordpress.com/2008/03/31/rest-vs-ws-does-it-help-me-to-achieve-my-goal/</link>
		<comments>http://victorvolle.wordpress.com/2008/03/31/rest-vs-ws-does-it-help-me-to-achieve-my-goal/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 19:22:35 +0000</pubDate>
		<dc:creator>victorvolle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[rest]]></category>

		<category><![CDATA[RPC]]></category>

		<category><![CDATA[soap]]></category>

		<category><![CDATA[WS-*]]></category>

		<guid isPermaLink="false">http://victorvolle.wordpress.com/?p=19</guid>
		<description><![CDATA[The discussion about REST vs. SOAP seems to be endless, so &#8212; why bother?
Because there seems to be a thorough misunderstanding between the two camps that needs to be resolved. A misunderstanding that pertains to different values hold by each camp. Perhaps &#8220;values&#8221; is to big a word and viewpoint might be enough, but the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The discussion about REST vs. SOAP seems to be endless, so &#8212; why bother?</p>
<p>Because there seems to be a thorough misunderstanding between the two camps that needs to be resolved. A misunderstanding that pertains to different values hold by each camp. Perhaps &#8220;values&#8221; is to big a word and viewpoint might be enough, but the discussion evokes so many emotions so much &#8220;you just don&#8217;t get it&#8221; so much ferociousness, &#8220;values&#8221; seems to be the right notion.<i> (This is my <a href="http://www.infoq.com/articles/tilkov-rest-doubts#view_20092">second</a> try to put these thoughts into the right words (I even created my own blog for this), you might want to read that discussion first.)</i></p>
<p>There are two central issues at play:</p>
<ol>
<li>&#8220;The Web&#8221; as an entity that can be abused</li>
<li>API design</li>
</ol>
<p>I think the latter is more important and more fundamental, but let me try to get the first out of the way.</p>
<p><b>The &#8220;abused&#8221; Web</b><b> </b></p>
<p>&#8230; or better: the abused HTTP protocol.</p>
<p>Proponents of the REST approach consider using HTTP as a mere transport as abusive (e.g. <a href="http://www.infoq.com/articles/tilkov-rest-doubts">Tilkov</a>, <a href="http://steve.vinoski.net/blog/2007/11/17/answers-for-sergey/">Vinovsky</a>).  For me, using a word like &#8220;abuse&#8221; sounds like putting HTTP on a throne. You have to worship it. Using it for another purpose as was intended is against the &#8230; what? As far as I remember, SMS were initially not intended for use by mere mortals, so sending a message via SMS is an abuse? <a href="http://www.snellspace.com/wp/?p=798">James Snell</a> puts it right:</p>
<blockquote><p>&#8220;there will always be multiple technologies. We use the technologies that best suit the problem we’re trying to solve. It just so happens that HTTP is well suited to address a hell of a lot of problems.&#8221;</p></blockquote>
<p>If a tool helps me to achieve a goal, I will use it. Perhaps there are better tools or more efficient ways to do things. We can talk about that, but &#8220;abuse&#8221;?. Do I abuse a hammer when I use its handle to get something out from under the bed?</p>
<p>I hope you can agree with me, but <a href="http://www.infoq.com/articles/tilkov-rest-doubts#view_20093">Stefan Tilkov</a> throws in the following analogy:</p>
<blockquote><p><span>&#8220;would you consider using a RDBMS and then defining a single table only, with two columns, &#8216;id&#8217; and &#8216;content&#8217; (the latter a BLOB) an abuse of the RDB&#8221;</span></p></blockquote>
<p>Yes, it sounds like using a RDB in the wrong way, but if I happen to have a RDB at hand, and the data is unstructured, or simply easier store as a BLOB, so why not? Does it help me to achieve my goal? Sorry, I do not &#8220;believe&#8221; in &#8220;the Web&#8221;, the &#8220;HTTP protocol&#8221; as entities that should be worshiped and defended against the unbelievers.</p>
<p>So if you think that WS-* is an abuse, please let us simply state that we disagree on this point and move on. Can we?</p>
<p><b>API design</b></p>
<p>WS is centered around verbs (<i>what</i> you can do with things) and REST is centered around resources (the <i>things</i> itselves). I could stop here, because I think, that&#8217;s all there is. But then why is the debate still going on and on and on? Because this is a cultural issue. And as long as you are part of one culture it is very difficult to see value in another culture. Let me try to explain that.</p>
<p>When you have to integrate a bunch of legacy systems that all have some kind of (R)PC-API, it just feels natural to wrap them into WebServices. You do not have to translate all the existing verbs into their RESTful equivalent. In my comment to Stefan, I offered the following existing API as an example:</p>
<pre><span> (d) scoreCustomerMortgageRisk(customerId)
     // i.e. the customer has send in a mortgage application,
     // that should now be &#8220;scored&#8221; to decide if we can offer
     // him a credit contract

 (e) promoteToCustomer(personId)
     // a person that is in our system, will now become a
     // customer (an account will be opend, etc.)

 (f) calculateNetInterestRate(credit)</span></pre>
<p>and <a href="http://www.infoq.com/articles/tilkov-rest-doubts#view_20131">Daniel Yokomizo</a> translated them into one possible RESTful API:</p>
<pre><span> (d) PUT /mortage-application/{id}/score

 (e) POST /people/{id}/promotions
     =returning&gt; 303 /customer/{id}</span></pre>
<p>and with (f) he cannot see the &#8220;resource&#8221;, perhaps because there was no explanation in my comment, but he correctly assumes that this really is nothing but a calculation and he even thinks that RPC might be the right thing (so, not everyone is a zealot in the REST camp).</p>
<p>I think this is the best, most concrete illustration of the different mind sets. For me this looks artificial. Is &#8220;mortgage-application&#8221; a resource? Is &#8220;score&#8221; a verb or a resource? I have to translate something that looks natural to me into something unusual. If I had to document the REST services, I still would describe (e) as &#8220;Promote to Customer&#8221;, because this is the culture I grew up with. But if I had to design an API for resources that are accessible via the Web from scratch, I might try REST, especially if I have (more) people in my team that are experienced in a RESTful style. It still all comes down to my central mantra &#8220;Does it help me to achieve my goal?&#8221;</p>
<p><b>Some final remarks and disclaimers</b></p>
<p>I think XML Schema is a mess and WSDL even more so, but I would like to have a rather formal description of the XML messages I have to send and can receive. Not to generate code, but to improve my code as a consumer of a RESTful web service.</p>
<p>There is a difference, whether you are creating an API that is really used between two parties over the Internet, or if you are (just) connecting systems inside your company using a &#8220;platform independent&#8221; mechanism. In the latter case I would mostly prefer an RPC style in the previous case I would very thoroughly think about my prospective users (if I want as many users of my services as soon as possible, REST is much simpler to use than WS-*).</p>
<p>I do not question that I can translate each and every verb of my RPC-style API into the four HTTP verbs and some deliberate URL. I know about Turing machines, but I think we all are happy that we do not have to program Turing machines directly. Restricting myself to a set of very strongly defined verbs, might even help, but I fear that eventually the URIs will be very arbitrary. If that is true, nothing will be gained.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/victorvolle.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/victorvolle.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/victorvolle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/victorvolle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/victorvolle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/victorvolle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/victorvolle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/victorvolle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/victorvolle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/victorvolle.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/victorvolle.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/victorvolle.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=victorvolle.wordpress.com&blog=3236731&post=19&subd=victorvolle&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://victorvolle.wordpress.com/2008/03/31/rest-vs-ws-does-it-help-me-to-achieve-my-goal/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/victorvolle-128.jpg" medium="image">
			<media:title type="html">victorvolle</media:title>
		</media:content>
	</item>
	</channel>
</rss>