<?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; General</title>
	<atom:link href="http://canoo.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://canoo.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 12 Aug 2010 11:50:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Something Wicked Comes this Way</title>
		<link>http://canoo.com/blog/2010/08/10/something-wicked-comes-this-way/</link>
		<comments>http://canoo.com/blog/2010/08/10/something-wicked-comes-this-way/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 11:52:39 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1439</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/08/10/something-wicked-comes-this-way/";</script>
Don&#8217;t doubt it for a second: A paradigm-shifting idea is taking shape on Johnny Anonymous&#8217;s laptop as I write these words. Johnny&#8217;s idea is a radical as it is ingenious. It will change the way you communicate, work, think&#8230; breath. It may bring you that one love you&#8217;ve been longing for all your life; bring [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/08/10/something-wicked-comes-this-way/";</script><p><img src="http://canoo.com/blog/wp-content/uploads/2010/08/google-evil.png" alt="google-evil" title="google-evil" width="291" height="112" class="aligncenter size-full wp-image-1440" /></p>
<p>Don&#8217;t doubt it for a second: A paradigm-shifting idea is taking shape on Johnny Anonymous&#8217;s laptop as I write these words. Johnny&#8217;s idea is a radical as it is ingenious. It will change the way you communicate, work, think&#8230; breath. It may bring you that one love you&#8217;ve been longing for all your life; bring your kids opportunities and joy beyond their wildest dreams; resolve international crises; lead to cures for cancer; cut CO2 emissions in half; make quantum mechanics comprehensible to the lay-person; cause Dan Brown to write a decent book (okay, maybe not). Hell, it may even help us to make contact with aliens &#8211; how cool is that?!</p>
<p>Will Johnny&#8217;s idea ever see the light of day? As long as the Internet remains a level playing field, he/it has good a chance as any. Yet if the likes of Veroogle (Goozon?) <a href="http://www.wired.com/epicenter/2010/08/google-verizon-propose-open-vs-paid-internets/all/1#ixzz0w8feVFEZ">have their way</a>, then Mr. CEO will quash Johnny&#8217;s idea quicker than you can say the words &#8220;big fat severance package&#8221;.</p>
<p>Should Big Corporate really be permitted to dictate the accessibility and the quality of service that Johnny&#8217;s idea receives when he attempts to reveal it to the world? Let me put it this way: Can we trust corporations to govern themselves in such a way that they <strong>never</strong>,<strong>ever</strong> take active steps to diminish the chances of a potential competitor&#8217;s idea from taking hold? Don&#8217;t worry &#8211; it was a rhetorical question.</p>
<p>Is the world &#8211; virtual or otherwise &#8211; really so oblivious to the messy, awesome beauty that is the Egalitarian Internet; so apathetic that it will not lift a finger to rescue one of humankind&#8217;s finest achievements? Will the masses revolt? Furthermore, who will speak for us? Where are you <a href="http://en.wikipedia.org/wiki/Tim_Berners-Lee">Tim Berners-Lee</a>?</p>
<p>So until the masses mobilize &#8211; and they surely must &#8211; here&#8217;s a tiny, yet powerful step that Joe Public &#8211; read: <strong>you</strong> &#8211; can take RIGHT THIS INSTANT: <a href="http://www.bing.com/">Bing</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://canoo.com/blog/2010/08/10/something-wicked-comes-this-way/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/08/10/something-wicked-comes-this-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Without the Boilerplate &#8211; Project Lombok</title>
		<link>http://canoo.com/blog/2010/07/26/java-without-the-boilerplate-project-lombok/</link>
		<comments>http://canoo.com/blog/2010/07/26/java-without-the-boilerplate-project-lombok/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:41:11 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[lombok]]></category>
		<category><![CDATA[ulc]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1411</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/26/java-without-the-boilerplate-project-lombok/";</script>Project Lombok is a very cool little Java library that aims (and succeeds) in removing boilerplate, meaningless, and uninteresting code from your Java objects. The basic idea is to replace things like getters and setters with simple annotations, and then let the Java compiler generate the necessary bytecode in the .class file so that tools [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/26/java-without-the-boilerplate-project-lombok/";</script><p><a href="http://projectlombok.org/">Project Lombok</a> is a very cool little Java library that aims (and succeeds) in removing boilerplate, meaningless, and uninteresting code from your Java objects. The basic idea is to replace things like getters and setters with simple annotations, and then let the Java compiler generate the necessary bytecode in the .class file so that tools such as Eclipse and the Java compiler have no idea what anything unusual happened. Lombok hooks into the compiler to make sure this happens correctly. </p>
<p>First we&#8217;ll cover some Lombok basics and then show how it can be used with the Canoo RIA Suite (ULC) project and and view generators. This includes details on how to mix Lombok annotated objects with JPA annotations, which you might want to glance at before leaving!</p>
<p>Update: You do <strong>not</strong> need ULC to work with Lombok. The two are separate projects. </p>
<p><strong>Lombok in Action</strong><br />
So let&#8217;s see Lombok in action. Consider this Java class that includes a Lombok annotation:<br />
<pre><code>
import lombok.Data;

public @Data class Contact {
&nbsp;&nbsp;&nbsp;&nbsp;private String name;
&nbsp;&nbsp;&nbsp;&nbsp;private String email;
&nbsp;&nbsp;&nbsp;&nbsp;private String primaryPhone;
}
</code></pre><br />
OK, so there is an @Data annotation in there. So what? Well, to javac and tools (like Eclipse) this class has getters and setters for all three fields, an equals and hashcode implementation, and a toString method. Eclipse tools still give you autocomplete the Navigator shows the correct methods. Not only did you not have to write (or generate) the code yourself, but you don&#8217;t have to see that code when coming back in maintenance mode. The interesting bits of your class are no longer buried in the noise. Consider what this looks like without lombok:<br />
<pre><code>
public @Data class Contact {
&nbsp;&nbsp;&nbsp;&nbsp;private String name;
&nbsp;&nbsp;&nbsp;&nbsp;private String email;
&nbsp;&nbsp;&nbsp;&nbsp;private String primaryPhone;

&nbsp;&nbsp;&nbsp;&nbsp;public String getName() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return name;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;void setName(String name) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.name = name;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;public String getEmail() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return email;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;void setEmail(String email) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.email = email;
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;public String getPrimaryPhone() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return primaryPhone;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;void setPrimaryPhone(String primaryPhone) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.primaryPhone = primaryPhone;
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;@Override public String toString() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return &quot;Contact(&quot; + name + &quot;, &quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ email + &quot;, &quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ primaryPhone + &quot;)&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;@Override public boolean equals(Object o) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (o == this) return true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (o == null) return false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (o.getClass() != this.getClass()) return false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Contact other = (Contact) o;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (name == null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? other.name != null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: !name.equals(other.name)) return false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (email == null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? other.email != null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: !email.equals(other.email)) return false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (primaryPhone == null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? other.primaryPhone != null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: !primaryPhone.equals(other.primaryPhone)) return false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;@Override public int hashCode() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final int PRIME = 31;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int result = 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = (result*PRIME) + (name == null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? 0 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: name.hashCode());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = (result*PRIME) + (email == null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? 0 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: email.hashCode());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = (result*PRIME) + (primaryPhone == null 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? 0 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: primaryPhone.hashCode());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return result;
&nbsp;&nbsp;&nbsp;&nbsp;}
</code></pre><br />
That&#8217;s a lot of code for something so simple. It doesn&#8217;t even fit in my browser margins without funky line breaks! Sure, IDEs can generate it for you. But what if something interesting is buried in the equals() method? Or perhaps a setter has a side-effect? You can&#8217;t easily see this with the reams of boilerplate typical of Java. With lombok, only the essentials are displayed, so the unique parts of the object will stand out to the future reader. And yes, even using @Data you are free to provide your own implementations for any of these methods. </p>
<p><a href="http://www.dreamsongs.com/">Richard Gabriel</a> made this observation when comparing old programs (like <a href="http://beust.com/macpaint/MacPaint.html">MacPaint</a>) to &#8220;modern&#8221; programs writen in langauges like Java: </p>
<blockquote><p>I&#8217;m always delighted by the light touch and stillness of early programming languages. Not much text; a lot gets done. Old programs read like quite conversations between a well-spoken research worker and a well-studied mechanical colleague, not as a debate with a compiler. Who&#8217;d have guessed sophistication brought such noise. </p></blockquote>
<p>Now, with Lombok, sophistication is finally taking the noise away, rather than adding to it. </p>
<p>Just a couple important details before moving on to a Lombok example that uses <a href="http://www.canoo.com/ulc">Canoo&#8217;s RIA Suite</a>&#8230; </p>
<li>Lombok is compile time only. It does not need to be deployed with your app</li>
<li>Lombok works with javac and Eclipse. IntelliJ IDEA will not &#8217;see&#8217; the added methods</li>
<li>lombok.jar contains an installer that configures your eclipse.ini file correctly. Be sure to run &#8220;java -jar lombok.jar&#8221; after you download it (especially for those on 64 bit Linux like me)</li>
<p><strong>Lombok with Canoo RIA Suite</strong><br />
The point of this was to make sure I could use Lombok on my next RIA Suite(aka ULC) project. It&#8217;s looks like I can, and you can too. To prove it, let&#8217;s generate a RIA Suite project, add a domain class using Lombok, generate the views, and run the application. </p>
<p><strong>Prerequisites</strong></p>
<li>Install <a href="http://www.eclipse.org/downloads/">Eclipse for Java EE Developers</a>. Make sure that you have <i>for Java EE developers</i>.</li>
<li>Install <a href="http://www.canoo.com/webexperts/products/licences/">Canoo RIA Suite</a>. Get your download and evaluation key from <a href="http://www.canoo.com/kurt/user/create">our customer portal</a>.</li>
<li>Install <a href="http://projectlombok.org//">Lombok</a>. Download it and run &#8220;java -jar lombok.jar&#8221;.</li>
<p><strong>Steps</strong><br />
Here are the steps we&#8217;ll perform to get this thing working: </p>
<li>Generate a Project using ULC&#8217;s Project Generator in Eclipse</li>
<li>Add the lombok Jar to your project</li>
<li>Create a domain object called Contact and annotate it with @Data</li>
<li>Generate the views using ULC&#8217;s generate-beans-view in Eclipse</li>
<li>Run the app and behold a default, thin client, CRUD application</li>
<p><strong>Generate the Project</strong><br />
The <a href="http://ulc.canoo.com/developerzone/ULCApplicationDevelopmentGuide.pdf">ULC Application Development Guide</a> contains a 10 page getting started tutorial that walks you through the process from starting at zero and going to a deployed RIA Suite application. Really, it is quite simple. You just need to add the Project Generator as an external tool in Eclipse. Although it is a bunch of screenshots, this is a common task for Eclipse users and little can go wrong. </p>
<p>In Eclipse, click Run -> External Tools > Open External Tools Dialog&#8230; and point a new external tool to your &#8220;/addon/generators/build-setup.xml&#8221; from the RIA Suite install. Your window should look like this: </p>
<p><img src="http://canoo.com/blog/wp-content/uploads/2010/07/0ToolConfiguration2.png" alt="0ToolConfiguration" title="0ToolConfiguration" width="600" height="427" class="aligncenter size-full wp-image-1425" /></p>
<p>Now you&#8217;ll have the menu entry for Run -> External Tools -> ULC Project Generator, which you should click now. You&#8217;ll be prompted for a project name and whatnot, and a sample Contacts application will look like this: </p>
<p><img src="http://canoo.com/blog/wp-content/uploads/2010/07/1GenerateProject.png" alt="1GenerateProject" title="1GenerateProject" width="600" height="357" class="aligncenter size-full wp-image-1426" /></p>
<p>The script runs and you now have a project on disk that can be run. Just click to File -> Import to import it, navigating to where it is on disk. Your import screen should look like this: </p>
<p><img src="http://canoo.com/blog/wp-content/uploads/2010/07/2ImportProoject.png" alt="2ImportProoject" title="2ImportProoject" width="570" height="613" class="aligncenter size-full wp-image-1428" /></p>
<p>If it all goes well your project should be open and your Project Explorer should look like this: </p>
<p><img src="http://canoo.com/blog/wp-content/uploads/2010/07/3ProjectView.png" alt="3ProjectView" title="3ProjectView" width="380" height="500" class="aligncenter size-full wp-image-1427" /></p>
<p><strong>Add the Lombok Jar</strong><br />
We need to add the lombok.jar to the Contacts project, add it to the build classpath, and click Refresh to make sure Eclipse is aware that something changed. </p>
<p>Copy the lombok.jar to ./Contacts/lib/development directory in your project. Then edit the project properties (right click the Contacts project and select Properties), select the Java Build Path entry, and add lombok.jar as a Jar. Should look like this: </p>
<p><img src="http://canoo.com/blog/wp-content/uploads/2010/07/4AddLibrary.png" alt="4AddLibrary" title="4AddLibrary" width="600" height="456" class="aligncenter size-full wp-image-1429" /></p>
<p><strong>Create Domain Object</strong><br />
Let&#8217;s add a domain object with JPA persistence to our project. A Contacts application must show a Contact, right? This looks about right:<br />
<pre><code>package org.sample.contacts.domain;

import javax.persistence.*;
import lombok.*;

@Entity
public @Data class Contact {
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;@Id
&nbsp;&nbsp;&nbsp;&nbsp;@GeneratedValue(strategy = GenerationType.SEQUENCE)
&nbsp;&nbsp;&nbsp;&nbsp;@Getter(AccessLevel.NONE)
&nbsp;&nbsp;&nbsp;&nbsp;@Setter(AccessLevel.NONE)
&nbsp;&nbsp;&nbsp;&nbsp;private Long id;
&nbsp;&nbsp;&nbsp;&nbsp;private String name;
&nbsp;&nbsp;&nbsp;&nbsp;private String email;
&nbsp;&nbsp;&nbsp;&nbsp;private String primaryPhone;
}
</code></pre><br />
Let me explain a few details&#8230; The class is marked @Entity so that JPA persistence works. The class will map to a Contact table in the database. The class is marked @Data so that lombok will weave in getters, setters, toString, equals, and hashcode methods. The @Id annotation on the &#8220;id&#8221; field marks that field as the primary key to JPA, and the @GeneratedValue means the field auto increments. I use the GenerationType.SEQUENCE strategy because I plan on deploying to Google App Engine, otherwise this parameter here is unneeded. Lastly, getters and setters are supressed on the id field by adding @Getter(AccessLevel.NONE) and @Setter(AccessLevel.NONE). If you don&#8217;t do this then the view-layer automation of Ria Suite is going to, by default, provide you with edit fields for the id, which you should not do. </p>
<p><strong>Generate the View Layer</strong><br />
To generate the view layer, click Run -> External Tools -> &#8220;Contacts generate-beans-view&#8221;. This tool was installed for you by the Project Generator. Running it generates a simple Create-Read-Update-Delete (CRUD) interface with a table, buttons, and entry editor. You&#8217;ll see a couple new classes and property files in your application after you run the tool. </p>
<p><strong>Run application</strong><br />
Last thing to do is run the app. Click Run -> Run History -> Contacts (again installed by the project generator), sit back, and behold an application. </p>
<p><img src="http://canoo.com/blog/wp-content/uploads/2010/07/5DeployedApp.png" alt="5DeployedApp" title="5DeployedApp" width="610" height="411" class="aligncenter size-full wp-image-1430" /></p>
<p>That&#8217;s it!</p>
<p>Next step is to deploy to Google App Engine using that Contacts-copy-to-GoogleApp tool that the generator installed, but that is a blog post (and task) for another day. </p>
<p>Enjoy!</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://canoo.com/blog/2010/07/26/java-without-the-boilerplate-project-lombok/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/07/26/java-without-the-boilerplate-project-lombok/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Ubuntu Kung-Fu &#8211; 10 Best Tricks (and some even work on Macs)</title>
		<link>http://canoo.com/blog/2010/07/20/ubuntu-kung-fu-10-best-tricks-and-some-even-work-on-macs/</link>
		<comments>http://canoo.com/blog/2010/07/20/ubuntu-kung-fu-10-best-tricks-and-some-even-work-on-macs/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 11:37:24 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1390</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/20/ubuntu-kung-fu-10-best-tricks-and-some-even-work-on-macs/";</script>By my count, Ubuntu Kung-Fu from Pragmatic Bookshelf is the perfect summer reading book. It&#8217;s light, the content is not going to strain your mind the way some computer science tomes will; it&#8217;s easy to read, as always with Prag books the writing is conversational and the fonts large; and it&#8217;s fun, where else can [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/20/ubuntu-kung-fu-10-best-tricks-and-some-even-work-on-macs/";</script><p>By my count, Ubuntu Kung-Fu from Pragmatic Bookshelf is the perfect summer reading book. It&#8217;s light, the content is not going to strain your mind the way some computer science tomes will; it&#8217;s easy to read, as always with Prag books the writing is conversational and the fonts large; and it&#8217;s fun, where else can you read about easter eggs like talking cows and floating desktop fish.</p>
<p>Admittedly, some of the 315 tips are useless. I&#8217;m not sure when I&#8217;ll ever use the &#8220;cowsay&#8221; command to invoke a talking ascii cow, but for some reason I&#8217;m glad I know about it. I predict the error output in my Bash scripts is about to get a lot more bovine. Most of the tips are good, though. Of the 315 total tips (less than a page long each), there are maybe 25 dual boot and Windows related tips and maybe 25 more system recovery and troubleshooting tips. It isn&#8217;t a comprehensive reference to administration or dual booting, but these tips are still good to keep around in case of emergencies. Someone switching from Windows and still dual booting will find this book extremely helpful. There are also quite a few Gnome desktop tips for how to tune the desktop manager; for instance, how to use drapes to change the wallpaper every morning. But the majority of the book details cool and useful programs and packages to install&#8230; stuff I didn&#8217;t realize I needed until I found out about it. Normally I prefer printed books, but the best way to read Ubuntu Kung-Fu is by viewing the PDF directly on the computer and having a command prompt open to try the tips as you go.</p>
<p>If your vision of a great vacation is laying down with a laptop on your belly, banging away on new bash commands and scripts, then this is the book for you.</p>
<p>Now here are my favorite 10 tips.</p>
<p><strong>1. Command History Search with Ctrl+R</strong> &#8211; In a terminal, the up and down arrow shuffles through recent commands on almost any operating system. I had been using grep to search my history (history | grep something) until I found out about Ctrl+R. When you type Ctrl+R, the terminal goes into a matching mode where it tries to guess the entry from your history based on what you type. So type the first few letters of a recent command and the entire thing comes up. This is great, and I use it regularly to expand out &#8220;git pu&#8221; into a full &#8220;git pull origin master&#8221;. But don&#8217;t get the wrong idea! I still think git is awful.</p>
<p><strong>2. Running jobs with &amp; and nohup</strong> &#8211; I discovered &amp; long ago. If you run a program from the command line then the terminal is frozen until the program completes. But if you append &amp; (for instance, &#8220;gedit &amp;&#8221;) then it launches as a job and you can use the terminal again while your program runs simultaneously. The problem is if you close the terminal then your other program closes as well. Instead use nohup (&#8221;nohup gedit&#8221;) so that your program does not hang up when the terminal closes.</p>
<p><strong>3. Use Trash for Command Line File Deletes</strong> &#8211; There are a bunch of safe alternatives to deleting files using &#8220;rm -rf&#8221;, and this type lists yet another one. However, I prefer to use the &#8220;trash&#8221; package. Just run:<br />
<code>sudo apt-get install trash-cli</code></p>
<p><strong>4. gconf-edit</strong> &#8211; Desktop programs usually have a preferences panel, but not all preferences or settings are available there. The &#8220;gconf-edit&#8221; program in Gnome looks a little like a Registry Editor and is where all Free Desktop programs must store their configuration settings. Even if it is not in the preferences window you can still access it through gconf-edit. Take a look at what is available for Nautilus and gedit. It should be quite easy to expand your gedit recent files list to be 10 entries long, for example.</p>
<p><strong>5. Command Line Image Manipulation </strong>- There are a whole bunch of command line and batch image tricks you can perform with &#8220;imagemagick&#8221;. Shrink and enlarge in batch using &#8220;convert -resize 50% filename.bmp&#8221;, convert formats using &#8220;convert -quality 80 filename.bmp filename.jpg&#8221;, and sharpen images using &#8220;convert -sharpen 0&#215;1 filename.bmp&#8221;. Of course, for ascii aficionados like me, there is no beating asciiview. Install these:<br />
<pre><code>sudo apt-get install imagemagick
sudo apt-get install asciiview</code></pre></p>
<p><strong>6. Fonts Galore</strong> &#8211; I agree, Ubuntu fonts just look better, but the author is a little obsessive including 5 different font tips. You can &#8220;Make Fonts look superb&#8221; by turning on autohinting using a somewhat lengthy process. Or you can just install a whole slew of fonts such as the 465 fonts in ttf-aenigma, the Microsoft imitation fonts in ttf-liberation, or the Comic Sans style fonts in the ttf-fifthhorseman-dkg-handwriting, ttf-sjfonts, and ttf-breip packages. There&#8217;s even directions on stealing the Mac or Windows fonts by mounting the alternative OS, copying all the .ttf files locally, and then installing them into Ubuntu. This is probably the only tip that is not 100% legal. Install these:<br />
<pre><code>sudo apt-get install ttf-aenigma
sudo apt-get install ttf-liberation
sudo apt-get install ttf-fifthhorseman-dkg-handwriting
sudo apt-get install ttf-sjfonts
sudo apt-get install ttf-breip</code></pre></p>
<p><strong>7. Command Line Web Browser</strong> &#8211; I don&#8217;t know why but I get a real kick out of the &#8220;links&#8221; command line web browser. I enjoy the absurdities in life and browsing a text online web from the console seems like one of them. Install it with:<br />
<code>sudo apt-get install links</code></p>
<p><strong>8. Install all the multimedia codecs you&#8217;ll ever need</strong> &#8211; My family&#8217;s favorite baby sitter is the DVD player. When a parent needs a break, there is no joy like popping in a princess or dinosaur movie and seeing a child fall quickly into an animation induced stupor. Peace and quiet at last! Except when the DVD doesn&#8217;t play because of missing codecs. Curse you copyright laws! Best to be prepared and just install all of these through Synaptic now:<br />
GStreamer extra plugins<br />
GStreamer ffmpeg video plugin<br />
Ubuntu restricted extras<br />
GStreamer plugins for mms, wavpack, quicktime, musepack<br />
GStreamer plugins for aac, xvid, mpeg2, faad<br />
GStreamer fluendo MPEG2 demuxing plugi<br />
Finally, be sure to run the DVD playback enabler script: sudo /usr/share/doc/libdvdread3/install-css.sh</p>
<p><strong>9. See a Quote of the Day Whenever You Log In</strong> &#8211; I love quotes, so seeing a new one at the top of all my Terminal windows is a real bonus. Just install signify, create a ~/.signify file, and then edit your ~/.bashrc so that the last line reads &#8220;signify&#8221;. The format for the .signify file is % { quote % | quote % | quote % }. Yes, you read correctly, that is a &#8220;% |&#8221; delimited list with a &#8220;% {&#8221; start identifier and a &#8220;% }&#8221; end identifier, which makes the .signify file qualify as the most ridiculous text file data format I have ever seen. Oh well, just install:<br />
<code>sudo apt-get signify</code></p>
<p><strong>10. Play Old MS-DOS Games</strong>. Hell yes, <a href="http://www.abandonia.com/en/games/929/Bards+Tale+-+Tales+of+the+Unknown,+The.html">Bard&#8217;s Tale</a> is about to be run! First install &#8220;dosbox&#8221; and create an empty directory on your disk called &#8220;dosbox_c&#8221;. Then, using the DOSBox user interface, mount your empty directory by typing &#8220;mount C dosbox_c&#8221; and then switch to it by typing &#8220;C:&#8221;. You are now at the DOS prompt. Browse on over to your favorite abandon ware site and start downloading the classics. I suggest raiding <a href="http://www.abandonia.com">http://www.abandonia.com</a>. Install with:<br />
<code>sudo apt-get install dosbox</code></p>
<p>So that is my best 10. All I have left to say is:<br />
<pre><code> ____________________________
&lt; I want a Bash Kung-Fu book &gt;
 ----------------------------
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;&nbsp; ^__^
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \&nbsp;&nbsp;(oo)\_______
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(__)\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )\/\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;||----w |
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;&nbsp; ||
</code></pre></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://canoo.com/blog/2010/07/20/ubuntu-kung-fu-10-best-tricks-and-some-even-work-on-macs/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/07/20/ubuntu-kung-fu-10-best-tricks-and-some-even-work-on-macs/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Griffon Refcard Released, Lead Interviewed</title>
		<link>http://canoo.com/blog/2010/07/19/griffon-refcard-released-lead-interviewed/</link>
		<comments>http://canoo.com/blog/2010/07/19/griffon-refcard-released-lead-interviewed/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 08:16:03 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[griffon]]></category>
		<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1387</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/19/griffon-refcard-released-lead-interviewed/";</script>Big Griffon news today.
First, the Griffon Refcard is available from DZone. This is a concise 6-page reference to getting started and working with Griffon. If the only thing you know about Griffon is that it is a Grails and Groovy based framework for building desktop applications, then this RefCard will fill you in with tons [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/19/griffon-refcard-released-lead-interviewed/";</script><p>Big Griffon news today.</p>
<p>First, the Griffon Refcard is available from DZone. This is a concise 6-page reference to getting started and working with Griffon. If the only thing you know about Griffon is that it is a Grails and Groovy based framework for building desktop applications, then this RefCard will fill you in with tons more details. And if you&#8217;re an old Griffon hack, then you&#8217;ll probably still pick up some new tips and tricks.</p>
<p>Plus, DZone published an interview with Canooie Andres Almiray, the Griffon project lead. You can <a href="http://www.dzone.com/links/r/andres_almiray_on_griffon_the_road_behind_and_the.html">read the interview here</a>, or click the RefCard below to download the card.</p>
<p>Anyone interested in Griffon in the Swiss area should come out to <a href="http://hackergarten.net/">Hackergarten</a> on the 30th of July. Several experienced Griffon developers will be present including Andres. And there is free pizza!</p>
<p><a href="http://refcardz.dzone.com/refcardz/getting-started-griffon"><img class="alignleft size-full wp-image-1388" title="RefCard" src="http://canoo.com/blog/wp-content/uploads/2010/07/RefCard.png" alt="RefCard" width="400" height="517" /></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://canoo.com/blog/2010/07/19/griffon-refcard-released-lead-interviewed/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/07/19/griffon-refcard-released-lead-interviewed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Generation on the JVM: Video and Slides</title>
		<link>http://canoo.com/blog/2010/07/14/code-generation-on-the-jvm-video-and-slides/</link>
		<comments>http://canoo.com/blog/2010/07/14/code-generation-on-the-jvm-video-and-slides/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 12:59:04 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1380</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/14/code-generation-on-the-jvm-video-and-slides/";</script>Two weeks ago I spoke at the Chech Java User Group (CZJUG) on the topic of &#8220;Code Generation on the JVM&#8221;. Some of the technologies covered are Lombok, Groovy, GContracts, Spock, AST Transformations, Spring Roo, and other fun stuff.
The slides are available at: http://github.com/HamletDRC/presentations/blob/master/asttransformations/asttransforms_czjug.pdf
As a fun aside: my Ubuntu laptop went crazy the night before and [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/14/code-generation-on-the-jvm-video-and-slides/";</script><p>Two weeks ago I spoke at the Chech Java User Group (CZJUG) on the topic of &#8220;Code Generation on the JVM&#8221;. Some of the technologies covered are Lombok, Groovy, GContracts, Spock, AST Transformations, Spring Roo, and other fun stuff.</p>
<p>The slides are available at: <a href="http://github.com/HamletDRC/presentations/blob/master/asttransformations/asttransforms_czjug.pdf">http://github.com/HamletDRC/presentations/blob/master/asttransformations/asttransforms_czjug.pdf</a></p>
<p>As a fun aside: my Ubuntu laptop went crazy the night before and I spent all day before the JUG reloading Linux on my vacation. In the end, I had to switch to my wife&#8217;s Mac to do the presentation and live coding. I got the Macintosh fully configured and, during the 1st presenter, realized that I had no VGA output on the Macintosh. Oh geez. The final solution was to share my desktop, have an audience member VNC to my wife&#8217;s machine, and project the desktop from the audience. It worked and I&#8217;m glad I didn&#8217;t have to give the whole talk in chalk on the blackboard (although that would have been a fun challenge).</p>
<p>Enjoy the video!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/hA1wwBbFMcU&amp;hl=en_US&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/hA1wwBbFMcU&amp;hl=en_US&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></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://canoo.com/blog/2010/07/14/code-generation-on-the-jvm-video-and-slides/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/07/14/code-generation-on-the-jvm-video-and-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firmenlauf &#8216;10</title>
		<link>http://canoo.com/blog/2010/07/12/firmenlauf-10/</link>
		<comments>http://canoo.com/blog/2010/07/12/firmenlauf-10/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 13:35:39 +0000</pubDate>
		<dc:creator>christianr</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1365</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/12/firmenlauf-10/";</script>When Firmenlauf &#8216;10 was announced, Canoo decided to build a team and to participate again this year. We had great fun last time (see Firmenlauf &#8216;09 part I and II) and the race deadline gave us a goal for our rigorous 30&#176; lunchtime jogging sessions. Also I personally like the team spirit generated by such [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/12/firmenlauf-10/";</script><p>When <a title="Firmenlauf" href="http://www.firmenlauf.ch/">Firmenlauf &#8216;10</a> was announced, Canoo decided to build a team and to participate again this year. We had great fun last time (see Firmenlauf &#8216;09 part <a title="Firmenlauf '09 (part I)" href="http://canoo.com/blog/2009/07/16/firmenlauf-09-part-iii/">I</a> and <a title="Firmenlauf '09 (part II)" href="http://canoo.com/blog/2009/07/16/firmenlauf-09-part-iiii/">II</a>) and the race deadline gave us a goal for our rigorous 30&deg; lunchtime jogging sessions. Also I personally like the team spirit generated by such events.</p>
<div id="attachment_1370" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-1370" title="team" src="http://canoo.com/blog/wp-content/uploads/2010/07/team.jpg" alt="Left to right: Andrei, Christian, Roland, Johannes, Hamlet, G&uuml;nter, Markus and Alexandra" width="400" height="268" /><p class="wp-caption-text">Left to right: Andrei, Christian, Roland, Johannes, Hamlet, G&uuml;nter, Markus and Alexandra</p></div>
<p>Even though six kilometers is a relatively small distance, a certain fitness is still needed to increase the pleasure factor. Otherwise you are only suffering and this is definitely not what you want to achieve.</p>
<p>It was interesting to observe how the team organized itself for the training sessions. The participants regularly asked each others to go for group runs. The single shower we have here at the office rapidly became a bottleneck, adding some roughness to the whole story.</p>
<p>We regrettably had to experience two defects. Hamlet kindly accepted the challenge in the last minute. So at the end we were 8 at the starting line instead of 9 initially announced. At 7pm on Friday the 9th of July the starting gun fired. After a cumulated time of <em>2:10:34,5</em> the first group of Canooies composed of<strong> Alexandra</strong>, <strong>Markus</strong>, <strong>G&uuml;nter</strong> and <strong>Christian</strong> crossed the line hand in hand, just after the <a title="Herzog &amp; de Meuron" href="http://de.wikipedia.org/wiki/Herzog_%26_de_Meuron">Herzog &amp; de Meuron</a> architects but before another Software engineers company I am not mentioning by name&#8230; For a complete results overview, click <a title="Firmenlauf results" href="http://tinyurl.com/3a7c2q6">here</a>.</p>
<div id="attachment_1367" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-1367" title="finish" src="http://canoo.com/blog/wp-content/uploads/2010/07/finish.jpg" alt="Left to right: Markus, Christian, G&uuml;nther and Alexandra" width="400" height="268" /><p class="wp-caption-text">Left to right: Markus, Christian, G&uuml;nther and Alexandra</p></div>
<p>The rest of the team composed of <strong>Roland</strong>, <strong>Andrei</strong>, <strong>Johannes</strong> and <strong>Hamlet</strong> successfully crossed the line as well. Everyone did an incredible job. I can tell you: this year was really hard. It was so hot and humid. A couple of people collapsed (no one from Canoo luckily) and we heard the ambulance at least once.</p>
<p>More photos could be found on <a title="Firmenlauf '10 photos" href="http://www.flickr.com/photos/canoo/sets/72157624476404828/">Flickr</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://canoo.com/blog/2010/07/12/firmenlauf-10/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/07/12/firmenlauf-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slimmed Down Software &#8211; A Lean, Groovy Approach Part 2 &#8211; Build Quality In</title>
		<link>http://canoo.com/blog/2010/07/05/slimmed-down-software-a-lean-groovy-approach-part-2-build-quality-in/</link>
		<comments>http://canoo.com/blog/2010/07/05/slimmed-down-software-a-lean-groovy-approach-part-2-build-quality-in/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 11:55:03 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1356</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/05/slimmed-down-software-a-lean-groovy-approach-part-2-build-quality-in/";</script>This article originally appeared in the May 2010 edition of GroovyMag, the Groovy and Grails magazine. Parts 3 and 4 are currently available for download from the magazine&#8217;s site, and more will come each month. Enjoy!
The Groovy Programming Language advertises itself as an &#8220;agile and dynamic Language for the JVM&#8221;, but what does this mean [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/07/05/slimmed-down-software-a-lean-groovy-approach-part-2-build-quality-in/";</script><p>This article originally appeared in the May 2010 edition of <a href="http://www.groovymag.com/">GroovyMag</a>, the Groovy and Grails magazine. Parts 3 and 4 are currently available for download from the magazine&#8217;s site, and more will come each month. Enjoy!</p>
<p><em>The Groovy Programming Language advertises itself as an &#8220;agile and dynamic Language for the JVM&#8221;, but what does this mean exactly? This series of articles explains Lean Software Development, and shows how your choice of programming language can make your entire process remain nimble and adaptive. Each month will cover one of the seven Lean Software Development principles and explain how Groovy and the associated ecosystem help eliminate waste, defer commitment, and build quality into your product.</em></p>
<h2>About this Series</h2>
<p>Groovy is an agile programming language. In order to explain what this means, these articles are structured around the seven principles of Lean Software Development. Last month included a short introduction to Lean, and explained how an expressive language can eliminate waste in unit testing. This month we&#8217;ll see how the easyb Behavior Driven Development framework and Groovy Builders can build quality into your life-cycle. In later months we&#8217;ll explore how different testing tools like the Spock Framework help create knowledge, how a dynamic language lets you minimize coupling and defer commitment, and how metaprogamming allows you to deliver fast. In future installments you&#8217;ll see how Groovy&#8217;s Grapes module system, alongside modules like Groovy Web Services, streamline interactions between development and other groups like operations and QA&#8230; an important aspect of respecting people. Finally, we&#8217;ll look at optimizing the whole by applying Groovy to domains that cross department boundaries: how Gradle improves the build process and easyb serves as a collaboration mechanism between different organization roles. The series will end with a discussion on the best practices of mixing Java and Groovy.</p>
<p>Some of the code examples are basic while others are advanced. The articles explore why the features of Groovy are important rather than the mechanics of any one Groovy feature. Hopefully you&#8217;ll leave with some new ideas about how to use Groovy, how to convince your team that Groovy is worthwhile, or most importantly how to increase your productivity.</p>
<h2>Lean Revisited</h2>
<p>Part 1 of this series contained a more indepth explanation of Lean, and I won&#8217;t repeat it here. But as a quick refresher here are the 7 lean principles along with a summary for those principles covered previously:</p>
<ol>
<li>Eliminate Waste &#8211; Reduce work in progress and half done work</li>
<li>Build Quality In</li>
<li>Create Knowledge</li>
<li>Defer commitment</li>
<li>Deliver Fast</li>
<li>Respect People</li>
<li>Optimize the Whole</li>
</ol>
<h2>Principle 2 &#8211; Build Quality In</h2>
<p>If you want to build a high quality product, you could inspect your product after it is built to ensure that it conforms to standards. But it would be better to change how the product is made so as not to create defects in the first place. Picking the best of breed testing practices and using them before the system is completely built is of utmost importance to quality software. At one point in time JUnit and Java were the state of the art in software testing, and eventually Test Driven Development gained mind-share in the industry, pushing testing into the same phase as development. Today, some of the best tools and practices are coming from the Behavior Driven Development community. Groovy is lucky to have an excellent choice for BDD in the Jolt Award winning easyb framework.</p>
<p>Instead of writing tests, easyb focuses on writing &#8220;stories&#8221;. A story is a piece of functionality that is visible and meaningful to the user. The intent is different than unit testing, although it does occur frequently at the same level. Stories are expressed in a given/when/then format. For instance, the story for a web service might be: given a user web service, when a user is looked up in the web service, then the user&#8217;s record should be found. The example in Listing 1 might make this clearer.<br />
<pre><code>
using &quot;xmlunit&quot;
scenario &quot;web service should return XML based users&quot;, {
&nbsp;&nbsp;given &quot;a user web service &quot;, {
&nbsp;&nbsp;&nbsp;&nbsp;service = new UserWebService()
&nbsp;&nbsp;}
&nbsp;&nbsp;when &quot;a user is looked up in the web service&quot;, {
&nbsp;&nbsp;&nbsp;&nbsp;webServiceResult = service.get(123456)
&nbsp;&nbsp;}
&nbsp;&nbsp;then &quot;the user&#039;s record should be found &quot;, {
&nbsp;&nbsp;&nbsp;&nbsp;webServiceResult.shouldBeIdenticalTo &quot;&quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;user id= &quot;123456&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;firstname&gt;John&lt;/firstname&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;lastname&gt;Doe&lt;/lastname&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/user&gt;&quot;&quot;&quot;
&nbsp;&nbsp;}
}
</code></pre><br />
Listing 1: A Simple easyb story using XMLUnit</p>
<p>To understand the low ceremony nature of easyb, understand that Listing 1 is the entire file. There is no setup, test class subclass, or magical annotation incantation required. The essentials of your test are what it is testing, not the mechanics of a test framework. Easyb works with you in achieving a test with only the essentials being communicated.</p>
<p>You may have also noticed a lack of variable declarations. Where are these variables declared and what are their scope? Again, declarations are rarely an essential part of a unit test, so easyb handles this for you. Variables are scoped within the scenario they are used and instantiated when referenced. Easy, and with a lot less fluff than Java. Hopefully you are wondering how all of this works (if not then skip to the next paragraph)! Remember, parenthesis are optional in Groovy method calls, and {} is used to create a closure. In this easyb story, scenario, given, when, and then are all just normal methods that take a String and a Closure as parameters. While it may look terse enough to be qualified as a domain specific language, this is for the most part just plain old Groovy. The implicit variable declarations are a little harder to explain, but suffice it to say that a little metaprogramming is happening under the covers.</p>
<p>At first glance, easyb might appear to be a lot different from the traditional JUnit approach. Some of it is quite different, which gives easyb its power. But for the most part, it is plain old Groovy and is a good JVM citizen. There is plenty of build system support for easyb (an Ant task and plugins to other systems), IDE support for at least IntelliJ IDEA and Eclipse, and other JVM tools like code coverage applications should still work with it. If you are serious about building quality into your product, then take a hard look at using BDD and easyb to drive down defects before they appear in the QA phase.</p>
<h2>Behavior Driven Development</h2>
<p>BDD bills itself as &#8220;Unit Testing Done Right &#8220;. So what was wrong with unit testing? Unit testing is a good start, but often addresses how objects behave at the microscopic level rather than focusing on what matters to stakeholders. BDD changes this by focusing testing back on the project and the value of the system. Developers are encouraged to focus on why tests should be created rather than adhering slavishly to a one test per object approach. It might sound more like functional testing than unit testing.</p>
<p>The way to focus tests back on business value is by developing and using a ubiquitous language. When your customer says, &#8220;The user should be able to change their password,&#8221; then that should be your test name. Calling your test fixture UserManagerTest, your test method testChangePassword, and your assertion assertEquals creates an artificial language barrier between you as a developer and the business. It is better to call the test User Features, the test method user must change password, and the assertion should be. A common and ubiquitous language breaks down barriers between you and the business and keeps you focused on why you&#8217;re writing the system in the first place.</p>
<h2>Groovy Builders</h2>
<p>Another Groovy language feature useful in achieving low ceremony testing is multi-line Strings. Strings may be triple quoted, like in the Listing 1, and then all special characters and whitespace may be embedded in the String without escaping or concatenation. This makes working with XML a breeze: no need to litter your test with long blocks of string concatenation, nor do you need to hide the XML snippets away in an external file where they aren&#8217;t visible when the test fails.</p>
<p>Building data, and lots of it, is a common occurrence in unit tests. Multi-line Strings are nice, but are definitely not the only way to build String based data. One of the most helpful classes in the Groovy library is the MarkupBuilder, as seen in Listing 2.<code> </code><br />
<pre><code>
def writer = new StringWriter()
new groovy.xml.MarkupBuilder(writer).
&nbsp;&nbsp; user(id: 123456) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;firstname(&#039;John&#039;)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastname(&#039;Doe&#039;)
&nbsp;&nbsp; }
</code></pre><br />
Listing 2: Creating an XML tree with MarkupBuilder<code> </code><br />
<pre><code>
&lt;user id= &quot;123456 &quot;&gt;
&nbsp;&nbsp; &lt;firstname&gt;John&lt;/firstname&gt;
&nbsp;&nbsp; &lt;lastname&gt;Doe&lt;/lastname&gt;
&lt;/user&gt;
</code></pre></p>
<p>Listing 3: XML output from Listing 2</p>
<p>The MarkupBuilder is a dynamic object that treats method calls as requests to build markup (whether it be XML or HTML). Calling a method, any method, is going to create an XML Node with the tag named the same as the method. Passing a key/value pair is going to add an attribute to that node, and passing a value is going to write that value as the node value. In Listing 2, all of this is written into the StringWriter object. The real power of MarkupBuilder comes when mixing dynamic method calls with real, statically declared method calls like List.each().</p>
<p>In Listing 4, the users() and user() method calls are calls on the MarkupBuilder, and will have start and end tags generated correctly, while the names.each() method is an invocation on the variable called names that is in scope. Building ad-hoc test input and test control data is greatly simplified by understanding and working with builders.<code> </code></p>
<p><pre><code>
def names = [&#039;Alice&#039;, &#039;Bob&#039;, &#039;Carol&#039;, &#039;Ted&#039;]
def writer = new StringWriter()
new groovy.xml.MarkupBuilder(writer).
&nbsp;&nbsp; users {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;names.each { name -&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user(name)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp; }
</code></pre></p>
<p>Listing 4: Mixing MarkupBuilder and Lists<code> </code></p>
<p><code></code></p>
<p>Listing 5: Output from Listing 4</p>
<p>Don&#8217;t just rely on this builder though. Write your own builder for working with any sort of structured data. Any tree like data structure is a good candidate, as well as APIs that require heavy usage of setParent() or setChild() method calls. All of this can be hidden behind a builder. There is even an abstract class called BuilderSupport that takes care of all the heavy lifting.</p>
<p>Before writing your own builder with BuilderSupport, it pays to understand how the object works to capture arbitrary dynamic method calls. Listing 6 shows all the possible ways to interact with a Groovy builder. There are four options: you may invoke dynamic method calls with no parameters, a<br />
single value parameter, a Map parameter, or a Map and a value parameter.<code> </code></p>
<p><pre><code>
new groovy.xml.MarkupBuilder().root() {
&nbsp;&nbsp; valueNode(&#039;a value&#039;)
&nbsp;&nbsp; attributeNode(a: &#039;1&#039;, b: &#039;2&#039;)
&nbsp;&nbsp; mixedNode(a: &#039;1&#039;, b: &#039;2&#039;, &#039;a value&#039;) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nestedNode()
&nbsp;&nbsp; }
}
</code></pre></p>
<p>Listing 6: Possible Uses of Markup Builder</p>
<p>All of these methods take an optional closure parameter that lets you nest nodes arbitrarily deep. To generalize the builder pattern, there are 4 possible ways to invoke a dynamic method. With this in mind, the abstract BuilderSupport class is a logic implementation for a base builder class. If you want to create a new builder, then you need to implement four abstract methods, one for each type of dynamic method invocation. The BuilderSupport abstract methods can be seen in Listing 7.<code> </code></p>
<p><pre><code>
class BuilderSupport {
&nbsp;&nbsp; ...
&nbsp;&nbsp; abstract Object createNode(Object name)
&nbsp;&nbsp; abstract Object createNode(Object name, Map attrs)
&nbsp;&nbsp; abstract Object createNode(Object name,
&nbsp;&nbsp; Map attrs, Object value) abstract Object createNode(Object name, Object value)
&nbsp;&nbsp; ...
}
</code></pre></p>
<p>Listing 7: BuilderSupport Abstract Class</p>
<p>What BuilderSupport does for you is handle all of the dynamic dispatch and nesting with closure parameters. Writing a new builder, and enjoying the accompanying Groovy &#8220;magic&#8221; really is as easy as implementing these four methods. You&#8217;ll get the most value from a builder by taking a few minutes early in the project to write one as a wrapper around your tree-like API.</p>
<h2>Next Steps</h2>
<p>One particularly rigorous Lean practice is a zero tolerance or stop the line approach for defects. The idea is that no defects should exist in the system, and when a defect is present then all attention and effort must be focused on resolving the issue before normal work resumes. In the face of error conditions and ambiguities, the assembly line stops until the issue is resolved. The effect is that your daily process becomes fine tuned around producing a high quality product early in production as opposed to optimizing a defect cycle days or weeks later. Stop the defects before they happen. My team recently applied this approach for a single two-week iteration with interesting results. Based on our retrospectives, we decided to not continue with a strict enforcement of this policy, but we all agreed we learned a lot and the lessons learned were carried forward to our current process. A worthwhile experiment; I suggest you try it.</p>
<h2>Next Month: Create Knowledge</h2>
<p>Software Engineering is a knowledge creating process. It is important to find the correct balance between tacit, organizational knowledge and explicit, recorded knowledge. Next month&#8217;s article explores what this means, looks at ways to use Groovy to capture and codify knowledge, and discusses the differences between terse and expressive. Along the way we will see some cool new features of Groovy and the amazing Spock testing framework.</p>
<h2>Learn More</h2>
<p>Everyone learns differently, and for me the best way to learn about a new framework is to experiment with it. Easyb can be downloaded from http://www.easyb.org/ and BuilderSupport is a standard Groovy class. Otherwise, the web contains many tutorials on both subjects, and &#8220;Programming Groovy&#8221; by Venkat Subramaniam contains an in-depth BuilderSupport chapter. The MEAP pre-release for &#8220;Groovy in Action 2nd Edition &#8221; does not yet (at the time of this writing) contain Builder information, but it should be coming out shortly.</p>
<p>For books on agility, I still contend these three cannot be beat:</p>
<ul>
<li>Implementing Lean Software Development &#8211; Poppendieck</li>
<li>The Pragmatic Programmer &#8211; Hunt and Thomas</li>
<li>Extreme Programming Explained, 2nd Edition &#8211; Beck and Anders</li>
</ul>
<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://canoo.com/blog/2010/07/05/slimmed-down-software-a-lean-groovy-approach-part-2-build-quality-in/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/07/05/slimmed-down-software-a-lean-groovy-approach-part-2-build-quality-in/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What Type of &#8220;Done&#8221; are You?</title>
		<link>http://canoo.com/blog/2010/06/23/what-type-of-done-are-you/</link>
		<comments>http://canoo.com/blog/2010/06/23/what-type-of-done-are-you/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 07:32:40 +0000</pubDate>
		<dc:creator>andreashz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1338</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/06/23/what-type-of-done-are-you/";</script>What Type of &#8220;Done&#8221; are You?
What Type of &#8220;Done&#8221; are You? This is certainly one of the central questions of Scrum. Does it involve testing, integration testing, user acceptance, documentation, or all of these?
It is up to you &#8211; as a company &#8211; to define what Done means.
A &#8220;done&#8221; task at the end of a [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/06/23/what-type-of-done-are-you/";</script><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">What Type of &#8220;Done&#8221; are You?</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">What Type of &#8220;Done&#8221; are You? This is certainly one of the central questions of Scrum. Does it involve testing, integration testing, user acceptance, documentation, or all of these?</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">It is up to you &#8211; as a company &#8211; to define what Done means.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">A &#8220;done&#8221; task at the end of a sprint means it is a fully working and shippable increment of the product, and it is an increment you want to built upon in your subsequent work. The size of the task &#8220;done&#8221; does not matter much, it can be small as long as it is &#8220;done&#8221;, according to the definition. So better do it well or it will show up again later in your backlog and retrospectives &#8230;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Questions like these &#8211; all focused on the core aspects of the Scrum methodology &#8211; were discussed at the ScrumMaster certificate workshop at the Entwicklertage Karlsruhe [http://www.andrena.de/Entwicklertag/2010/], 21.-22.6. One of the godfathers of Scrum, Ken Schwaber, was performing this workshop with around 30 people in the Schlosshotel Karlsruhe. Canoo was contributing well, providing 10% of the participants. The workshop was a lot of fun, full of exercises, jokes, anecdotes and insights.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Scrum is an empirical process and therefore requires some experience. Reading a book about it gives you an idea, but you have to practice and live it.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">What do you think, does a Scrum Master have to be at the daily scrum meeting? That was an interesting question to discuss. On one hand, the ScrumMaster is directly accountable for the Scrum process by definition. Therefore he had better attend the meeting and help remove impediments. On the other hand, the purpose of the meeting is not to report to the Scrum Master. It is for the team to get an understanding where they are and what is going well or not.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Is it correct if management attends a Spring review meeting and applauds you for your success? What should you do if the product owner reshuffles the whole product backlog against your better knowledge? Given 20 Mio. Dollars to expand your company, how would you scale your initial team of 7 to 70? How do you write an offer based on the Scrum approach to a fixed business request?</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Scrum is based on transparency and commitment, it establishes local predictability in highly complex and globally uncontrollable projects. It makes risks and defects highly visible. Its time to get rid of the &#8220;feature finish metronome&#8221; in our heads.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Some of the most important aspects we learned from the training were:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- deliver a shippable increment within each sprint, otherwise you have nothing to build upon</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- select no more work then you can finish properly</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- work on one thing at a time</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- product owner must learn to demand less. Take it as an opportunity to focus on value not quantity</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- when under pressure, drop low value items not quality</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- people are able to form and manage their teams on their own</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">At one point, Ken made an interesting historical note about the early days of Scrum: It&#8217;s not that the world was missing the truth with respect to development. But what made Scrum possible was a change in development environments towards integrateable and automatically testable systems, a feature that first arose back in the days of smalltalk projects. Lucky for us, we were born too late&#8230;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Ken Schwabers concluded with the words: &#8220;I think we have one of the best profession one can imagine; do your best to transform it back into  something enjoyable!&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Thanks Ken</div>
<p>What Type of &#8220;Done&#8221; are You? This is certainly one of the central questions of Scrum. Does it involve testing, integration testing, user acceptance, documentation, or all of these?</p>
<p>It is up to you &#8211; as a company &#8211; to define what Done means.</p>
<p>A &#8220;done&#8221; task at the end of a sprint means it is a fully working and shippable increment of the product, and it is an increment you want to built upon in your subsequent work. The size of the task &#8220;done&#8221; does not matter much, it can be small as long as it is &#8220;done&#8221;, according to the definition. So better do it well or it will show up again later in your backlog and retrospectives &#8230;</p>
<p>Questions like these &#8211; all focused on the core aspects of the Scrum methodology &#8211; were discussed at the ScrumMaster certificate workshop at the <a href="http://www.andrena.de/Entwicklertag/2010/">Entwicklertage Karlsruhe</a>, 21.-22.6. One of the godfathers of Scrum, Ken Schwaber, was performing this workshop with around 30 people in the Schlosshotel Karlsruhe. Canoo was contributing well, providing 10% of the participants. The workshop was a lot of fun, full of exercises, jokes, anecdotes and insights.</p>
<p>Scrum is an empirical process and therefore requires some experience. Reading a book about it gives you an idea, but you have to practice and live it.</p>
<p>What do you think, does a Scrum Master have to be at the daily scrum meeting? That was an interesting question to discuss. On one hand, the ScrumMaster is directly accountable for the Scrum process by definition. Therefore he had better attend the meeting and help remove impediments. On the other hand, the purpose of the meeting is not to report to the Scrum Master. It is for the team to get an understanding where they are and what is going well or not.</p>
<p>Is it correct if management attends a Spring review meeting and applauds you for your success? What should you do if the product owner reshuffles the whole product backlog against your better knowledge? Given 20 Mio. Dollars to expand your company, how would you scale your initial team of 7 to 70? How do you write an offer based on the Scrum approach to a fixed business request?</p>
<p>Scrum is based on transparency and commitment, it establishes local predictability in highly complex and globally uncontrollable projects. It makes risks and defects highly visible. Its time to get rid of the &#8220;feature finish metronome&#8221; in our heads.</p>
<p>Some of the most important aspects we learned from the training were:</p>
<ul>
<li>deliver a shippable increment within each sprint, otherwise you have nothing to build upon</li>
<li>select no more work then you can finish properly</li>
<li>work on one thing at a time</li>
<li>product owner must learn to demand less. Take it as an opportunity to focus on value not quantity</li>
<li>when under pressure, drop low value items not quality</li>
<li>people are able to form and manage their teams on their own</li>
</ul>
<p>At one point, Ken made an interesting historical note about the early days of Scrum: It&#8217;s not that the world was missing the truth with respect to development. But what made Scrum possible was a change in development environments towards integrateable and automatically testable systems, a feature that first arose back in the days of smalltalk projects. Lucky for us, we were born too late&#8230;</p>
<p>Ken Schwabers concluded with the words</p>
<blockquote><p>I think we have one of the best profession one can imagine; do your best to transform it back into something enjoyable!</p></blockquote>
<p>Thanks Ken</p>
<div id="attachment_1339" class="wp-caption alignleft" style="width: 490px"><img class="size-full wp-image-1339 " title="Foto" src="http://canoo.com/blog/wp-content/uploads/2010/06/Foto.jpg" alt="canoo meets ken" width="480" height="360" /><p class="wp-caption-text">Canoo meets Ken</p></div>
<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://canoo.com/blog/2010/06/23/what-type-of-done-are-you/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/06/23/what-type-of-done-are-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IT Certification Alternatives: Cost Benefit Analysis</title>
		<link>http://canoo.com/blog/2010/06/09/it-certification-alternatives-cost-benefit-analysis/</link>
		<comments>http://canoo.com/blog/2010/06/09/it-certification-alternatives-cost-benefit-analysis/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 06:27:47 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1319</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/06/09/it-certification-alternatives-cost-benefit-analysis/";</script>So you&#8217;re thinking about getting an IT certification? Congratulations, you have discovered the Pragmatic Programmer Tip #8 &#8211; &#8220;Invest Regularly in Your Knowledge Portfolio&#8221;. But before you sign up, pay your fee, and spend your time chasing a certification, consider two points from the fine print from the Pragmatic Programmer book: Manage Risk and Buy [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/06/09/it-certification-alternatives-cost-benefit-analysis/";</script><p>So you&#8217;re thinking about getting an IT certification? Congratulations, you have discovered the <a href="http://pragprog.com/titles/tpp/the-pragmatic-programmer">Pragmatic Programmer</a> Tip #8 &#8211; &#8220;Invest Regularly in Your Knowledge Portfolio&#8221;. But before you sign up, pay your fee, and spend your time chasing a certification, consider two points from the fine print from the Pragmatic Programmer book: Manage Risk and Buy low, sell high.</p>
<p>I do not have a Java certification, despite it being my primary language. There is risk for me to get this certification&#8230; I might spend all my time studying and then fail the test! I don&#8217;t think &#8220;studied for the certification exam&#8221; looks as good as simply &#8220;I am certified&#8221;, but that&#8217;s what I might end up with after several weeks of work. And there is also the risk that I am buying high and selling low, instead of the other way around. The Sun estimate for getting the Developer cert is 160 hours! This is a huge investment and I am not sure I&#8217;ll recoup the cost quickly enough. Perhaps there are better alternatives? Is there something that offers just as much benefit but with less effort? Or more benefit with the same effort? If there is, then the decision on whether to get a certification or not is an easy &#8220;no&#8221;: it&#8217;s ain&#8217;t worth your time kid.</p>
<p>The following is a table of all the things I&#8217;ve done in the last 12 years and the amount of time it took me to accomplish them. If the numbers are accurate, then it should be fairly simple to make a cost/benefit analysis of different knowledge portfolio endeavors.</p>
<table border="2" cellspacing="0">
<tbody>
<tr>
<td><strong>Task</strong></td>
<td><strong>Effort</strong></td>
<td><strong>Notes</strong></td>
</tr>
<tr>
<td>In-House Tech Presentation</td>
<td>8 Hours</td>
<td>Your resume can either say &#8220;Spring&#8221; or &#8220;Trained team on Spring&#8221;. The latter looks a better and gives you a more interesting story to tell in interviews. At only 8 hours of prep and delivery time, this has been useful for me. <strong>Recommended.</strong></td>
</tr>
<tr>
<td>User Group Presenter</td>
<td>24 hours</td>
<td>A user group presentation is stressful but not that hard once you&#8217;ve done an in-house presentation. It does take some effort though and I usually have to pay for travel. The problem is that this task doesn&#8217;t prove anything to interviewers that the in-house tech presentation doesn&#8217;t already do and in less effort. Unless you have ulterior motives (future conference speaker, egotism, community building) then I say <strong>Don&#8217;t Bother</strong></td>
</tr>
<tr>
<td>Conference Presenter</td>
<td>16-32 hours</td>
<td>Once you&#8217;ve given a user group session then the conference session is pretty much a cakewalk. A stressful, nauseating, sweaty cakewalk. And there is definitely some cache with being a conference presenter. When I&#8217;m asked, &#8220;Do you know OSGi?&#8221; I get to answer, &#8220;I presented on it at 2GX.&#8221; and if you can speak for 90 minutes on a topic at a conference then surely you can go 5 minutes in an interview. <strong>Recommended* </strong>(*if you already gave a user group talk)</td>
</tr>
<tr>
<td>Open Source Contributor</td>
<td>8 hours</td>
<td>Being a contributor to a project is pretty darn easy, but your friends will probably care a lot more about this than someone who is interviewing you. I don&#8217;t think I&#8217;ll land any new jobs because of the 10 line patches I&#8217;ve sent a half dozen projects, but I did make some good friends. And you know what, the guy who recommended me for a job at Canoo was someone I had sent a 10 line patch to. But as an alternative to certifications, <strong>Don&#8217;t Bother</strong>, the benefits are intangible at best.</td>
</tr>
<tr>
<td>Open Source Committer</td>
<td>120 hours</td>
<td>If you take 3 weeks off of work and work solidly on an open source project, I think you&#8217;ll be made a committer. The problem is that people reading your resume frequently have no idea what the difference is between a <a href="http://www.apache.org/foundation/how-it-works.html#roles">contributor</a> and a <a href="http://www.apache.org/foundation/how-it-works.html#roles">committer</a>. And being a committer is a long term commitment to fixing bugs and remaining active. This is a lot of work but also a lot of fun. Being a Groovy committer has been greatly beneficial for me, but it was paired with conference speaking and blogging. I say <strong>Recommended*</strong> (*but it is really more of a lifestyle choice).</td>
</tr>
<tr>
<td>Open Source Project Lead (for your own project)</td>
<td>40 hours</td>
<td>If you are the only developer on an open source project that no one has heard of then nobody is going to care. I wrote <a href="http://hamletdarcy.com/timetool/">TimeTool</a> to learn Swing. Mission accomplished. But is is a terrible alternative to certification. <strong>Don&#8217;t Bother.</strong></td>
</tr>
<tr>
<td>Administer a User Group</td>
<td>24 hours</td>
<td>Administering a user group tells interviewers you like distractions from coding <em>and</em> it won&#8217;t help you answer any of their interview questions. On the plus side, you will meet a whole bunch of people that will suggest your name for interviews. If you&#8217;re looking for a new full time job then this is a good tactic. If you&#8217;re looking to ace consulting gig interviews then <strong>Don&#8217;t Bother.</strong></td>
</tr>
<tr>
<td>Certified ScrumMaster</td>
<td>16 hours</td>
<td>There is no preparation for the course, it is not too expensive, it never expires, and there is no test. This is about the easiest certification you&#8217;ll ever get. And a lot of hiring managers value this. If you want to learn and enrich yourself then skip this &#8220;certification&#8221;. If you want a certification on your resume, then <strong>100% Recommended. </strong>You can get Scrum certified almost 5 times for the same investment as a SCJP, and with no risk of failing a test.</td>
</tr>
<tr>
<td>Webmaster for User Group</td>
<td>12 hours</td>
<td>I was the <a href="http://otug.org/">OTUG</a> webmaster for almost 3 years. It was a nice way to make friends, but no one interviewing you will care about the plain old HTML and CSS site you maintain. As an alternative to certification: <strong>Don&#8217;t Bother.</strong></td>
</tr>
<tr>
<td>Volunteer Conference Organizer</td>
<td>40 hours</td>
<td>As a volunteer conference organizer at Agile 2006 and 2009, I got to see the conference for free, I got to meet and engage the speakers, and I made some friends. Interviewers won&#8217;t be impressed specifically with the volunteer experience, but I have several good stories I can tell during interviews. And the 40 hours I spent was all time at the conference. <strong>Recommended. </strong></td>
</tr>
<tr>
<td>Build Personal Website</td>
<td>40 hours a year</td>
<td>Unless your personal website is Slashdot or BoingBoing, then <strong>Don&#8217;t Bother. </strong>I&#8217;ve spent an inordinate amount of time editing photos, php, javascript, and css for something that facebook replaces for free. No one cares about this, not even my friends and family. Harsh.</td>
</tr>
<tr>
<td>Learn a new language this year</td>
<td>40-100 hours</td>
<td>I have 5 years Java experience. Plus Groovy and F# and Scheme, all learned during that time. How can I truly have 5 years Java if I spent my time learning other languages? <em>Learning new languages is great for your mind and bad for your resume. </em>As an alternative to certification, <strong>Don&#8217;t Bother.</strong></td>
</tr>
<tr>
<td>Organize and run a Book study</td>
<td>16 hours</td>
<td>I organized or participated in about 6-8 book study groups in the last few years. It is a small investment, especially if you&#8217;re going to read the book anyway. And I can definitely say that reading and discussing Java Concurrency in Practice, Release It!, and Effective Java twice has made me a better programmer and interviewer. Plus, the interviewers will assume (rightly) that you can help their team run a book club, which you should do. Minimal investment, high value: <strong>Recommended.</strong></td>
</tr>
<tr>
<td>Write a technical blog</td>
<td>40-60 hours</td>
<td>A blog post should take about 4 hours to write, and if you make 10-15 posts then you&#8217;ve got yourself a nice little blog. When interviewers see your URL in the resume they&#8217;ll click it and skim the contents but not read any of the articles. If you want maximum value for minimal investment, then do <em>not </em>date the articles and don&#8217;t supply a way to see how many posts there are&#8230; that way the site will age gracefully in the future. Cynical? Maybe. Other programmers will care about this a lot more than managers will care. I say: <strong>Consider It.</strong></td>
</tr>
<tr>
<td>Master&#8217;s Degree</td>
<td>1344 hours and $$$$</td>
<td>This is a huge time investment, a big money investment, takes 3-4 years of calendar time, and won&#8217;t start accruing value until it is fully finished (no one cares that you are &#8220;taking&#8221; a masters degree only that you &#8220;finish&#8221; the degree). It is the ultimate un-agile training strategy and a good example of a bad value stream. Don&#8217;t expect monetary payback until almost 10 years after your first class! This is a bad alternative to certification because of the enormous cost: <strong>Don&#8217;t Bother</strong>.</td>
</tr>
</tbody>
</table>
<p>And here is my guess about the Java certifications a few of us Canooies are considering:</p>
<table border="2" cellspacing="0">
<tbody>
<tr>
<td>Java Certified Programmer</td>
<td>80 hours</td>
<td>You study a large book. You <em>possibly</em> become a better Java programmer. You may study too much and waste your time studying or you may study too little and fail the test. However, the SCJP certification gets you in the door with a lot of companies and some people do care about this. This won&#8217;t help you <em>perform</em> in interviews, but it definitely helps <em>get</em> the interview. I have to say, after careful comparison, this ranks as a strong <strong>Consider it. </strong>The biggest problem is that it is just not fun to do.</td>
</tr>
<tr>
<td>Java Certified Developer</td>
<td>160 hours</td>
<td>Sun/Oracle says this cert should take 4 weeks of effort, but that seems like a high estimate. And again, you may do too much or too little work. Plus, interviewers may not know the difference between SCJP and SCJD! I predict most filters are looking for SCxx and don&#8217;t care about which level you actually have. Considering the time investment and risk, I say <strong>Don&#8217;t Bother.</strong></td>
</tr>
</tbody>
</table>
<p>And the results?</p>
<p>Here are some equivalent scenarios on how to spend the next 80 hours of your life:</p>
<ul>
<li>Sun Certified Java Programmer (80 hours)</li>
</ul>
<p>or all of these combined:</p>
<ul>
<li>2 In house technology presentations (16 hours)</li>
<li>2 Open Source Contributions (16 hours)</li>
<li>Scrum Master Certification (16 hours)</li>
<li>2 Book Study Groups (32)</li>
<li>And you have fun doing it!</li>
</ul>
<p>In my opinion, the latter list sounds better than the previous list. Problem is, my opinion doesn&#8217;t count for much when it comes getting in the door as a contractor or consultant. If you are looking for a new full time job, then I recommend that 2nd list and skip the Java cert. For contractors/consultants, it pains me to say it but the Java Certification still seems like a decent value for the cost.</p>
<p>So what is your custom plan this year? The first list or the second?</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://canoo.com/blog/2010/06/09/it-certification-alternatives-cost-benefit-analysis/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/06/09/it-certification-alternatives-cost-benefit-analysis/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Slimmed Down Software &#8211; A Lean, Groovy Approach Part 1 &#8211; Eliminate Waste</title>
		<link>http://canoo.com/blog/2010/06/04/slimmed-down-software-a-lean-groovy-approach-part-1-eliminate-waste/</link>
		<comments>http://canoo.com/blog/2010/06/04/slimmed-down-software-a-lean-groovy-approach-part-1-eliminate-waste/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 09:51:25 +0000</pubDate>
		<dc:creator>Hamlet</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://canoo.com/blog/?p=1056</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/06/04/slimmed-down-software-a-lean-groovy-approach-part-1-eliminate-waste/";</script>This article originally appeared in the April 2010 edition of GroovyMag, the Groovy and Grails magazine. Parts 2 and 3 are currently available for download from the magazine&#8217;s site, and more will come each month. Enjoy!
The Groovy Programming Language advertises itself as an &#8220;agile and dynamic language for the JVM&#8221;, but what does this mean [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://canoo.com/blog/2010/06/04/slimmed-down-software-a-lean-groovy-approach-part-1-eliminate-waste/";</script><p>This article originally appeared in the April 2010 edition of <a href="http://groovymag.com/">GroovyMag</a>, the Groovy and Grails magazine. Parts 2 and 3 are currently available for download from the magazine&#8217;s site, and more will come each month. Enjoy!</p>
<p><em>The Groovy Programming Language advertises itself as an &#8220;agile and dynamic language for the JVM&#8221;, but what does this mean exactly? This series of articles explains Lean Software Development, and shows how your choice of programming language can make your entire process remain nimble and adaptive. Each month will cover one of the seven Lean Software Development principles and explain how Groovy and the associated ecosystem help eliminate waste, defer commitment, and build quality into your product.</em></p>
<h2>About This Series</h2>
<p>Most of your agile team will spend the majority of their day working with a programming language, making it one of the most important tools to optimize in your project&#8217;s life-cycle. Yet many organizations are reluctant to experiment with newer languages and frameworks, instead preferring to apply what works in one domain to all domains. They are skeptical about the claimed productivity gains from polyglot programming, concerned about the educational investment of retraining their developers, and worried about the risk of using less proven technologies.</p>
<p>Some languages are truly better than others for certain types of problems. These articles exist to help you identify which domains in your project are most in need of a little Groovy magic as well as to help you sell Groovy to a skeptical or unconvinced audience. Hopefully you will see that Groovy is a great fit for your software life-cycle: its dynamic and expressive nature brings greater productivity to testing and operational support, its closeness to Java minimizes educational investment, and its tight integration with the JVM platform allows you to slowly phase in Groovy without an all-or-nothing decision, making its use a low risk decision.</p>
<p>Groovy is an agile programming language. In order to explain what this means, these articles are structured around the seven principles of Lean Software Development. This month includes a short introduction to Lean, and you&#8217;ll see how an expressive language can eliminate waste in unit testing. Next month you&#8217;ll see how the easyb Behavior Driven Development framework builds quality into your software development life-cycle. Later we&#8217;ll explore how different testing tools like the Spock Framework help create knowledge, how a dynamic language lets you minimize coupling and defer commitment, and how metaprogamming allows you to deliver your software fast. In future installments you&#8217;ll see how Groovy&#8217;s Grapes module system, alongside modules like Groovy Web Services, streamline interactions between your development team and other groups like Operations and QA. Finally, we&#8217;ll look at how Groovy can be applied to domains that cross departmental boundaries: how Gradle improves the build process and easyb facilitates collaboration and communication between team members and other stakeholders. The series will end with a discussion of best practices when mixing Java and Groovy</p>
<p>Some of the code examples are basic while others are advanced. This series explores why the features of Groovy are important rather than the mechanics of any one Groovy feature. Hopefully you&#8217;ll leave with some new ideas about how to use Groovy, how to convince your team that Groovy is worthwhile, or most importantly how to increase your productivity.</p>
<h2>Lean Briefly Explained</h2>
<p>Lean manufacturing grew out of the influential Toyota Production System, which was a set of both philosophies and practices designed to weed out waste, inconsistency, and overburden from a manufacturing process. While the Toyota brand recently took a beating for some public quality failures, it is hard to ignore several decades of successful engineering sensitive product development. In the late 1990&#8217;s, Mary and Tom Poppendieck took their knowledge of Lean and applied it to a software project, eventually resulting in 2003 with the publishing of the excellent book &#8220;Lean Software Development&#8221;. The Lean principles have been revised over time; for our purposes we will use the seven principles from &#8220;Implementing Lean&#8221;:</p>
<ol>
<li>Eliminate Waste</li>
<li>Build Quality In</li>
<li>Create Knowledge</li>
<li>Defer Commitment</li>
<li>Deliver Fast</li>
<li>Respect People</li>
<li>Optimize the Whole</li>
</ol>
<p>Lean has been an influential movement within the agile community, spawning a plethora of books, workshops, and articles. Besides being a meaningful set of practices in its own right, it has also directly influenced other agile family Members such as Kanban Software and Real Options. Lean is a set of principles first and a group of practices second. The principles are specific enough to align a team but broad enough to appeal across an organization. I once spent a three-hour car ride discussing eliminating waste with the senior manager and director of my development group, and then arrived at work to help an eager development team make practical changes to reach the goals we had discussed. Compare that to a methodology with principles of &#8220;Honesty&#8221; and &#8220;Communication&#8221;. I have<br />
yet to find a use for vague principles beyond their ability to make me feel a little better about a crummy process.</p>
<h2>Principle 1 &#8211; Eliminate Waste</h2>
<p>Taken literally, it is easy to see how Groovy fulfills the Lean mandate to eliminate waste: list and map literals, a terse closure syntax, and even a lack of semi-colons means there is simply less keyboard typing to do for Groovy developers. But that isn&#8217;t what Lean means by eliminating waste. The real waste within the software process is in half done work. Work that has been started but not delivered eats up the time investment from developers but does not provide value to the client. Any work that has been started but not completed is a form of waste, and we must optimize our life-cycle to keep our user stories out of this state! This means moving stories to Done faster, and any good agilista will tell you Done isn&#8217;t done until the unit and acceptance tests pass. Having used Groovy as a testing language on several projects in the last few years, my team&#8217;s experience is that the same test coverage and quality can be reached with Groovy in less time than it takes using Java.</p>
<p>Good unit testing means testing not just the success scenarios, but also the failure scenarios and the edge cases where things just barely pass or just barely fail (bugs do tend to congregate in corners, after all). This means your unit tests have to create data, and lots of it. Much more data than your production code needs to create. And Groovy is a language better optimized to create data than Java. Consider the data driven test in Listing 1.<br />
<pre><pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: #000000; background-color: #eeeeee; font-size: 12px; line-height: 14px; width: 100%;">public void testSimpleMath() {
&nbsp;&nbsp;[&nbsp;&nbsp; 4: { 2 + 2}, 
&nbsp;&nbsp;&nbsp;&nbsp;6: { 2 + 2 + 2}, 
&nbsp;&nbsp;&nbsp;&nbsp;8: { 2 + 2 + 2 + 2}, 
&nbsp;&nbsp;].each { expected, actual -&gt;
&nbsp;&nbsp;&nbsp;&nbsp;assert expected == actual()
&nbsp;&nbsp;}
}</pre></pre><br />
Listing 1: A Simple Data Driven Test</p>
<p>The example shows a few ways in which Groovy is different from Java. Should read: First, a Map is declared using the notation [key1: value1, key2: value2, ... ]. So in the above example there is a map of type Map&lt;Integer, Closure&gt; with three entries, which sure beats having to use new HashMap().</p>
<p>The values of the map are Closures, which are function objects. The closure can be executed and passed arguments just like formal methods. They can also be passed around to other methods, returned from methods, and assigned to fields. Very, very powerful. Think of them as Runnable or Callable objects without the awful syntax.</p>
<p>Finally, the each method is just a method on Collections and Maps that iterates over the collection, executing the attached closure once for every element. You can see how this closure runs a simple assertion, asserting that the integer key of the map equals the evaluated value of the map.</p>
<p>With a minimum of non-essentials, this test creates a dataset to be used as test input and then executes the test against that input; it is a data driver test, without a framework, without needing to hide any of the mechanics of the test, and without a bunch of annotations and factory methods. Data driven tests are so easy to write in Groovy that you end up using them far more often than in Java.</p>
<p>Listing 2 is another data driven test with a more useful assertion than simple arithmetic:<br />
<pre><pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: #000000; background-color: #eeeeee; font-size: 12px; line-height: 14px; width: 100%;">public void testUserService(userService) {
&nbsp;&nbsp;[&nbsp;&nbsp; user1 :&nbsp;&nbsp;[&quot;John&quot;, &quot;Doe&quot;,&nbsp;&nbsp; 123456], 
&nbsp;&nbsp;&nbsp;&nbsp;user2 :&nbsp;&nbsp;[&quot;Jane&quot;, &quot;Doe&quot;,&nbsp;&nbsp; 654321], 
&nbsp;&nbsp;&nbsp;&nbsp;user3 :&nbsp;&nbsp;[&quot;John&quot;, &quot;Smith&quot;, 789987], 
&nbsp;&nbsp;]. each { username, userData -&gt;
&nbsp;&nbsp;&nbsp;&nbsp;def user = userService.get(username)
&nbsp;&nbsp;&nbsp;&nbsp;assert user.firstName == userData[0]
&nbsp;&nbsp;&nbsp;&nbsp;assert user.lastName == userData[1]
&nbsp;&nbsp;&nbsp;&nbsp;assert user.id == userData[2]
&nbsp;&nbsp;}
}</pre></pre><br />
Listing 2: An Advanced Data Driven Test</p>
<p>This time the data is a map of Strings to a list of values (within Maps, unquoted key value are treated as Strings, so user1 and user2 are Strings). Java purists will notice that the generics of this expression are not easily expressed in Java, while they can be ignored in a dynamic language like Groovy. In this example the assertion block is simply pulling elements out of the list using the subscript operator [0] and [1] instead of the List#get(int) syntax.</p>
<p>The point is that the Groovy language features (list and map literals, closures, good iteration functions) allow you to write data driven tests more quickly, which in turn means you cover more edge cases and more failure scenarios as well. The minimal syntax of Groovy allows you to get down to the essence of a unit test: clearly show the input, execute the system, and clearly assert the output. Sure, you can Extract Method in Java until you have something with minimal accidental complexity (maybe even &#8220;extracting until you drop&#8221;), but as Alan Shalloway says, &#8220;There is a big difference between eliminating waste and not creating it in the first place.&#8221; With Groovy you will write tests faster and you will have your story cards spend less time in the &#8220;in process&#8221; phase. This is good for your project and good for your customers.</p>
<p>* &#8220;Extract Until You Drop&#8221; is a blog post from the inimitable Uncle Bob Martin about taking Extract Method refactorings to their logical, if absurd, conclusion. The piece could just have easily been titled, &#8220;Writing Clean Code in Java is a Complete Hassle&#8221;.</p>
<h2>What happened to assertEquals?</h2>
<p>Sure, using Groovy&#8217;s assert makes your tests more terse, but more importantly check out the exception message on a failing assertion in Listing 3.<br />
<pre><pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: #000000; background-color: #eeeeee; font-size: 12px; line-height: 14px; width: 100%;">def one = &quot;1&quot;
def two = &quot;2&quot;
assert one + one == two</pre></pre><br />
Listing 3: Groovy Assertions</p>
<p>Treating addition as String concatenation is endearing when your four-year-old is learning arithmetic but is an error in most mathematical systems. Listing 3 is interesting because of the exception message: each element of the expression is clearly expressed in the monospaced message: all three variable references as well as both the operators (+ and ==). Lower ceremony, clearer tests, easier debugging.</p>
<h2>Next Steps</h2>
<p>One particularly useful Lean practice for eliminating waste is Value Stream Mapping. Sit down at a whiteboard with your development team and write out your software process: the steps and time it takes to move an idea from inception to customer delivery. Where are the bottlenecks? What are the delays? Why does it take so long? Visualizing and quantifying your process helps everyone clearly see problem areas. And who knows, maybe a few Groovy scripts here and there can cut days out of your cycle. Stranger things have happened.</p>
<h2>Next Month: Build Quality In</h2>
<p>A lean, stream-lined development cycle with minimal waste is nothing if quality suffers. Next month&#8217;s article explores how Groovy helps you build quality into your development life-cycle. Instead of inspecting your product for defects after it is built, change your process to not create the defects in the first place. Easier said then done. Luckily, Groovy programmers can use great tools and techniques like easyb, Behavior Driven Development, and builders to build quality into their products.</p>
<h2>Learn More</h2>
<p>The world is overflowing with books and articles about agile development. These three books are classics and deserve a permanent spot on the bookshelves of discerning programmers.</p>
<ul>
<li>Implementing Lean Software Development &#8211; Poppendieck</li>
<li>The Pragmatic Programmer &#8211; Hunt and Thomas</li>
<li>Extreme Programming Explained, 2nd Edition &#8211; Beck and Anders</li>
</ul>
<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://canoo.com/blog/2010/06/04/slimmed-down-software-a-lean-groovy-approach-part-1-eliminate-waste/";
//]]&gt;
</script><script language="javascript" src="http://reddit.com/button.js?t=1"></script></div>]]></content:encoded>
			<wfw:commentRss>http://canoo.com/blog/2010/06/04/slimmed-down-software-a-lean-groovy-approach-part-1-eliminate-waste/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
