<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Groovy Interchange Format?</title>
	<atom:link href="http://www.isocra.com/2008/04/groovy-interchange-format/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.isocra.com/2008/04/groovy-interchange-format/</link>
	<description>Thoughts and tutorials on web design, Java, Javascript and project management</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:33:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: josef</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/comment-page-1/#comment-1126</link>
		<dc:creator>josef</dc:creator>
		<pubDate>Wed, 19 May 2010 03:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.isocra.com/2008/04/groovy-interchange-format/#comment-1126</guid>
		<description>I just found your posting after having posted my own version of this very idea.  See http://wp.me/psHIY-6g   &quot;Groovy Object Notation (GrON) for Data Interchange&quot;</description>
		<content:encoded><![CDATA[<p>I just found your posting after having posted my own version of this very idea.  See <a href="http://wp.me/psHIY-6g" rel="nofollow">http://wp.me/psHIY-6g</a>   &#8220;Groovy Object Notation (GrON) for Data Interchange&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris W</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/comment-page-1/#comment-677</link>
		<dc:creator>Chris W</dc:creator>
		<pubDate>Thu, 04 Dec 2008 17:18:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.isocra.com/2008/04/groovy-interchange-format/#comment-677</guid>
		<description>Nice idea, but Groovy maps don&#039;t serialize nicely. Strings are double-quoted, so they will be interpreted as GStrings, so embedded dollar signs will be a problem. Dates, enums simply get written out unquoted. The result is not valid Groovy:

enum Floo { x, y }
def m = [a:new Date(), b:&#039;$hi&#039;, c: Floo.x]
println m

Result: [&quot;a&quot;:Thu Dec 04 12:13:17 EST 2008, &quot;b&quot;:&quot;$hi&quot;, &quot;c&quot;:x]</description>
		<content:encoded><![CDATA[<p>Nice idea, but Groovy maps don&#8217;t serialize nicely. Strings are double-quoted, so they will be interpreted as GStrings, so embedded dollar signs will be a problem. Dates, enums simply get written out unquoted. The result is not valid Groovy:</p>
<p>enum Floo { x, y }<br />
def m = [a:new Date(), b:'$hi', c: Floo.x]<br />
println m</p>
<p>Result: ["a":Thu Dec 04 12:13:17 EST 2008, "b":"$hi", "c":x]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spike</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/comment-page-1/#comment-196</link>
		<dc:creator>Spike</dc:creator>
		<pubDate>Fri, 02 May 2008 15:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.isocra.com/2008/04/groovy-interchange-format/#comment-196</guid>
		<description>Hmmm...

Rather than writing out the Groovy as a string, which forces you to check that its well formed, parsed, and, correctly formatted, it might be better if you had an object to handle that for you. 

I&#039;m thinking you could do something like this:

GrIFMap  grifMap = new GrIFMap();
grifMap.add(&quot;points&quot;, [[10, 10, &quot;Visit 1&quot;, &quot;javascript:alert(&#039;Visit 1&#039;)], [10, 40, &quot;Visit 2&quot;],[40, 10, &quot;Visit 3&quot;], [40, 40, &quot;Visit 4&quot;]]);
grifMap.add(&quot;xLabel&quot;,&quot;Waiting Time&quot;);
grifMap.add(&quot;yLabel&quot;,&quot;Cost per visit&quot;);

Then, to get the correctly formatted data string out, it would be a call to:

groovyData = grifMap.toGrIF();

Then, on the other side of the wire, you could do:

GrIFMap map = new GrIFMap(groovyData);
assert &quot;Waiting Time&quot;.equals(map.get(&quot;xLabel&quot;));

The fact that its Groovy going over the wire would be basically invisible to the rest of the implementation. I&#039;d probably extend GrIFMap off of LinkedHashMap, to maintain data order....

Cool stuff.</description>
		<content:encoded><![CDATA[<p>Hmmm&#8230;</p>
<p>Rather than writing out the Groovy as a string, which forces you to check that its well formed, parsed, and, correctly formatted, it might be better if you had an object to handle that for you. </p>
<p>I&#8217;m thinking you could do something like this:</p>
<p>GrIFMap  grifMap = new GrIFMap();<br />
grifMap.add(&#8220;points&#8221;, [[10, 10, "Visit 1", "javascript:alert('Visit 1')], [10, 40, "Visit 2"],[40, 10, "Visit 3"], [40, 40, "Visit 4"]]);<br />
grifMap.add(&#8220;xLabel&#8221;,&#8221;Waiting Time&#8221;);<br />
grifMap.add(&#8220;yLabel&#8221;,&#8221;Cost per visit&#8221;);</p>
<p>Then, to get the correctly formatted data string out, it would be a call to:</p>
<p>groovyData = grifMap.toGrIF();</p>
<p>Then, on the other side of the wire, you could do:</p>
<p>GrIFMap map = new GrIFMap(groovyData);<br />
assert &#8220;Waiting Time&#8221;.equals(map.get(&#8220;xLabel&#8221;));</p>
<p>The fact that its Groovy going over the wire would be basically invisible to the rest of the implementation. I&#8217;d probably extend GrIFMap off of LinkedHashMap, to maintain data order&#8230;.</p>
<p>Cool stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DenisH</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/comment-page-1/#comment-194</link>
		<dc:creator>DenisH</dc:creator>
		<pubDate>Fri, 02 May 2008 14:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.isocra.com/2008/04/groovy-interchange-format/#comment-194</guid>
		<description>Hi Spike, I love &quot;GrIF&quot;!!! I&#039;ll get on to ISO straight away!

You&#039;re point about the parsing speed is interesting. It shouldn&#039;t be too difficult to test out either. As for not being widely used, that&#039;s right too, but this particular application uses Groovy and Groovy Server Pages already. So actually what happens is that a GSP  generates the data in GrIF and the graph servlet consumes it.</description>
		<content:encoded><![CDATA[<p>Hi Spike, I love &#8220;GrIF&#8221;!!! I&#8217;ll get on to ISO straight away!</p>
<p>You&#8217;re point about the parsing speed is interesting. It shouldn&#8217;t be too difficult to test out either. As for not being widely used, that&#8217;s right too, but this particular application uses Groovy and Groovy Server Pages already. So actually what happens is that a GSP  generates the data in GrIF and the graph servlet consumes it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spike</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/comment-page-1/#comment-193</link>
		<dc:creator>Spike</dc:creator>
		<pubDate>Fri, 02 May 2008 14:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.isocra.com/2008/04/groovy-interchange-format/#comment-193</guid>
		<description>Thats actually pretty cool because it parses directly into a Java object which can then be used by Java classes. I&#039;d like to see a performance comparison of using this, vs parsing JSON. It might be faster, but, on the other hand, Groovy isn&#039;t exactly known for its speed.

The primary disadvantage is that its not a widely used standard, so the next person to see the code might be thinking WTF?, even if, technically, its a good solution. It would probably gain more acceptance if you came up with a cool acronym for it, though, along the lines of JSON or AJAX. Maybe GrIF?</description>
		<content:encoded><![CDATA[<p>Thats actually pretty cool because it parses directly into a Java object which can then be used by Java classes. I&#8217;d like to see a performance comparison of using this, vs parsing JSON. It might be faster, but, on the other hand, Groovy isn&#8217;t exactly known for its speed.</p>
<p>The primary disadvantage is that its not a widely used standard, so the next person to see the code might be thinking WTF?, even if, technically, its a good solution. It would probably gain more acceptance if you came up with a cool acronym for it, though, along the lines of JSON or AJAX. Maybe GrIF?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Web 2.0 Announcer</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/comment-page-1/#comment-190</link>
		<dc:creator>Web 2.0 Announcer</dc:creator>
		<pubDate>Fri, 02 May 2008 09:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.isocra.com/2008/04/groovy-interchange-format/#comment-190</guid>
		<description>&lt;strong&gt;Groovy Interchange Format?...&lt;/strong&gt;

[...]Is Groovy a good way to pass complex data from one server to another (instead of JSON or XML)?&#xD;
&#xD;
If you&#039;re already using Groovy, you can use it very easily to transfer complex data (say for a graph). Parsing it is much easi...</description>
		<content:encoded><![CDATA[<p><strong>Groovy Interchange Format?&#8230;</strong></p>
<p>[...]Is Groovy a good way to pass complex data from one server to another (instead of JSON or XML)?&amp;#xD;<br />
&amp;#xD;<br />
If you&#39;re already using Groovy, you can use it very easily to transfer complex data (say for a graph). Parsing it is much easi&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

