<?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>Rich Internet Applications (RIA) &#187; Groovy</title>
	<atom:link href="http://www.canoo.com/blog/category/groovy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.canoo.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 18 Jan 2012 14:30:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The Best Groovy Inspections You&#8217;re Not Using</title>
		<link>http://www.canoo.com/blog/2012/01/18/the-best-groovy-inspections-youre-not-using/</link>
		<comments>http://www.canoo.com/blog/2012/01/18/the-best-groovy-inspections-youre-not-using/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 13:42:37 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[hamlet]]></category>
		<category><![CDATA[idea]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2433</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2012/01/18/the-best-groovy-inspections-youre-not-using/";</script>pre {font-size:95%;} Many, many tools perform static analysis on code. There are all sorts of automated ways to look through your code and tell you if there are likely errors or not. FindBugs, PMD, and CheckStyle are some of the big names from the Java world. On the Groovy side we have two real options: [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2012/01/18/the-best-groovy-inspections-youre-not-using/";</script><style type="text/css">
    pre {font-size:95%;}
</style>
<p>Many, many tools perform static analysis on code. There are all sorts of automated ways to look through your code and tell you if there are likely errors or not. <a href="http://findbugs.sourceforge.net/">FindBugs</a>, <a href="http://pmd.sourceforge.net/">PMD</a>, and <a href="http://checkstyle.sourceforge.net/">CheckStyle</a> are some of the big names from the Java world. On the Groovy side we have two real options: <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a> and <a href="http://codenarc.sourceforge.net/">CodeNarc</a>.</p>
<p>This post highlights my favorite static analysis rules for Groovy in IDEA that are not enabled by default. Groovy in IDEA 11 has well over 100 rules, but less than half of them are activated when you install the product. To turn these rules on you&#8217;ll need to go into Settings (Ctrl+Alt+S) and enable them under Inspections.</p>
<p>So here are my favorites that <em>I</em> think <em>you</em> should turn on:</p>
<p><strong>Threading</strong><br />
Threading comes first because these inspections have saved my butt in the past. None of them are enabled by default, so do yourself a favor and enable a few. These ones are all must haves:</p>
<p>* <em>Access to static field locked on instance data</em> &#8211; Reading and writing a static field from multiple threads is not thread-safe. It needs to be done within a synchronized block. Do you know what happens when you synchronize on instance data, like this:<br />
<pre><pre>class MyClass {
&nbsp;&nbsp;&nbsp;&nbsp;static resource
&nbsp;&nbsp;&nbsp;&nbsp;final lock = new Object()

&nbsp;&nbsp;&nbsp;&nbsp;def initialize() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;synchronized(lock) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resource = new Resource()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
}</pre></pre><br />
The object &#8216;lock&#8217; is an instance field, not a static field. So this assignment within the synchronized block is not thread-safe. It is possible that the static field is accessed from multiple threads, which can lead to unspecified side effects.</p>
<p>* <em>Synchronization on non-final field</em> &#8211; If you are accessing a variable within a synchronized block then your synchronization token must be final. Consider this code:<br />
<pre><pre>class MyClass {
&nbsp;&nbsp;&nbsp;&nbsp;def resource
&nbsp;&nbsp;&nbsp;&nbsp;def lock = new Object()

&nbsp;&nbsp;&nbsp;&nbsp;def initialize() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;synchronized(lock) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resource = new Resource()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
}</pre></pre><br />
The field &#8216;lock&#8217; is not final, so different instances of MyClass may have different values for lock. The result is that different threads may be locking on different objects even when operating on the same object. Make your locks final.</p>
<p>* <em>Synchronization on variable initialized with literal</em> &#8211; Do you understand the problem with synchronizing on a primitive literal? Consider this code:<br />
<pre><pre>class MyClass {
&nbsp;&nbsp;&nbsp;&nbsp;def lock = &#039;my lock&#039;

&nbsp;&nbsp;&nbsp;&nbsp;def initialize() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;synchronized(lock) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// do something
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
}</pre></pre><br />
Strings are interned by the JVM, so the string &#8216;my lock&#8217; may also be used by another class. Numbers are even worse because they can be assigned from a cache. Some other object in the system may be initialized with the same literal, and could create an accidental (or malicious) dead-lock situations.</p>
<p>* <em>Unsynchronized method overrides synchronized method</em> &#8211; In some limited circumstances you may actually want to override a synchronized method with an unsynchronized one. But probably not. More than likely you don&#8217;t even know and you are accidentally creating a subtle bug. If the parent is synchronized then the child should be also. Or better yet, make the parent final.</p>
<p><strong>Probably bugs</strong><br />
* <em>Named arguments of constructor call</em> &#8211; This inspection warns you when something like the following happens when using named arguments, which is almost certainly a bug:<br />
<pre><pre>class Order {
&nbsp;&nbsp;&nbsp;&nbsp; int orderId
}

new Order(orderid: 5)</pre></pre><br />
See the problem? The field is named &#8216;orderId&#8217; with a big &#8216;I&#8217; and the constructor call uses &#8216;orderid&#8217; with a small &#8216;i&#8217;. RuntimeException if you run this code. This is a type of bug that CodeNarc cannot find because the type information of the classes is so limited. IDEA keeps track of types much better and can do nice things like this.</p>
<p>* <em>Access to unresolved expression</em> &#8211; There has been a lot of talk over the years about adding static compilation to Groovy. Some people want to be warned by the compiler or in the IDE if their Groovy code is referencing an object that does not exist. For example, they&#8217;d like this to produce a warning or error:<br />
<pre><pre>def c = { parm -&gt;
&nbsp;&nbsp;&nbsp;&nbsp;println it
}</pre></pre><br />
See the problem? The closure parameter is named &#8216;parm&#8217; but the closure references the parameter by the standard name &#8216;it&#8217;. The access to unresolved expression inspection turns this into a warning or error in the IDE. IDEA is quite smart about it too and knows all about delegate/super and the other Groovy dynamic variables. If you like this sort of thing then be sure to <a href="http://blackdragsview.blogspot.com/2011/10/feeling-grumpy.html">read up</a> on <a href="http://www.jroller.com/melix/entry/groovy_static_type_checker_status">Grumpy mode</a> in Groovy 2, coming soon.</p>
<p><strong>Control Flow</strong><br />
There are many features in Groovy that simplify standard and verbose Java code. Two of these are the Elvis operator and the Null-Safe Dereference. IDEA contains inspections to help you migrate to the new way of writing code with these features.</p>
<p>* <em>Conditional expression can be elvis &#8211; </em>This inspection migrates you from code like this:<br />
<pre>def x = value != null ? value : 2</pre><br />
And suggests you rewrite it into the equivalent Groovy:<br />
<pre>def x = value ?: 2</pre><br />
Is it always safe to make this transformation? (Think about it for a few seconds). GroovyTruth means it is not. Technically speaking, the two code snippets are not equivalent: <em>value != null</em> may be true while <em>value</em> is false, such as when value is an empty String. Overall, I like the inspection but you need to be careful with it.</p>
<p>* <em>Conditional expression can be conditional call &#8211; </em>This inspection promotes the use of the Null-Safe dereference. This following code produces a violation:<br />
<pre>def x = value != null ? value.toString() : null</pre><br />
&#8230; and you will be prompted to transform it ito:<br />
<pre>def x = value?.toString()</pre><br />
These two code blocks really are the same and this can be safely accepted as the correct way to write the code.</p>
<p>* <em>If statement (or conditional) with identical branches </em>- I periodically refactor code and accidentally leave an if or conditional statement with identical branches. These are of course redundant and can be cleaned up by removing the if expression. If you have good unit tests and use automated refactorings then this sort of things happens from time to time. The cleanup reminder is nice.</p>
<p><strong>Error Handling</strong><br />
* <em>Unused catch parameter </em>- My favorite Error Handling inspection is &#8216;Unused catch parameter&#8217;. Consider this code:<br />
<pre><pre>try {
&nbsp;&nbsp;&nbsp;&nbsp;doSomething()
} catch (e) {
&nbsp;&nbsp;&nbsp;&nbsp;LOG.error(&#039;unexpected error occurred&#039;)
}</pre></pre><br />
What happens to the stack trace in this scenario? It gets eaten up, never to appear in a log. You shouldn&#8217;t have any unused catch parameters. If you really don&#8217;t care about the exception then name it &#8216;ignore&#8217; or &#8216;ignored&#8217; to suppress the warning.</p>
<p><strong>Validity issues</strong><br />
* <em>Duplicate switch case</em> &#8211; Groovy has Switch on Steroids, meaning you can put almost any object in the case statement, including regular expressions:<br />
<pre><pre>switch (input) {
&nbsp;&nbsp;&nbsp;&nbsp;case ~/[0-9]/ : println &#039;numeric!&#039;; break
&nbsp;&nbsp;&nbsp;&nbsp;case ~/[0-9]/ : println &#039;a number&#039;; break
}</pre></pre><br />
See the problem? The same regex appears twice. The second case will never be executed, even if it would match. As long as your case statements have literals in them then IDEA can verify that there are no duplicates.</p>
<p><strong>Naming Conventions</strong><br />
Lastly, there are a whole bunch of naming convention inspections that you can activate and configure. If you&#8217;re not using CodeNarc (why not?) then you should at least activate some of these. Standards, on a whole, are good to adhere to.</p>
<p><strong>IDEA Inspections of CodeNarc?</strong><br />
So which should you use, IDEA or CodeNarc? These two tools complement each other. There is good reason to use both CodeNarc and IDEA together. CodeNarc does have more inspections than IDEA, but the IDE integration in IDEA is better. Pressing Alt+Enter typically rewrites the offending code, and the speed of the actions are much better in IDEA. Also, the static analysis rules do not overlap between the products because the CodeNarc developers (that&#8217;s Chris Mair and myself) already use IDEA and made a conscious effort not to duplicate anything.</p>
<p>And if you do want to use CodeNarc and IDEA, then you might try out the <a href="http://plugins.jetbrains.com/plugin/?idea&amp;id=5925">CodeNarc IDEA plugin</a>.</p>
<p>If you like this then you might check out some of my other IDEA related posts: <a href="http://hamletdarcy.blogspot.com/2008/04/10-best-idea-inspections-youre-not.html">The 10 Best Inspections You&#8217;re Not Using (in Java)</a>, or the IDEA archive on <a href="http://hamletdarcy.blogspot.com/search/label/IDEA">my blog</a> and the <a href="http://www.canoo.com/blog/tag/idea/">Canoo blog</a>.</p>
<p>And remember if you need Groovy and Grails help, then give us a call or drop me an email at hamlet.darcy@canoo.com</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2012/01/18/the-best-groovy-inspections-youre-not-using/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2012/01/18/the-best-groovy-inspections-youre-not-using/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IntelliJ IDEA 11 for the Groovy Developer</title>
		<link>http://www.canoo.com/blog/2011/12/20/intellij-idea-11-for-the-groovy-developer/</link>
		<comments>http://www.canoo.com/blog/2011/12/20/intellij-idea-11-for-the-groovy-developer/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 09:51:06 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2390</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/12/20/intellij-idea-11-for-the-groovy-developer/";</script>pre {font-size:95%;} IntelliJ IDEA 11 was released a few weeks ago, and it contains quite a few new features for the Groovy developer. Everything listed here is in the free and open source Community Edition of IntelliJ IDEA. There are plenty of new Grails features as well, but I wanted to separate out the Ultimate [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/12/20/intellij-idea-11-for-the-groovy-developer/";</script><style type="text/css">
pre {font-size:95%;}
</style>
<p><a href="http://www.jetbrains.com/idea/">IntelliJ IDEA 11</a> was released a few weeks ago, and it contains quite a few new features for the Groovy developer. Everything listed here is in the free and open source <a href="http://www.jetbrains.com/idea/free_java_ide.html">Community Edition</a> of IntelliJ IDEA. There are plenty of new Grails features as well, but I wanted to separate out the Ultimate Edition features into a different post. So let&#8217;s jump in.</p>
<h2>Groovy 2.0 Support</h2>
<p>The big promoted feature of IDEA 11 is the Groovy 2.0 support, which is itself mostly Java 7 support. In case you&#8217;re confused: Java 7 added some small language feature to Java (<a href="http://www.canoo.com/blog/2011/07/14/java-7-small-language-changes-screencast/">more here</a>), and Groovy naturally supports the same syntax. The Project Coin Java changes are by definition small language changes, so don&#8217;t expect anything too major in terms of productivity boosts.</p>
<p>The first feature is underscores in numeric literals:<br />
<pre>assert 1000000 == 1_000_000 : &#039;How awesome is that?&#039;</pre>Underscores in Number Literals</p>
<p>Do you really need an explanation of this? OK, here it is then. You can put underscores into numbers and the compiler rips them out. They are just ignored. Just look at the .class file in a decompiler if you don&#8217;t believe me.</p>
<p>The second feature is binary literals:<br />
<pre>assert 0b1001_1001 == 153: &#039;mind == blown&#039;</pre>Binary Literals</p>
<p>This lets you specify integers using a binary format. As far as I can tell, this is mostly used if you&#8217;re constructing bit-masks to represent multiple states within one integer. You know, you could also use objects to do that and it might be clearer. But there are always times when you need this.</p>
<p>The third feature is multi-catch, which is the most useful feature of the three:<br />
<pre><pre>try {
&nbsp;&nbsp;&nbsp;&nbsp;takeArrowToKnee()
} catch (InjuryException
&nbsp;&nbsp;&nbsp;&nbsp; | LowHealthException
&nbsp;&nbsp;&nbsp;&nbsp; | LowStaminaException e) {

&nbsp;&nbsp;&nbsp;&nbsp;becomeTownGuard() // retire to a simpler life
}</pre></pre>Java 7 Multi-Catch</p>
<p>This lets you catch multiple exception types in one catch block. In Java, you can Alt+Enter on an old-style catch to convert it into a multi-catch, but you can&#8217;t yet do that in Groovy. Don&#8217;t worry though, I created a ticket and it will soon be implemented&#8230;</p>
<h2>Refactorings</h2>
<p>For me the Groovy refactorings are one of the killer features of IDEA. There are a pair of nice upgrades in IDEA 11 in this area. The first is that Introduce Parameter works for closures now and not just methods. So if you start with something like this, where the literal 50 is hard-coded:<br />
<pre><pre>def adventure = {

&nbsp;&nbsp;&nbsp;&nbsp;killMonsters() &amp;&amp; collectLoot()
&nbsp;&nbsp;&nbsp;&nbsp;if (health &lt; 50) drinkPotion()
}</pre></pre>Introduce Parameter for Closures</p>
<p>You can highlight the 50 and press Ctrl+Alt+P to Introduce a Parameter:<br />
<pre><pre>def adventure = { int minimum -&gt;

&nbsp;&nbsp;&nbsp;&nbsp;killMonsters() &amp;&amp; collectLoot()
&nbsp;&nbsp;&nbsp;&nbsp;if (health &lt; minimum)&nbsp;&nbsp;drinkPotion()
}</pre></pre>Ctrl+Alt+P to Introduce Parameter</p>
<p>OK, so that is nice. A less well-known intention is the Unwrap Statement intention. Unwrap takes a statement that is wrapped in some sort of loop or conditional, and it removes that conditional. Witness:</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/12/unwrap.png"><img src="http://www.canoo.com/blog/wp-content/uploads/2011/12/unwrap.png" alt="" title="unwrap" width="379" height="388" class="aligncenter size-full wp-image-2394" /></a></p>
<p>Start with an If statement, choose to unwrap it, and you&#8217;re left with only the enclosed logic. Now that you know this trick, you will start to use it more often. It&#8217;s surprisingly useful.</p>
<h2>Intentions and Inspections</h2>
<p>There are also a couple of good, new intentions and inspections in 11. On the inspection side is the new &#8220;Incompatible In&#8221; inspection. You can use the &#8216;in&#8217; keyword in, which is normally the inverse of &#8216;contains&#8217;. Using the in keyword to do incompatible type comparisons now triggers an IDE warning:</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/12/incompatiblein.png"><img src="http://www.canoo.com/blog/wp-content/uploads/2011/12/incompatiblein.png" alt="" title="incompatiblein" width="406" height="91" class="aligncenter size-full wp-image-2395" /></a></p>
<p>It&#8217;s a dynamically typed language, but as you can see the tools can easily catch your small type errors.</p>
<p>Also in 11 is my favorite intention, Convert JUnit Assertion to Assert. This converts your old-style JUnit assertion methods into Groovy power-asserts:</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/12/assert.png"><img src="http://www.canoo.com/blog/wp-content/uploads/2011/12/assert.png" alt="" title="assert" width="417" height="444" class="aligncenter size-full wp-image-2396" /></a></p>
<p>Just position the cursor at the method call and press Alt+Enter. And if you&#8217;re not sure why power asserts are an improvement then <a href="http://hamletdarcy.blogspot.com/2009/05/new-power-assertions-in-groovy.html">read this</a>.</p>
<p>Also in IDEA 11 is &#8216;Split If&#8217; and &#8216;Invert If&#8217;. We wrote these intentions ourselves at Hackergarten in Devoxx. Horray for open source! Split If takes a compound boolean operation like &#8216;if (a &amp;&amp; b) { &#8230; }&#8217; and converts it into &#8216;if (a) { if (b) { &#8230; } }. Invert If takes the boolean conditional in the If and inverts it. Both intentions are invoked with Alt+Enter and they are both described in more detail over at the <a href="http://blogs.jetbrains.com/idea/2011/11/jetbrains-contributes-to-open-source-at-devoxx/">JetBrains IDEA blog</a>.</p>
<p>Besides that, the Import system got some new improvements as well. You can now use Alt+Enter to swap a qualified reference with an import, add a single-member static import, or add an on-demand static import. And my favorite: copy and paste within the IDE now carries the import statements with it. So if you copy a reference to the clipboard and paste it, then IDEA will ask you if you want to update the import statements. Whenever I switch back to a text editor I always miss the seamless import statement management provided by the IDE.</p>
<h2>Groovy Isms</h2>
<p>What else? Well, the IDE is now aware of @Category annotations and gives you correct code completion based on them. And you can finally specify a command line parameter when running a Groovy script from within IDEA. Hint: it&#8217;s the box marked &#8216;Script Parameters&#8217;:</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/12/clitest.png"><img src="http://www.canoo.com/blog/wp-content/uploads/2011/12/clitest-300x202.png" alt="" title="clitest" width="300" height="202" class="aligncenter size-medium wp-image-2397" /></a></p>
<p>Managing dependencies with Jars and Grapes got easier. If you annotate a script with @Grape when IDEA has always imported that dependency into the project for you. Well now IDEA removes obsolete @Grapes references when you no longer need them.</p>
<p>Lastly, there are many small UI improvements, such as overriding properties now have a gutter icon to show the relationship, multiple declarations on a single line now have better alignment, and pasting a slashy string now escapes the slashes. There are more as well, but they are even more minor.</p>
<h2>Plus Grails Plus Java Plus&#8230;</h2>
<p>And don&#8217;t forget, all the base improvements of IDEA, especially the speed improvements, will be felt in Groovy. The database UI has improved, the Navbar has improved, Git support has improved. It&#8217;s all there whether you&#8217;re in Java or Groovy. And like I said at the start, Grails has many improvements but they aren&#8217;t covered here&#8230; maybe in a later post after the holidays.</p>
<p>So long and happy holidays!</p>
<p>Need help with Groovy or Grails? Canoo Engineering offers training, consulting, and project delivery. Contact me directly at <a href="mailto://hamlet.darcy@canoo.com">hamlet.darcy@canoo.com</a> for more information.</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/12/20/intellij-idea-11-for-the-groovy-developer/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/12/20/intellij-idea-11-for-the-groovy-developer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Art of Groovy Command Expressions in DSLs</title>
		<link>http://www.canoo.com/blog/2011/12/08/the-art-of-groovy-command-expressions-in-dsls/</link>
		<comments>http://www.canoo.com/blog/2011/12/08/the-art-of-groovy-command-expressions-in-dsls/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 09:00:34 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[DSLs]]></category>
		<category><![CDATA[hamlet]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2358</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/12/08/the-art-of-groovy-command-expressions-in-dsls/";</script>pre {font-size:95%;} Domain Specific Languages (DSLs) are often littered with the accidental complexity of the host language. Have you ever seen a supposedly &#8220;friendly&#8221; language expression like &#8220;ride(minutes(10)).on(bus).towards(Basel)&#8221;. The newest version of Groovy contains a language feature that aims to eliminate the noise of all those extra periods and parenthesis, so that your DSL looks [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/12/08/the-art-of-groovy-command-expressions-in-dsls/";</script><style type="text/css">
pre {font-size:95%;}
</style>
<p><em>Domain Specific Languages (DSLs) are often littered with the accidental complexity of the host language. Have you ever seen a supposedly &#8220;friendly&#8221; language expression like &#8220;ride(minutes(10)).on(bus).towards(Basel)&#8221;. The newest version of Groovy contains a language feature that aims to eliminate the noise of all those extra periods and parenthesis, so that your DSL looks more like &#8220;ride 10.minutes on bus towards Basel&#8221;. This article shows you step-by-step how to use Groovy Command Expressions and plain old metaprogramming to write just this DSL, and also offers advice on when, and when not, to use this new language feature.</em></p>
<h2>The State of the Art with DSLs</h2>
<p>Domain Specific Languages (DSLs) have been in vogue for a long time, and the topic has featured regularly at No Fluff shows for years now. The value proposition of a DSL rests in the idea that programmers and users benefit from expressing their desires in a language closer to English than to Java, using words suited to the problem domain rather than the programming language. The goal is <em>not</em> to create an entire new language, but to create a small language just big enough for users to capture their commands and intents in a more natural way than is typically possible in code.</p>
<p>Different languages support DSLs in various ways. Some languages make it easy to write nice, readable natural language-ish code and others do not. Over the next few pages we&#8217;ll explore the state of the art with Groovy DSLs, starting with looking at some unimaginative Groovy code, seeing how to convert into a better fluent interface, transforming it further using metaprogramming, and finally showing the full power of Groovy Command Expressions. As a sample problem, imagine trying to specify directions on how to get somewhere. By the end of the article you&#8217;ll understand how the Groovy code in Listing 1 works even though to looks almost like plain English sentences.<br />
<pre><pre>stand 7.minutes at busstop
ride 10.stops on bus towards Basel
stand 5.minutes at tramstop
ride 3.stops on tram towards Birsfelden</pre></pre>Listing 1: A DSL for giving Directions</p>
<h2>The Canvas</h2>
<p>We&#8217;ll use the same running example through all of the exercises. So let&#8217;s start by painting out a few primitive ideas. Think of these basic building blocks as the undercoat to our DSL canvas. Thinking about your domain is always a good place to start if you&#8217;re considering writing a DSL. Think, analyze, and compare the domain to see how it should be naturally organized. If you read the example in Listing 1, you may notice a few similarities between the different lines of code. There are actions, such as &#8216;stand&#8217; and &#8216;ride&#8217;. There are vehicles, such as a &#8216;bus&#8217; or a &#8216;tram&#8217;. And there are locations, such as the &#8216;bus stop&#8217;, &#8216;Basel&#8217;, and &#8216;Birsfelden&#8217;. We&#8217;ll model the actions as methods later, so let&#8217;s skip those for now. Vehicles and Locations are fairly straightforward, so we&#8217;ll model those as Java enums, as shown in Listing 2. I&#8217;ve put them in a package so that I can do a static import on them later.<br />
<pre><pre>package nfjs

enum Location {
&nbsp;&nbsp;&nbsp;&nbsp;busstop, Basel, tramstop, Birsfelden
}
enum Vehicle {
&nbsp;&nbsp;&nbsp;&nbsp;bus, tram
}</pre></pre>Listing 2: Modeling Locations and Vehicles</p>
<p>There is also something else in common between all of the instructions from Listing 1. They all have a duration or distance, such as &#8217;7 minutes&#8217; or &#8217;10 stops&#8217;. A duration is a little bit harder to model, but not much so. For sake of simplicity, we&#8217;ll just define a Duration class that represents either a unit of time or a unit of distance, as shown in Listing 3. I applied the TupleConstructor annotation to generate a set of constructors on the object, making it a little easier to work with. <pre><pre>@TupleConstructor
class Duration {
&nbsp;&nbsp;&nbsp;&nbsp;int value
&nbsp;&nbsp;&nbsp;&nbsp;String unit

&nbsp;&nbsp;&nbsp;&nbsp;String toString() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;$value $unit&quot;
&nbsp;&nbsp;&nbsp;&nbsp;}
}</pre></pre>Listing 3: Modeling a Duration</p>
<p>The last bit of undercoat to apply to our canvas is the Instruction object itself. Listing 1 creates a list of Instructions behind the scenes, so we&#8217;ll need to model those as well. Similar to Duration, it&#8217;s a simple data type with a few properties and is shown in Listing 4.<pre><pre>@TupleConstructor
class Instruction {
&nbsp;&nbsp;String action
&nbsp;&nbsp;Location location
&nbsp;&nbsp;Duration duration
&nbsp;&nbsp;Vehicle vehicle

&nbsp;&nbsp;String toString() {
&nbsp;&nbsp;&nbsp;&nbsp;if (vehicle != null) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;$action $duration on $vehicle towards $location&quot;
&nbsp;&nbsp;&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;$action $duration at $location&quot;
&nbsp;&nbsp;}
}</pre></pre>Listing 4: Modeling an Instruction</p>
<p>An Instruction has an action (stand or ride), a location (bus stop or Basel), a duration (five minutes or three stops), and optionally a vehicle (a bus or a tram). Now that the undercoat is applied, let&#8217;s look at some different ways to construct these Instruction objects.</p>
<h2>Cave Paintings</h2>
<p>The most primitive way to create Instructions is to call the constructors of objects directly. This is hardly a DSL but at least it is an improvement over the Java equivalent. There&#8217;s not much here to be proud of, and list literals like [] and the leftShift operator to add list elements is only a slight improvement over the alternative. At least Listing 5 is rather short.<pre><pre>import static cmdexprs.Location.*
import static cmdexprs.Vehicle.*

instructions = []

instructions &lt;&lt; new Instruction(
&nbsp;&nbsp;&nbsp;&nbsp;&#039;stand&#039;, busstop, new Duration(5, &#039;minutes&#039;) 
)
instructions &lt;&lt; new Instruction(
&nbsp;&nbsp;&nbsp;&nbsp;&#039;ride&#039;, Basel, new Duration(10, &#039;stops&#039;), bus
) </pre></pre>Listing 5: Creating Instructions Explicitly </p>
<p>The problems with this code sample is that there is a lot of accidental complexity: pieces of the underlying programming language bleed through and obscure the intent. In the first instance, only the words &#8216;stand bustop 5 minutes&#8217; are essential to the problem of creating instructions. The other 59 of the 79 characters are non-essential complexity. A 25% signal to noise ratio is pretty poor. The classical solution to this problem (in a sense that it can be applied to Java code as well) is to create a fluent interface around Instruction objects so that the end user is shielded from these implementation details.<br />
<h2>Classicism</h2>
<p>A fluent interface is a way to chain method calls together in order to eliminate a lot of the noise associated with configuring data. Fluent interfaces can be created with statically compiled languages as well (like Java) and requires no special metaprogramming facilities in the host language. The trick is to be creative with method return types. Listing 6 shows the result of improving our signal to noise ration after refactoring to a fluent interface. <pre><pre>stand(minutes(5)).at(busstop)
ride(minutes(10)).on(bus).towards(Basel)</pre></pre>Listing 6: A Fluent Interface for Instructions </p>
<p>This is a big improvement and raises or signal to noise ratio from 25% all the way up to 75%. The only noise left in this example is the parenthesis party nestled between all the interesting bits. Hmmm, looks like someone invited a few periods along as well. We&#8217;ll do better in the next example, but let&#8217;s look at how to implement this fluent interface first.  </p>
<p>As I said, the trick is to be creative with return types. For example, the code &#8216;minutes(5)&#8217; actually instantiates a Duration object for us (Listing 7), which is then passed into the &#8216;stand&#8217; method as an argument.  <pre><pre>def minutes(int length) { 
&nbsp;&nbsp;&nbsp;&nbsp;new Duration(length, &#039;minutes&#039;) 
} </pre></pre>Listing 7: A minutes Method </p>
<p>The trick is to make all of the method calls chain together. So the &#8216;stand&#8217; method needs to return something that has an &#8216;at&#8217; method on it, and that in turn needs to accept a Location parameter and create the actual Instruction. Technically speaking, stand is a higher-order function: it is a method that returns to you a method. Groovy&#8217;s dynamic typing and map-implemented interfaces make this a pretty simple task, as shown in Listing 8.  <pre><pre>def stand(Duration duration) {&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;[at: { Location loc -&gt;
&nbsp;&nbsp;&nbsp;&nbsp;instructions &lt;&lt; new Instruction(&#039;stand&#039;, loc, duration)
&nbsp;&nbsp;}]
}</pre></pre>Listing 8: The stand Method returns another Method</p>
<p>In Groovy, an object can be created as a Map literal using the [key: value] syntax. If the keys are Strings and the values or Closures, then that object can be treated as an object and have methods invoked on it, which is what Listing 8 shows.</p>
<p>At first, fluent interfaces often seem complex to implement. But after writing one or two you&#8217;ll often find it is really not too difficult. You have to think differently about how you craft an API, but in the end you can get a lot of usage and nice APIs using a fluent interface instead of metaprogramming. Let&#8217;s turn now towards bouncing some of those pesky parentheses out of the party using a little Groovy metaClass magic.</p>
<h2>Impressionism</h2>
<p>In our tour of DSL art, I&#8217;m calling the next technique impressionism. Like impressionist paintings, it does a slightly better job of capturing the intent than the previous example, but if you examine it closely it doesn&#8217;t seem to be much clearer than the alternatives. The motivating code is in Listing 9, can you spot the difference? <pre><pre>stand(5.minutes).at(busstop)
ride(10.stops).on(bus).towards(Basel)</pre></pre>Listing 9: Five Minutes not Minutes Five</p>
<p>There are two less parentheses, but an added period. &#8216;minutes(5)&#8217; became &#8217;5.minutes&#8217;. The signal to noise ratio improvement is marginal; the advantage here is that the code more closely resembles the away we speak. Nobody sticks their head over the cube wall at 12:05 and asks, &#8220;Do you want to go to lunch in minutes 5?&#8221; Instead, they say &#8220;5 minutes&#8221;, which is exactly what this code says. This is a small change to implement, and listing 10 shows that making the language support singular and plural words is just a few lines of code. <pre><pre>
Integer.metaClass.getMinute&nbsp;&nbsp;= { new Duration(delegate, &#039;minute&#039;) }
Integer.metaClass.getMinutes = { new Duration(delegate, &#039;minutes&#039;) }
Integer.metaClass.getStop&nbsp;&nbsp;&nbsp;&nbsp;= { new Duration(delegate, &#039;stop&#039;) }
Integer.metaClass.getStops&nbsp;&nbsp; = { new Duration(delegate, &#039;stops&#039;) }</pre></pre>Listing 10: Metaprogramming the Duration</p>
<p>What&#8217;s happening here is that we&#8217;re adding a method called &#8216;minutes&#8217; and &#8216;minute&#8217; onto the Integer class, and this method is creating the Duration object for us. Other than replacing the old &#8216;minutes()&#8217; method with these four lines of code, there is no change to the previous example. The code all just stays the same.</p>
<p>The combination of fluent interface and metaprogramming is powerful. Sure, there are some issues with periods and parentheses, but overall it is a pretty big improvement over trying to call constructors and wire objects together in Java. Groovy 1.8 takes things a little bit further and leaves us with the best example yet.</p>
<h2>Expressionism</h2>
<p>The last example is the best. It contains a minimum of accidental complexity and Groovy bleed-through and looks almost like the English language equivalent. For fun, I encourage you to compare Listing 11 with the cave paintings listing in Listing 5. It&#8217;s quite a bit improved.<pre><pre>stand 7.minutes at busstop
ride 10.stops on bus towards Basel</pre></pre>Listing 11: Command Expressions</p>
<p>I call this final version Expressionism, not because it relates very well to the 20th century art movement of the same name, but because it uses a new feature called Command Expressions and is the most expressive of all the examples.</p>
<p>So what are the code changes? You might notice that there are no more listings in this article. That&#8217;s right, command expressions are just the way code may be written now. Listing 11 showing the command expression usage and Listing 9 without the usage are functionally equivalent. &#8216;Stand&#8217; and &#8216;ride&#8217; are still method calls that return the &#8216;at&#8217; and &#8216;on&#8217; methods. As long as the code follows the follows the pattern &#8216;method parameter method parameter method parameter&#8217; then it gets converted into &#8216;method(parameter).method(parameter).method(parameter)&#8217;. You can chain as many together as you like; Groovy won&#8217;t complain. The result is a nice readable chain of expressions without any additional effort. At the time being, Command Expressions are the state of the art when it comes to DSLs in Groovy.</p>
<h2>Art Criticism</h2>
<p>There are a couple of pitfalls to be wary of. Command expressions are shown here in the best possible light in order to display their power. In reality, they are also a little fragile. Any code not following the &#8216;method parameter method parameter&#8217; rhythm doesn&#8217;t easily fit into the command expression pattern. The result is that you might have to twist your words a little to make them fit into this pattern, which moves it away from natural language and towards accidental complexity. Also, there is always the Groovy grammar and keywords to look out for. For instance &#8216;for&#8217;, &#8216;native&#8217;, and other keywords cannot appear in your DSL, a problem which other languages do have solutions for.</p>
<p>Also, it is probably best to avoid command expressions outside of DSLs. The code &#8216;list.collect{ &#8230; } each { &#8230; }&#8217; looks like a syntax error to most Groovy programmers because there is a period missing before the each method call. However, it isn&#8217;t wrong and works just fine. Confusing, but correctly functioning. Currently, Groovy programmers are used to some parentheses and periods, and it&#8217;s confusing to leave them out unless you have good reason.</p>
<h2>Create Your Own Art</h2>
<p>Thus concludes the tour of the state of the art with Groovy DSLs. To start, Groovy fluent interfaces are a great way to organize an API and make it easy to use. While not a true domain specific language, in a low ceremony language like Groovy they can go a long way towards increased expressiveness and better signal to noise ration without resorting to programming trickery. For more power, start to use metaprogramming to fine tune the the exact API you need, and use Groovy Command Expressions when you need them. How go forth and make your next DSL a true work of art.</p>
<p><em>Need help with Groovy? Canoo is ready to tackle any challenge. Contact info@canoo.com to learn more about Groovy Training and Consulting.</em></p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/12/08/the-art-of-groovy-command-expressions-in-dsls/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/12/08/the-art-of-groovy-command-expressions-in-dsls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaOne 2011 Thursday and wrap-up</title>
		<link>http://www.canoo.com/blog/2011/10/07/javaone-2011-thursday-and-wrap-up/</link>
		<comments>http://www.canoo.com/blog/2011/10/07/javaone-2011-thursday-and-wrap-up/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 05:15:10 +0000</pubDate>
		<dc:creator>Dierk</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[JavaOne]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[canoo]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Dierk König]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2291</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/07/javaone-2011-thursday-and-wrap-up/";</script>Opinions expressed in the post are solely my own and not necessarily those of my employer. Thursday started with the Community Keynote. Well, it actually started with a 25 minutes IBM presentation about their cloud story. This had obviously nothing to do with the topic of the event and later speakers pointed this out rather [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/07/javaone-2011-thursday-and-wrap-up/";</script><div id="_mcePaste"><em>Opinions expressed in the post are solely my own and not necessarily those of my employer.</em></div>
<div><em><br />
</em></div>
<div>Thursday started with the Community Keynote. Well, it actually started with a 25 minutes IBM presentation about their cloud story. This had obviously nothing to do with the topic of the event and later speakers pointed this out rather frankly. At least it was interesting to hear that there is a job title like &#8220;Cloud Architect&#8221;.</div>
<div id="_mcePaste">The real part of the Community Keynote started with a <em>quiet moment to honor Steve Jobs</em>.</div>
<div id="_mcePaste">Later on, various winners of the Duke choice award and JUG luminaries cared for a lighter mood again, presented their work and asked the audience for participation in their local JUGs and in the advancement of Java via the OpendJDK. The JavaPosse appeared on stage and presented a funny show.</div>
<div id="_mcePaste">It was also announced that many of the JavaOne talks will be available on parleys.com, which provide by far the best experience when it comes to viewing live-captured talks.</div>
<div id="_mcePaste">Afterwards I attended the ZeroTurnaround (JRebel) talk on classloader issues. The rather big room (~300 ppl) was packed and left the impression that many Java developers share a common pain around classloaders. It was a good talk, covering the basics and typical pifalls. The only surprise for me was *how* easily you can end up with a classloader leak.</div>
<div id="_mcePaste">In order to improve my fathering skills, I went into Ken Sipe&#8217;s talk on &#8220;Rocking the Gradle&#8221;, where I met Adam Bien. Ken is a great presenter. However, convincing the crowd is a challenge especially as many Maven users seem to suffer from the Stockholm syndrome.</div>
<div id="_mcePaste">Then onto &#8220;Visualization of Geomaps and Topic Maps with JavaFX 2.0&#8243;, which had some interesting visuals captured <a href="http://www.lodgon.com/lodgon/NEWS/Artikelen/2010/9/22_Our_CTO_presented_a_JavaOne_session_on_JavaFX.html">here</a>.</div>
<div>For me JavaOne 2011 finished with Jim Clarke and Dean Iverson on GroovyFX, where they made some really good points suggesting that Groovy is the best language to drive the JavaFX 2.0 API.</div>
<div>As a side note, James Weaver introduced me to Jim Clarke by pointing out &#8220;He is from *<strong>Canoo</strong>*&#8221;. Then the discussion went into how well-known Canoo is in the community and that all employees must be true geniuses to achieve so much with so few people <img src='http://www.canoo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </div>
<div>Fazit: Still, JavaOne is nowhere near where it was before the Oracle acquisition both in terms of size and in terms of being an unparalleled community experience. Distribution all over various hotels just doesn&#8217;t feel right. However, meeting friends has been and still remains the most important part of JavaOne and the conference still delivers on that account.</div>
<div id="_mcePaste">Important topics were new Java versions, JavaEE (+cloud), and Java for the Desktop with 50+ talks on JavaFX. Whenever the audience was asked about which alternative languages they use, Groovy was the clear winner. It appears that in the mainstream, Groovy has become the default choice for dynamic programming on the JVM.</div>
<div id="_mcePaste">The topic of concurrent programming was in my eyes underrepresented. Guillaume and myself had simple usage of GPars in our demos but for such a big and increasingly important topic the coverage should be much more extensive.</div>
<div>Finally, some visual impressions.</div>
<div>Good-bye SF</div>
<div>Dierk Koenig</div>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-01.jpg"><img class="alignnone size-medium wp-image-2292" title="j1-01" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-01-225x300.jpg" alt="" width="225" height="300" /></a><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-02.jpg"><img class="alignnone size-medium wp-image-2293" title="j1-02" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-02-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-03.jpg"><img class="alignnone size-medium wp-image-2294" title="j1-03" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-03-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-04.jpg"><img class="alignnone size-medium wp-image-2295" title="j1-04" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-04-225x300.jpg" alt="" width="225" height="300" /></a><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-17.jpg"><img class="alignnone size-medium wp-image-2296" title="j1-17" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-17-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-25.jpg"><img class="alignnone size-medium wp-image-2297" title="j1-25" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-25-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-27.jpg"><img class="alignnone size-medium wp-image-2298" title="j1-27" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/j1-27-300x225.jpg" alt="" width="300" height="225" /></a></p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/10/07/javaone-2011-thursday-and-wrap-up/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/10/07/javaone-2011-thursday-and-wrap-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaOne 2011 Wednesday</title>
		<link>http://www.canoo.com/blog/2011/10/06/javaone-2011-wednesday/</link>
		<comments>http://www.canoo.com/blog/2011/10/06/javaone-2011-wednesday/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 17:11:44 +0000</pubDate>
		<dc:creator>Dierk</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaOne]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[Dierk König]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2286</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/06/javaone-2011-wednesday/";</script>Opinions expressed in this post are totally my own and not necessarily that of my employer. Wednesday started with the infamous &#8220;scriptbowl&#8221;, a competition between various scripting languages. This year the contenters were JRuby, Groovy, Scala, and Clojure. I wondered whether Scala considers itself a scripting language but obviously they either do or just seek [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/06/javaone-2011-wednesday/";</script><p><em>Opinions expressed in this post are totally my own and not necessarily that of my employer.</em></p>
<p>Wednesday started with the infamous &#8220;scriptbowl&#8221;, a competition between various scripting languages. This year the contenters were JRuby, Groovy, Scala, and Clojure. I wondered whether Scala considers itself a scripting language but obviously they either do or just seek the opportunity to be on stage.</p>
<p>To keep a long story short: <strong>Groovy has won this event for the third time in a row</strong>! This year the race was tied with Scala. Guillaume presented Groovy in the typical Groovy-idomatic style and explained every single line of his concurrent visual analyzer for Google+ postings. Dick Wall presented only non-idomatic Scala code. I interpret this as: to make Scala appealing you have to make it look like Groovy. Furthermore, he presented Kojo, which is a great interactive learning environment written in Play/Scala. In contrast to all other presentations, this was not specifically created for the scriptbowl, nor was it written by the presenter, nor was it clear how much effort went into it, nor did the audience see a single line the implementation code. How much this skewed the comparison, I leave to everybody&#8217;s judgement. The show was good, though.</p>
<p>I felt a bit sorry for Clojure. It is a great language and deserves a presentation that is more visually appealing to convince the crowd.</p>
<p>Afterwards, I attended a hands-on lab for &#8220;rapid enterprise development with netbeans&#8221;, which was essentially creating a Swing app for database CRUD actions. If I remember correctly, I did the exact same task 1997 with JBuilder. It left me with the feeling of &#8220;Yes, it works&#8221; but it is not less complex than it was 13 years ago.</p>
<p>Early afternoon Gerrit Grunwald (better known as @hansolo_) presented his work on simplified custom components for Swing. Given that he speaks about an activity that is both utterly important and highly underadvertised he would really deserve speaking at the center stage.</p>
<p>Graeme Rocher&#8217;s great session about Grails, polyglot datastores (hibernate, jpa, redis, mongodb, &#8230;), and the cloud was overshadowed by the news that Steve Jobs has died. Accidentally, the demo application was about showing a BBC News stream, which displayed this information live on stage. Both the presenter and the audience were equally touched.</p>
<p>The day officially ended with a big event at treasure island. I decided to not go there, though, and meet the former Canooey Denis Antonioli in Berkely where we had a great evening.</p>
<p>Dierk Koenig</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/10/06/javaone-2011-wednesday/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/10/06/javaone-2011-wednesday/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JavaOne 2011 Tuesday</title>
		<link>http://www.canoo.com/blog/2011/10/05/javaone-2011-tuesday/</link>
		<comments>http://www.canoo.com/blog/2011/10/05/javaone-2011-tuesday/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 05:33:59 +0000</pubDate>
		<dc:creator>Dierk</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaOne]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Dierk König]]></category>
		<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2281</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/05/javaone-2011-tuesday/";</script>The Java strategy keynote started slowly with Juniper networks presenting their take on Java, which was in my eyes not really related to the topic of the keynote. It then went on into the Java roadmap with the announcement that new Java versions should come every two years, which sounded to me like an excuse [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/05/javaone-2011-tuesday/";</script><div id="_mcePaste">The Java strategy keynote started slowly with Juniper networks presenting their</div>
<div id="_mcePaste">take on Java, which was in my eyes not really related to the topic of the keynote.</div>
<div id="_mcePaste">It then went on into the Java roadmap with the announcement that new Java versions</div>
<div id="_mcePaste">should come every two years, which sounded to me like an excuse for Java 8 being</div>
<div id="_mcePaste">deferred until &#8220;Summer 2013&#8243;.</div>
<div id="_mcePaste">The real surprise was a demonstration of JavaFX running various devices like</div>
<div id="_mcePaste">tablets and smartphones running Windows, Android, and even iOS! It appeard to</div>
<div id="_mcePaste">be experimental but the sheer possibility makes a difference.</div>
<div id="_mcePaste">In addition, JavaFX will be fully open-source such that everybody is free to</div>
<div id="_mcePaste">port it to his platform of choice.</div>
<div id="_mcePaste">Over lunch, the &#8220;Java Desktop Community&#8221; assembled in a nearby restaurant.</div>
<div id="_mcePaste">That was an awesome opportunity for meeting the Swing and JavaFX luminaries just like in the years before.</div>
<div id="_mcePaste">In the early afternoon, I headed for the talk about custom JavaFX components</div>
<div id="_mcePaste">presented by Jonathan Giles and Jasper Potts. It appears customizing any</div>
<div id="_mcePaste">control is mainly done via CSS. In other words, there is no typesafe API.</div>
<div id="_mcePaste">I would rather prefer to use CSS only for &#8220;skinning&#8221; and keeping an API for</div>
<div id="_mcePaste">source-code integration.</div>
<div id="_mcePaste">It also came out that the current JavaFX version doesn&#8217;t contain e.g. a</div>
<div id="_mcePaste">ComboBox. This came as a surprise since I would expect this as being part</div>
<div id="_mcePaste">of the standard widget set. I curious what else is missing.</div>
<div id="_mcePaste">There also is a distinction between public and private APIs that didn&#8217;t</div>
<div id="_mcePaste">make immediate sense to me &#8211; other than the private parts are not yet</div>
<div id="_mcePaste">finished.</div>
<div id="_mcePaste">The afternoon JavaPosse BOF was rather disappointing. They re-told the</div>
<div id="_mcePaste">story of this morning&#8217;s keynote. Who needs that?</div>
<div id="_mcePaste">Visiting the pavillion was nice even though it was just as small as</div>
<div id="_mcePaste">last year. Anyway, I ran into a number of friends and dropped by the</div>
<div id="_mcePaste">gradleware booth. They liked my animated Gradle logo, that I implemented</div>
<div id="_mcePaste">with the Groovy-based FXG interpreter.</div>
<div id="_mcePaste">The SpringSource friends were just shutting down the booth and invited</div>
<div id="_mcePaste">me to dinner: http://t.co/LfxhjIH8 . Thanks a lot!</div>
<p>Finally, late in the evening I joined Dan Sline&#8217;s talk on WebServices in the Groovy space. The major take-away for me was a repercussion of the well-known advice: &#8220;keep it simple&#8221;.</p>
<p>Throughout the day, a lot of people approached me to tell how much they liked my talks yesterday. That was a really nice experience. Last year I had the very last talk of the conference and only this year I recognized how much of a difference the scheduling of the talks make.</p>
<p>Dierk Koenig</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/10/05/javaone-2011-tuesday/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/10/05/javaone-2011-tuesday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaOne 2011 Monday</title>
		<link>http://www.canoo.com/blog/2011/10/04/javaone-2011-monday/</link>
		<comments>http://www.canoo.com/blog/2011/10/04/javaone-2011-monday/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 06:40:38 +0000</pubDate>
		<dc:creator>Dierk</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[JavaOne]]></category>
		<category><![CDATA[Dierk König]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2273</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/04/javaone-2011-monday/";</script>The technical keynote started with a weird JavaZone-style video featuring a Java programmer as a rapper. It was certainly intended to be funny but as far as I can tell, it didn&#8217;t catch on. The keynote was packed but the somehow reduced ballroom layout added to this impression. Attendance was said to be twice that [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/04/javaone-2011-monday/";</script><p>The technical keynote started with a weird JavaZone-style video featuring a Java programmer as a rapper. It was certainly intended to be funny but as far as I can tell, it didn&#8217;t catch on.</p>
<p>The keynote was packed but the somehow reduced ballroom layout added to this impression. Attendance was said to be twice that of last year (so probably around 10&#8217;000). Even though there are certainly more people than last year, a doubled number seems a bit exaggerated to me. Throughout the day, all talks were well attended, though, but nothing like in the days when JavaOne had 10&#8217;000 attendees in Moscone Center.</p>
<p>The technical content was not surprising, beside that Oracle now advertises its NoSQL solution, which is based on the former Berkeley DB. As expected JavaFX 2.0 GA has been announced along with the respective tooling and covered by 50 (!) talks on JavaFX at JavaOne. The JavaFX presentation started very conventionally but in the end showed some really cool lab projects with a dancing duke steered by gesture recognition.</p>
<p>The best presenter was Mark Reinhold on Java 7/8/9. Good style, nice slides, perfect pace, interesting (but not really surprising) content. New to me was project Nashorn: new JavaScript implementation for the JVM expected for Java 8. Project Lambda is planned to contain &#8220;defender methods&#8221;, default implementations for interface methods. That sounds like traits and actually I expect some issues when doing this in Java.</p>
<p>Overall, the keynote was missing the JavaOne &#8220;feeling&#8221; from the olden Sun times. There was no host that led through the event, welcomed the attendees, and encouraged everybody to network. No big names on stage, no overwhelming achievements. The crowd left the room unexcited.</p>
<p>For the rest of the day I was mainly concerned with preparing and delivering my own talks on &#8220;Extending Java&#8217;s reach with Groovy&#8221; and &#8220;Pro Groovy&#8221;. They were well attended and received.</p>
<p>Andres delivered his Griffon talk in parallel.</p>
<p>Afterwards, I was a tired but still listened to Charles Nutter on JVM bytecode, Dan Sline on Griffon, and Jim Discroll on Groovy DSLs. Quote to take away: &#8220;Oracle ADFm makes <strong>heavy</strong> use of Groovy!&#8221;</p>
<p>That&#8217;s it for today.</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/10/04/javaone-2011-monday/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/10/04/javaone-2011-monday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaOne 2011 Arrival</title>
		<link>http://www.canoo.com/blog/2011/10/02/javaone-2011-arrival/</link>
		<comments>http://www.canoo.com/blog/2011/10/02/javaone-2011-arrival/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 14:36:37 +0000</pubDate>
		<dc:creator>Dierk</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaOne]]></category>
		<category><![CDATA[Dierk König]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2261</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/02/javaone-2011-arrival/";</script>This is gonna be a short series about my impressions of JavaOne 2011. As always, it is nice to see the town decorated for the event, even though Oracle World gets certainly much higher attention. So the immigration officer as well as the nice guy sitting next to me on a bench at Union Square [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/10/02/javaone-2011-arrival/";</script><p>This is gonna be a short series about my impressions of JavaOne 2011.</p>
<p>As always, it is nice to see the town decorated for the event, even though Oracle World gets certainly much higher attention. So the immigration officer as well as the nice guy sitting next to me on a bench at Union Square ask &#8220;ah &#8211; you are a programmer? Are you here for Oracle World?&#8221; &#8220;Hmpf&#8230;&#8221;</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/IMG_2737.jpg"><img class="alignnone size-medium wp-image-2262" title="town decoration" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/IMG_2737-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Should you ask yourself &#8220;what&#8217;s in for me&#8221;? Here is a first answer: the conference material</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/IMG_2733.jpg"><img class="alignnone size-medium wp-image-2263" title="JavaOne 2011 material" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/IMG_2733-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>The bag is not very practical for a software developer. I guess the selection has been taken by an Oracle employee who assumes that their conference attendees never carry any material themselves in the first place (which may be true for OracleWorld). The jacket is very nice, though.</p>
<p>And, yes, you can rate conference organizers by the badges they produce. Hey, that should not be too difficult, right? Here is what you still can make wrong:</p>
<ul>
<li>Printing the delegate&#8217;s name so small that it is hardly readable from more than 20 cm away. Now since the badge usually hangs at belly height (if not lower) this can be a bit embarrassing for both involved parties.</li>
<li>Second, the name belongs on both sides of the badge! Really! How often did you try to read the name only finding that the badge hangs the wrong way around?</li>
</ul>
<p>Otherwise, the waiting time was not too long. The speakers registration was actually empty when I arrived. The attendees registration was pretty well filled, though. But then everybody has to go to the material pickup which was for me in Moscone West 3rd floor where I waited in line for about 20 minutes and I was very early and the queue grew much longer afterwards.</p>
<p><a href="http://www.canoo.com/blog/wp-content/uploads/2011/10/IMG_2734.jpg"><img class="alignnone size-medium wp-image-2265" title="material pickup waiting line" src="http://www.canoo.com/blog/wp-content/uploads/2011/10/IMG_2734-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>This made me think about my latest work on highly concurrent producer-consumer scenarios (http://people.canoo.com/mittie/kanbanflow.html) and what it would need to improve the situation.</p>
<p>Otherwise, from studying the program schedule, I found that Oracle has wisely chosen to pretty much always put two Groovy-related talks in parallel as if to make sure that nobody can escape the Groovy (\G) in these time-slots.</p>
<p>I&#8217;m eager to see what the week will bring.</p>
<p>Dierk Koenig, @mittie</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/10/02/javaone-2011-arrival/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/10/02/javaone-2011-arrival/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mock Objects with Spock Screencast</title>
		<link>http://www.canoo.com/blog/2011/07/13/mock-objects-with-spock-screencast/</link>
		<comments>http://www.canoo.com/blog/2011/07/13/mock-objects-with-spock-screencast/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 23:57:13 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[hamlet]]></category>
		<category><![CDATA[Screencast]]></category>
		<category><![CDATA[spock]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2209</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/07/13/mock-objects-with-spock-screencast/";</script>This screencast demonstrates how to use Spock testing specifications and Groovy for mocking and stubbing behavior in unit tests. It covers creating the mock object syntax, setting expectations, verifying and spying on results, and argument matchers. If you have any issues with video playback, then trying viewing it from the JBrains.tv website Here are some [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/07/13/mock-objects-with-spock-screencast/";</script><p>This screencast demonstrates how to use <a href="http://code.google.com/p/spock/">Spock testing</a> specifications and Groovy for mocking and stubbing behavior in unit tests. It covers creating the mock object syntax, setting expectations, verifying and spying on results, and argument matchers.</p>
<p>If you have any issues with video playback, then trying viewing it from the <a href="http://tv.jetbrains.net/videocontent/spock-and-mock-object-basics">JBrains.tv website</a></p>
<p><object width="400" height="300" id="_ipad" data="http://tv.jetbrains.net/flowplayer/flowplayer-3.2.7.swf" type="application/x-shockwave-flash"><param name="movie" value="http://tv.jetbrains.net/flowplayer/flowplayer-3.2.7.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value='config={"clip":{"scaling":"orig","autoPlay":false,"autoBuffering":true,"url":"/sites/default/files/videos/converted/spockmocking.mp4"},"plugins":{"controls":{"stop":true}},"playlist":[{"scaling":"orig","autoPlay":false,"autoBuffering":true,"url":"http://tv.jetbrains.net/sites/default/files/videos/converted/spockmocking.mp4"}]}' /></object>
<p>Here are some useful links to read for this webcast:</p>
<ul>
<li>Spock Framework &#8211; <a href="http://code.google.com/p/spock/">http://code.google.com/p/spock/ </a></li>
<li>Spock Basics Screencast: <a href="http://tv.jetbrains.net/videocontent/ffff">http://tv.jetbrains.net/videocontent/ffff </a></li>
<li>Mocks and Stubs aren&#8217;t Spies: <a href="http://hamletdarcy.blogspot.com/2007/10/mocks-and-stubs-arent-spies.html">http://hamletdarcy.blogspot.com/2007/10/mocks-and-stubs-arent-spies.html </a></li>
<li>Mocking with Spocks: <a href="http://www.canoo.com/blog/2010/04/20/spock-and-test-spies-a-logical-choice/">http://www.canoo.com/blog/2010/04/20/spock-and-test-spies-a-logical-choice/</a></li>
</ul>
<p>I&#8217;ve made a lot of screencasts and blog posts over the years. If you like this, then there are many ways to see the other stuff I&#8217;ve done: </p>
<ul>
<li>My main blog: <a href="http://hamletdarcy.blogspot.com/">http://hamletdarcy.blogspot.com</a></li>
<li>My other JetBrains.tv posts: <a href="http://tv.jetbrains.net/tags/hamlet">http://tv.jetbrains.net/tags/hamlet</a></li>
<li>IDEA related posts on my blog: <a href="http://hamletdarcy.blogspot.com/search/label/IDEA">http://hamletdarcy.blogspot.com/search/label/IDEA</a></li>
<li>My screencasts on YouTube: <a href="http://www.youtube.com/user/HamletDRC">http://www.youtube.com/user/HamletDRC</a></li>
<li>IDEA related Posts on my work blog: <a href="http://www.canoo.com/blog/tag/idea/">http://www.canoo.com/blog/tag/idea/</a></li>
<li>Or follow me on Twitter: <a href="http://twitter.com/hamletdrc">@HamletDRC</a></li>
</ul>
<p>Phew, that&#8217;s a lot of self-promotion <img src='http://www.canoo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The screencast was created with Ubuntu 10.04, PiTiVi, Audicity, gtk-RecordMyDesktop, IntelliJ IDEA, and LibreOffice. OS from top to bottom.</p>
<p>Thanks for watching, and leave a comment! </p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/07/13/mock-objects-with-spock-screencast/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/07/13/mock-objects-with-spock-screencast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://tv.jetbrains.net/sites/default/files/videos/converted/spockmocking.mp4" length="18412738" type="video/mp4" />
		</item>
		<item>
		<title>Grails Podcast Interview with Hamlet D&#8217;Arcy</title>
		<link>http://www.canoo.com/blog/2011/07/11/grails-podcast-interview-with-hamlet-darcy/</link>
		<comments>http://www.canoo.com/blog/2011/07/11/grails-podcast-interview-with-hamlet-darcy/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 20:11:44 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Hackergarten]]></category>
		<category><![CDATA[hamlet]]></category>

		<guid isPermaLink="false">http://www.canoo.com/blog/?p=2207</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/07/11/grails-podcast-interview-with-hamlet-darcy/";</script>Last week I sat down with the gang at the Grails Podcast and talked shop for about 45 minutes. We talked about a lot of different topics such as Groovy, Lean software, Spock, Groovy in Action, and of course Hackergarten. Check out the full audio and shownotes over at Grails Podcast Episode 125. var dzone_style="2";//]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://www.canoo.com/blog/2011/07/11/grails-podcast-interview-with-hamlet-darcy/";</script><p>Last week I sat down with the gang at the <a href="http://www.grailspodcast.com/">Grails Podcast</a> and talked shop for about 45 minutes. We talked about a lot of different topics such as Groovy, Lean software, Spock, Groovy in Action, and of course Hackergarten. Check out the full audio and shownotes over at <a href="http://www.grailspodcast.com/blog/id/247">Grails Podcast Episode 125</a>.</p>
<script>var dzone_style="2";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div style="float: left; width: 140px; height: 21px; overflow: hidden; position: relative; left: 8px;"><script>//<![CDATA[
reddit_url="http://www.canoo.com/blog/2011/07/11/grails-podcast-interview-with-hamlet-darcy/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.canoo.com/blog/2011/07/11/grails-podcast-interview-with-hamlet-darcy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

