<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Groovy Interchange Format?</title>
	<link>http://www.isocra.com/2008/04/groovy-interchange-format/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sat, 17 May 2008 09:17:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Spike</title>
		<link>http://www.isocra.com/2008/04/groovy-interchange-format/#comment-196</link>
		<dc:creator>Spike</dc:creator>
		<pubDate>Fri, 02 May 2008 15:54:20 +0000</pubDate>
		<guid>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'm thinking you could do something like this:

GrIFMap  grifMap = new GrIFMap();
grifMap.add("points", [[10, 10, "Visit 1", "javascript:alert('Visit 1')], [10, 40, "Visit 2"],[40, 10, "Visit 3"], [40, 40, "Visit 4"]]);
grifMap.add("xLabel","Waiting Time");
grifMap.add("yLabel","Cost per visit");

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 "Waiting Time".equals(map.get("xLabel"));

The fact that its Groovy going over the wire would be basically invisible to the rest of the implementation. I'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(&#8221;points&#8221;, [[10, 10, &#8220;Visit 1&#8243;, &#8220;javascript:alert(&#8217;Visit 1&#8242;)], [10, 40, &#8220;Visit 2&#8243;],[40, 10, &#8220;Visit 3&#8243;], [40, 40, &#8220;Visit 4&#8243;]]);<br />
grifMap.add(&#8221;xLabel&#8221;,&#8221;Waiting Time&#8221;);<br />
grifMap.add(&#8221;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(&#8221;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-194</link>
		<dc:creator>DenisH</dc:creator>
		<pubDate>Fri, 02 May 2008 14:37:38 +0000</pubDate>
		<guid>http://www.isocra.com/2008/04/groovy-interchange-format/#comment-194</guid>
		<description>Hi Spike, I love "GrIF"!!! I'll get on to ISO straight away!

You're point about the parsing speed is interesting. It shouldn't be too difficult to test out either. As for not being widely used, that'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-193</link>
		<dc:creator>Spike</dc:creator>
		<pubDate>Fri, 02 May 2008 14:09:55 +0000</pubDate>
		<guid>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'd like to see a performance comparison of using this, vs parsing JSON. It might be faster, but, on the other hand, Groovy isn'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-190</link>
		<dc:creator>Web 2.0 Announcer</dc:creator>
		<pubDate>Fri, 02 May 2008 09:27:07 +0000</pubDate>
		<guid>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)?&#38;#xD;
&#38;#xD;
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...</description>
		<content:encoded><![CDATA[<p><strong>Groovy Interchange Format?&#8230;</strong></p>
<p>[&#8230;]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>
