<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Thinking Inside a Bigger Box &#187; English</title>
	<atom:link href="http://johannesbrodwall.com/category/english/feed/" rel="self" type="application/rss+xml" />
	<link>http://johannesbrodwall.com</link>
	<description>Johannes Brodwall&#039;s Musings on Software Architecture and Programming</description>
	<lastBuildDate>Mon, 03 May 2010 20:24:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>		<item>
		<title>Why and how to use Jetty in mission-critical production</title>
		<link>http://johannesbrodwall.com/2010/03/08/why-and-how-to-use-jetty-in-mission-critical-production/</link>
		<comments>http://johannesbrodwall.com/2010/03/08/why-and-how-to-use-jetty-in-mission-critical-production/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 22:48:22 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Meeting Summary]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=519</guid>
		<description><![CDATA[<blockquote>This article is a summary of a seminar I had on the topic. If it seems like it's a continuation of an existing discussion that's because, to some extent, it is. If you haven't been discussing exchanging your app server, this article probably isn't very interesting to you.</blockquote>

By putting the application server inside my application instead of the other way around, I was able to leap tall buildings in a single bound.]]></description>
			<content:encoded><![CDATA[<blockquote><p>This article is a summary of a seminar I had on the topic. If it seems like it&#8217;s a continuation of an existing discussion that&#8217;s because, to some extent, it is. If you haven&#8217;t been discussing exchanging your app server, this article probably isn&#8217;t very interesting to you.</p></blockquote>
<p>By putting the application server inside my application instead of the other way around, I was able to leap tall buildings in a single bound.</p>
<h3>The embedded application server</h3>
<p>This is how I build and deploy <a href="http://svn.brodwall.com/demo/embedded-container/">my sample application</a> to a new test environment (or to production):</p>
<ol>
<li><code>mvn install</code></li>
<li><code>scp <em>someapp</em>-server/target/<em>someapp</em>-1.0.onejar.jar appuser@appserver:/home/appuser/test-env1/</code></li>
<li><code>ssh appuser@appserver "cd /home/appuser/test-env1/ &#038;&#038; java -jar <em>someapp</em>-1.0.onejar.jar&amp;"</code></li>
</ol>
<p>This require no prior installed software on the appserver (with the exception of the JVM). It requires no prior configuration. Rolling back is a matter of replacing one jar-file with another. Clustering is a matter of deploying the same application several times.</p>
<p>In order to make this work in a real environment, there are a many details you as a developer need to take care of. As a matter of fact, you will have to take responsibility for your operational environment. The good news is that creating a good operational environment is not more time-consuming than trying to cope with the feed and care of a big-a Application Server.</p>
<p>In this scheme every application comes with its own application server in the form of jetty&#8217;s jar-files embedded in the deployed jar-file.</p>
<h3>The advantages</h3>
<p>Why would you want to do something like this?</p>
<ul>
<li><strong>Independent application</strong>: If you&#8217;ve ever been told that you can&#8217;t use Java 1.5 because that would require an upgrade of the application server. And if we upgrade the application server, that could affect someone else adversely. So we need to start a huge undertaking to find out who could possibly be affected.</li>
<li><strong>Developer managed libraries</strong>: Similar problems can occur with libraries. Especially those that come with the application server. For example: Oracle OC4J helpfully places a preview version of JPA 1.0 first in your classpath. If you want to use Hibernate with JPA 1.0-FINAL, it will mostly work. Until you try to use a annotation that was changed after the preview version (@Discriminator, for example). The general rule is: <em>If an API comes with your app server, you&#8217;re better served by staying away from it.</em> A rather bizarre state of affairs.</li>
<li><strong>Deployment, configuration and upgrades</strong>: Each version of the application, including all its dependencies is packaged into a single jar-file that can be deployed on several application server, or several times on the same application server (with different ports). The configuration is read from a properties-file in the current working directory. On the minus side, there&#8217;s no fancy web UI where you can step through a wizard to deploy the application or change the configuration. On the plus side, there is no fancy web UI &#8230;. If you&#8217;ve used one such web UI, you know what I mean.</li>
<li><strong>Continuous deployment</strong>: As your maven-repository will contain stand alone applications, creating a continuous deployment scheme is very easy. In my previous environment, a cron job running wget periodically was all that was needed to connect the dots. Having each server environment PULL the latest version gives a bit more flexibility if you want many test environments. (However, if you&#8217;re doing automated PUSH deployment, it&#8217;s probably just as practical for you).</li>
<li><strong>Same code in test and production</strong>: The fact that you can <a href="http://svn.brodwall.com/demo/embedded-container/embedded-container-web/src/test/java/no/steria/embeddedcontainer/web/HelloWebTest.java">start Jetty inside a plain old JUnit test</a> means that it is ideal for taking your automated tests one step further. However, if you test with Jetty and deploy on a different Application Server, the difference will occasionally trip you. It&#8217;s not a big deal. You have to test in the server environment anyway. But why not eliminate the extra source of pain if you can?</li>
<li><strong>Licenses</strong>: Sure, you can afford to pay a few million $ for an application server. You probably don&#8217;t have any better use for that money, anyway, right? However, if you have to pay licenses for each test-server in addition, it will probably mean that you will test less. We don&#8217;t want that.</li>
<li><strong>Operations</strong>: In my experience, operations people don&#8217;t like to mess around with the internals of an Application Server. An executable jar file plus a script that can be run with [start|status|stop] may be a much better match.</li>
</ul>
<h3>The missing bits</h3>
<p>Taking control of the application server takes away a lot of complex technology. This simplifies and makes a lot of stuff cheaper. It also puts you back in control of the environment. However, it forces you to think about some things that might&#8217;ve been solved for you before:</p>
<ul>
<li><strong>Monitoring</strong>: The first step of monitoring is simple: Just make sure you write to a log file that is being monitored by your operations department. The second step requires some work: Create a servlet (or a Jetty Handler) that a monitoring tool can ping to check that everything is okay. Taking control of this means that you can improve it: Check if your data sources can connect, if your file share is visible, if that service answers. Maybe add application-calibrated load reporting. Beyond that, Jetty has good JMX support, but I&#8217;ve never needed it myself.</li>
<li><strong>Load balancing</strong>: My setup supports no load balancing or failover out of the box. However, this is normally something that the web server or routers in front of the application server anyway. You might want to look into <a href="http://docs.codehaus.org/display/JETTY/Configuring+mod_proxy">Jetty&#8217;s options for session affinity</a>, if you need that.</li>
<li><strong>Security</strong>: Jetty supports JAAS, of course. Also: In all the environments I&#8217;ve been working with (CA SiteMinder, Sun OpenSSO, Oracle SSO), the SSO server sends the user name of the currently logged in user as an HTTP header. You can get far by just using that.</li>
<li><strong>Consistency</strong>: If you deploy more than one application as an embedded application server, the file structure used by an application (if any) should be standardized. As should the commands to start and stop the application. And the location of logs. Beyond that, reuse what you like, recreate what you don&#8217;t.</li>
</ul>
<h3>Taking control of your destiny</h3>
<p>Using an embedded application server means using the application server as a library instead of a framework. It means taking control of your &#8220;main&#8221; method. There&#8217;s a surprisingly small number of things you need to work out yourself. In exchange, you get the control to do many things that are impossible with a big-A Application Server.</p>
<p><em>Thanks to Dicksen, Eivind, Terje, Kristian and Kristian for a fun discussion on Jetty as a production app server</em></p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2010/03/08/why-and-how-to-use-jetty-in-mission-critical-production/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>What is the right iteration length?</title>
		<link>http://johannesbrodwall.com/2010/02/25/what-is-the-right-iteration-length/</link>
		<comments>http://johannesbrodwall.com/2010/02/25/what-is-the-right-iteration-length/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 19:59:42 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=516</guid>
		<description><![CDATA[When picking iteration length for an agile project, there are mainly two forces that you have to balance: The rate of learning is proportional with the number of iterations, rather than the length of the project. This means that shorter iterations help you get better faster. But each iteration has some overhead with sprint reviews, retrospectives and planning. You don't want this overhead to dominate the effort spent on the project.

For some reason, most projects I've seen with little experience in iterative development prefer three week iterations. Personally, I prefer two week iterations. Here is the breakdown:

<ul>
  <li><strong>Three week iterations</strong>: After three months, you've spent about 7% of your time on iteration meetings. You've had 4 opportunities to improve.</li>
  <li><strong>Two week iterations</strong>: After three months, you've spent about 10% of your time on iteration meetings. You've had 6 opportunities to improve.</li>
  <li><strong>One week iterations</strong>: After three months, you've spent about 20% of your time on iteration meetings. You've had 12 opportunities to improve.</li>
</ul>

Going from 93% to 90% efficiency for a 50% increase in learning seems like a good deal. Going from 90% to 80% efficiency for a 100% increase in learning, not so much.

These numbers are of course greatly simplified. You might also consider:

<ul>
  <li>With shorter iterations, the planning time may go down. But this takes practice - it doesn't happen automatically.</li>
  <li>With very short iterations, you may not have experienced enough to learn much from the retrospective. However, if you find that you do a timeline, and most of the things people remember happened the last week, it may not be because that's the only time something significant happened.</li>
  <li>You may consider different frequencies for different ceremonies. For example, on my current project we want to have demos with our power users. But they have to travel far to visit us. So we only have a full demo every other four weeks. We plan every two weeks and have an internal review and retrospective every two weeks.</li>
</ul>

What's the right iteration length for your project?]]></description>
			<content:encoded><![CDATA[<p>When picking iteration length for an agile project, there are mainly two forces that you have to balance: The rate of learning is proportional with the number of iterations, rather than the length of the project. This means that shorter iterations help you get better faster. But each iteration has some overhead with sprint reviews, retrospectives and planning. You don&#8217;t want this overhead to dominate the effort spent on the project.</p>
<p>For some reason, most projects I&#8217;ve seen with little experience in iterative development prefer three week iterations. Personally, I prefer two week iterations. Here is the breakdown:</p>
<ul>
<li><strong>Three week iterations</strong>: After three months, you&#8217;ve spent about 7% of your time on iteration meetings. You&#8217;ve had 4 opportunities to improve.</li>
<li><strong>Two week iterations</strong>: After three months, you&#8217;ve spent about 10% of your time on iteration meetings. You&#8217;ve had 6 opportunities to improve.</li>
<li><strong>One week iterations</strong>: After three months, you&#8217;ve spent about 20% of your time on iteration meetings. You&#8217;ve had 12 opportunities to improve.</li>
</ul>
<p>Going from 93% to 90% efficiency for a 50% increase in learning seems like a good deal. Going from 90% to 80% efficiency for a 100% increase in learning, not so much.</p>
<p>These numbers are of course greatly simplified. You might also consider:</p>
<ul>
<li>With shorter iterations, the planning time may go down. But this takes practice &#8211; it doesn&#8217;t happen automatically.</li>
<li>With very short iterations, you may not have experienced enough to learn much from the retrospective. However, if you find that you do a timeline, and most of the things people remember happened the last week, it may not be because that&#8217;s the only time something significant happened.</li>
<li>You may consider different frequencies for different ceremonies. For example, on my current project we want to have demos with our power users. But they have to travel far to visit us. So we only have a full demo every other four weeks. We plan every two weeks and have an internal review and retrospective every two weeks.</li>
</ul>
<p>What&#8217;s the right iteration length for your project?</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2010/02/25/what-is-the-right-iteration-length/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Blogging with colleagues</title>
		<link>http://johannesbrodwall.com/2010/02/18/blogging-with-colleagues/</link>
		<comments>http://johannesbrodwall.com/2010/02/18/blogging-with-colleagues/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 19:26:53 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Non-technical]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=512</guid>
		<description><![CDATA[If you wonder why this blog has been so quiet lately, it not (just) that I'm getting lazier. Together with several of my colleagues at Steria Norway, I've started up a blog at <a href="http://sterkblanding.no">http://sterkblanding.no</a>. "Sterk blanding" is Norwegian for "potent mix", and we hope that as representatives for several disciplines, we will be able to give a broad perspective on IT and management issues.

I've not yet decided what posts to publish here and what posts to publish on <a href="http://sterkblanding.no">Sterk Blanding</a>. My present idea is that I'll publish most of my English articles here at <a href="http://johannesbrodwall.com">Thinking inside a Bigger Box</a> and Norwegian language articles at Sterk Blanding. But I can be persuaded to change my mind.

For my Norwegian readers, enjoy my articles on Sterk Blanding:

<ul>
  <li><a href="http://sterkblanding.no/blog/2010/02/16/hvordan-komme-i-gang-med-blogging/">Hvordan komme i gang med blogging</a>: Some tips for people who're considering to write on a blog</li>
  <li><a href="http://sterkblanding.no/blog/2010/01/21/hemmeligheten-bak-gode-spesifikasjoner/">Hemmligheten bak gode spesifikasjoner</a>: How to change your tests from specifying behavior to specify intentions</li>
  <li><a href="http://sterkblanding.no/blog/2010/01/21/scrum-det-var-dyrt-%C3%B8yeblikket/">"Det var dyrt"-øyeblikket</a>: The sobering moment in my project when both I and my customer realized that the transparency of Scrum meant that we could see how much the project was really costing.</li>
  <li><a href="http://sterkblanding.no/blog/2010/01/21/hvordan-endre-en-statisk-klasse-til-en-dynamisk-singleton/">Hvordan endre en statisk klasse til en dynamisk singleton</a>: A step by step guide to an important strategic level refactoring in legacy systems: Changing static calls to use a singleton that can be mocked.</li>
  <li><a href="http://sterkblanding.no/blog/2010/01/29/smidig-brukervennlighet/">Med Ram Yoga: Smidig brukervennlighet</a>: Some practical tips on how to use agile software development and user centric design to complement each other</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>If you wonder why this blog has been so quiet lately, it not (just) that I&#8217;m getting lazier. Together with several of my colleagues at Steria Norway, I&#8217;ve started up a blog at <a href="http://sterkblanding.no">http://sterkblanding.no</a>. &#8220;Sterk blanding&#8221; is Norwegian for &#8220;potent mix&#8221;, and we hope that as representatives for several disciplines, we will be able to give a broad perspective on IT and management issues.</p>
<p>I&#8217;ve not yet decided what posts to publish here and what posts to publish on <a href="http://sterkblanding.no">Sterk Blanding</a>. My present idea is that I&#8217;ll publish most of my English articles here at <a href="http://johannesbrodwall.com">Thinking inside a Bigger Box</a> and Norwegian language articles at Sterk Blanding. But I can be persuaded to change my mind.</p>
<p>For my Norwegian readers, enjoy my articles on Sterk Blanding:</p>
<ul>
<li><a href="http://sterkblanding.no/blog/2010/02/16/hvordan-komme-i-gang-med-blogging/">Hvordan komme i gang med blogging</a>: Some tips for people who&#8217;re considering to write on a blog</li>
<li><a href="http://sterkblanding.no/blog/2010/01/21/hemmeligheten-bak-gode-spesifikasjoner/">Hemmligheten bak gode spesifikasjoner</a>: How to change your tests from specifying behavior to specify intentions</li>
<li><a href="http://sterkblanding.no/blog/2010/01/21/scrum-det-var-dyrt-%C3%B8yeblikket/">&#8220;Det var dyrt&#8221;-øyeblikket</a>: The sobering moment in my project when both I and my customer realized that the transparency of Scrum meant that we could see how much the project was really costing.</li>
<li><a href="http://sterkblanding.no/blog/2010/01/21/hvordan-endre-en-statisk-klasse-til-en-dynamisk-singleton/">Hvordan endre en statisk klasse til en dynamisk singleton</a>: A step by step guide to an important strategic level refactoring in legacy systems: Changing static calls to use a singleton that can be mocked.</li>
<li><a href="http://sterkblanding.no/blog/2010/01/29/smidig-brukervennlighet/">Med Ram Yoga: Smidig brukervennlighet</a>: Some practical tips on how to use agile software development and user centric design to complement each other</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2010/02/18/blogging-with-colleagues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Eclipse Better</title>
		<link>http://johannesbrodwall.com/2010/02/18/using-eclipse-better/</link>
		<comments>http://johannesbrodwall.com/2010/02/18/using-eclipse-better/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 19:16:05 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=509</guid>
		<description><![CDATA[I've pair programmed <a href="http://johannesbrodwall.com/2009/12/23/observations-from-katas/">the Java EE spike kata</a> in Eclipse with a number of people, I've found that a number of keyboard short cuts and preference settings recur as useful new information. I've compiled the most popular ones in this article. The article is subject to change, but I won't change the number of shortcuts.

<h3>Top five shortcuts</h3>

There are some keyboard short cuts that everyone who uses Eclipse should know:

<ul>
  <li><strong>ctrl-1 (quick fix):</strong> You hopefully use this shortcut to get quick fix support for compiler errors and warnings. Did you know that you can also use it to assign parameters to new fields, rename variables, and invert if-statements and equals-checks? Learn to think of <em>ctrl-1</em> as asking Eclipse "what can you do make the code better (or just different)?"</li>
  <li><strong>ctrl-space (complete):</strong> Again, you hopefully know that you can use ctrl-space to complete the name of variables and method names. But did you know that you can type "<code>equa&#60;ctrl-space></code>" in the class body and have Eclipse override the equals-method for you? Or that you can type "<code>getNam&#60;ctrl-space></code>" and have Eclipse create the whole implementation of a getter for name (if there's a name-field in the class). Or that you can type "<code>Test&#60;ctrl-space></code>" and have Eclipse fill in the Test code template. Think of <em>ctrl-space</em> as asking Eclipse "guess what I'm about to write"</li>
  <li><strong>ctrl-f6 (next editor):</strong> Use this to cycle between open files. It really should've been bound to <em>ctrl-tab</em>, but you can do this yourself.</li>
  <li><strong>f3 (go to definition):</strong> Place the cursor on a method call or variable usage and press <em>f3</em> to go to it's definition.</li>
  <li><strong>ctrl-shift-t (open type):</strong> A nifty dialog to go to any class in your project. Did you know that typing <code>PerCoT</code> will take you to <code>PersonControllerTest</code>?</li>
</ul>

<h3>Top ten runner ups</h3>

Here are some eye-openers that people enjoy learning:

<ul>
  <li><strong>alt-ctrl-down (copy current line):</strong> Creates a new copy of the line under the cursor on the next line. Without wiping the clipboard! Try it while selecting several lines, too</li>
  <li><strong>alt-down (move current line):</strong> Moves the line under the cursor down one line. Works with <em>alt-up</em>, too. And with a number of lines selected. A quick way to move code around with the keyboard.</li>
  <li><strong>alt-shift-left (extend selection):</strong> Progressively selects a larger syntactic element in the editor. Hard to explain. Try it out!</li>
  <li><strong>ctrl-shift-m (static import):</strong> Replace a call to <code>Assert.assertEquals</code> with a static import of the <code>org.junit.Assert.assertEquals</code> and a call to <code>assertEquals</code>.</li>
  <li><strong>ctrl-F11 (rerun latest command):</strong> To run for example the same test again, you can usually press <em>ctrl-f11</em>. Sadly, a few years back the Eclipse team tried to improve this and failed. Fix it under <em>Windows->Preferences, Run/Debug -> Launching</em>. Change "Launch operation" to "Always launch previous".</li>
  <li><strong>f12 (activate editor):</strong> When you perform an operation where some other pane got the focus, use <em>f12</em> to return to the editor again.</li>
  <li><strong>ctrl-N (new &#60;something>):</strong> Create a new class, XML file or whatever. Be sure to use the filter</li>
  <li><strong>alt-shift-l (extract local variable):</strong> My favorite refactoring. Select an expression and press <em>alt-shift-l</em> to assign it to a local variable and replace all uses of the expression with that variable.</li>
  <li><strong>alt-shift-m (extract method):</strong> Your bread and butter refactoring to split up complex logic in understandable units.</li>
  <li><strong>alt-shift-i (inline method/inline variable):</strong> The inverse of both <em>alt-shift-l</em> and <em>alt-shift-m</em>. Together, these three refactorings let you resculpt your code while being certain that the behavior is unaltered.</li>
</ul>

<h3>Top three properties to change</h3>

When I sit down with new programmers, I almost always help them make the following changes in the preferences. Find the preferences under Window->Preferences:

<ul>
  <li><strong>Use ctrl-tab (and ctrl-shift-tab) to switch between open editors:</strong> Go to <em>General->Keys</em>, type in "next editor" in the filter. Select "Copy command" and type "ctrl-tab" in the Binding field. Do the same for "previous editor" and ctrl-shift-tab.</li>
  <li><strong>Type filter:</strong> Do you wonder why Eclipse can't understand that when you say List, you mean <code>java.util.List</code>, not <code>org.hibernate.mapping.List</code> or (ye gods!) <code>java.awt.List</code>. Well, you can make Eclipse understand. Put classes and packages you don't like under <em>Java->Appearance->Type filters</em>. If your project is like mine, putting org.hibernate.mapping.*, antlr.*, java.awt.List, and com.sun.* in the list makes List unique to java.util.List. Then "organize imports" and completion works as you want.</li>
  <li><strong>Static import favorites:</strong> Do you find yourself using static imports with the same few classes again and again? The preference <em>Java->Editor->Content Assist->Favorites</em> lets you list up classes which will have their static methods checked when you press ctrl-space to complete a method call. <code>org.junit.Assert.*</code> is a good first candidate.</li>
</ul>

<h3>Learning your tool</h3>

All IDEs are rich and powerful tools. Spending some time to learn a few new tricks is well worth the effort.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve pair programmed <a href="http://johannesbrodwall.com/2009/12/23/observations-from-katas/">the Java EE spike kata</a> in Eclipse with a number of people, I&#8217;ve found that a number of keyboard short cuts and preference settings recur as useful new information. I&#8217;ve compiled the most popular ones in this article. The article is subject to change, but I won&#8217;t change the number of shortcuts.</p>
<h3>Top five shortcuts</h3>
<p>There are some keyboard short cuts that everyone who uses Eclipse should know:</p>
<ul>
<li><strong>ctrl-1 (quick fix):</strong> You hopefully use this shortcut to get quick fix support for compiler errors and warnings. Did you know that you can also use it to assign parameters to new fields, rename variables, and invert if-statements and equals-checks? Learn to think of <em>ctrl-1</em> as asking Eclipse &#8220;what can you do make the code better (or just different)?&#8221;</li>
<li><strong>ctrl-space (complete):</strong> Again, you hopefully know that you can use ctrl-space to complete the name of variables and method names. But did you know that you can type &#8220;<code>equa&lt;ctrl-space></code>&#8221; in the class body and have Eclipse override the equals-method for you? Or that you can type &#8220;<code>getNam&lt;ctrl-space></code>&#8221; and have Eclipse create the whole implementation of a getter for name (if there&#8217;s a name-field in the class). Or that you can type &#8220;<code>Test&lt;ctrl-space></code>&#8221; and have Eclipse fill in the Test code template. Think of <em>ctrl-space</em> as asking Eclipse &#8220;guess what I&#8217;m about to write&#8221;</li>
<li><strong>ctrl-f6 (next editor):</strong> Use this to cycle between open files. It really should&#8217;ve been bound to <em>ctrl-tab</em>, but you can do this yourself.</li>
<li><strong>f3 (go to definition):</strong> Place the cursor on a method call or variable usage and press <em>f3</em> to go to it&#8217;s definition.</li>
<li><strong>ctrl-shift-t (open type):</strong> A nifty dialog to go to any class in your project. Did you know that typing <code>PerCoT</code> will take you to <code>PersonControllerTest</code>?</li>
</ul>
<h3>Top ten runner ups</h3>
<p>Here are some eye-openers that people enjoy learning:</p>
<ul>
<li><strong>alt-ctrl-down (copy current line):</strong> Creates a new copy of the line under the cursor on the next line. Without wiping the clipboard! Try it while selecting several lines, too</li>
<li><strong>alt-down (move current line):</strong> Moves the line under the cursor down one line. Works with <em>alt-up</em>, too. And with a number of lines selected. A quick way to move code around with the keyboard.</li>
<li><strong>alt-shift-left (extend selection):</strong> Progressively selects a larger syntactic element in the editor. Hard to explain. Try it out!</li>
<li><strong>ctrl-shift-m (static import):</strong> Replace a call to <code>Assert.assertEquals</code> with a static import of the <code>org.junit.Assert.assertEquals</code> and a call to <code>assertEquals</code>.</li>
<li><strong>ctrl-F11 (rerun latest command):</strong> To run for example the same test again, you can usually press <em>ctrl-f11</em>. Sadly, a few years back the Eclipse team tried to improve this and failed. Fix it under <em>Windows->Preferences, Run/Debug -> Launching</em>. Change &#8220;Launch operation&#8221; to &#8220;Always launch previous&#8221;.</li>
<li><strong>f12 (activate editor):</strong> When you perform an operation where some other pane got the focus, use <em>f12</em> to return to the editor again.</li>
<li><strong>ctrl-N (new &lt;something>):</strong> Create a new class, XML file or whatever. Be sure to use the filter</li>
<li><strong>alt-shift-l (extract local variable):</strong> My favorite refactoring. Select an expression and press <em>alt-shift-l</em> to assign it to a local variable and replace all uses of the expression with that variable.</li>
<li><strong>alt-shift-m (extract method):</strong> Your bread and butter refactoring to split up complex logic in understandable units.</li>
<li><strong>alt-shift-i (inline method/inline variable):</strong> The inverse of both <em>alt-shift-l</em> and <em>alt-shift-m</em>. Together, these three refactorings let you resculpt your code while being certain that the behavior is unaltered.</li>
</ul>
<h3>Top three properties to change</h3>
<p>When I sit down with new programmers, I almost always help them make the following changes in the preferences. Find the preferences under Window->Preferences:</p>
<ul>
<li><strong>Use ctrl-tab (and ctrl-shift-tab) to switch between open editors:</strong> Go to <em>General->Keys</em>, type in &#8220;next editor&#8221; in the filter. Select &#8220;Copy command&#8221; and type &#8220;ctrl-tab&#8221; in the Binding field. Do the same for &#8220;previous editor&#8221; and ctrl-shift-tab.</li>
<li><strong>Type filter:</strong> Do you wonder why Eclipse can&#8217;t understand that when you say List, you mean <code>java.util.List</code>, not <code>org.hibernate.mapping.List</code> or (ye gods!) <code>java.awt.List</code>. Well, you can make Eclipse understand. Put classes and packages you don&#8217;t like under <em>Java->Appearance->Type filters</em>. If your project is like mine, putting org.hibernate.mapping.*, antlr.*, java.awt.List, and com.sun.* in the list makes List unique to java.util.List. Then &#8220;organize imports&#8221; and completion works as you want.</li>
<li><strong>Static import favorites:</strong> Do you find yourself using static imports with the same few classes again and again? The preference <em>Java->Editor->Content Assist->Favorites</em> lets you list up classes which will have their static methods checked when you press ctrl-space to complete a method call. <code>org.junit.Assert.*</code> is a good first candidate.</li>
</ul>
<h3>Learning your tool</h3>
<p>All IDEs are rich and powerful tools. Spending some time to learn a few new tricks is well worth the effort.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2010/02/18/using-eclipse-better/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Getting started with pair programming</title>
		<link>http://johannesbrodwall.com/2010/01/13/getting-started-with-pair-programming/</link>
		<comments>http://johannesbrodwall.com/2010/01/13/getting-started-with-pair-programming/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 00:02:36 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=505</guid>
		<description><![CDATA[As it turns out, one of the least used practices of agile development is also one of the most powerful.

Up into the start of last year, I only worked sporadically with pair programming. Last year, I was lucky enough to be part of a team that used pair programming all the time. Since I've experienced real pair programming, I never want to give it up.

Pair programming offers benefits to many stakeholders:

<ul>
  <li>As a developer, you will have more fun at work. You will get to know your colleagues better and experience flow practically the whole day. You will be tired by the end of the day, but you will also feel like you've accomplished good work.</li>
  <li>The team will have a higher quality code base that everyone is comfortable with.</li>
  <li>As an architect or team lead, you will have a good way to contribute even if you only have a little time before a meeting. You will also have a better chance to influence the rest of the team, instead of just issuing edicts that nobody follows.</li>
  <li>As the project manager, you will have a more flexible team. If someone gets sick, goes on vacation or moves to another project, there won't be a big problem.</li>
  <li>As the customer, you will get better quality code faster.</li>
</ul>

With these benefits in mind, why doesn't everybody pair program? Well, it is unfamiliar, a little scary, and exhausting when you start out. Most developers are not used to having other watch them code. Or to focus on the task at hand the whole day.

Here are some techniques I've seen have effect for teams transitioning to pair programming:

<ul>
  <li>Code dojos: Everyone on the team gets together and programs a sample program or a spike together. Two people sit at the keyboard, while the rest watch on a projector. Rotate pairs frequently. This lets everyone get comfortable with coding as a social activity.</li>
  <li>Pair programming should be the norm, but allow for exceptions. If people only pair program occasionally, they end up not pair programming at all. If people are forced to pair program when they just need some time by themselves to think, they will not be happy pair programming.</li>
  <li>The pair programming star: Write the names of the team members in a circle. Every time two people pair program, draw a line between their names. Keep the pair programming star in a visible location.</li>
  <li>Facilities: The furniture can make it harder to get started pair programming. Consider using two mice, two keyboards and perhaps two monitors per PC to make it easier. Or use VNC for desktop sharing.</li>
  <li>Give it time: Pair programming is exhausting when you first start doing it. It will take a while before people are comfortable with the new pace. But once they switch, they will never want to go back.</li>
</ul>

<h3>Resources</h3>

For more inspiration, see these presentations from the <a href="http://smidig2009.no">Smidig 2009</a> conference (in Norwegian):

<ul>
  <li><a href="http://tcs.java.no/tcs/?id=379B438E-11FA-418E-8A04-D02AF83B1698">Jøran Lillesand: Derre e itj smidi!</a>: On why pair programming is the very foundation of successful agile projects</li>
  <li><a href="http://tcs.java.no/tcs/?id=3D998ED6-1BF4-46D7-BF40-25CC06BD1AA1">Ørjan Lillevik og Kari Røssland: Parprogrammering gir driv</a>: On what it feels like to be on a team that adopts pair programming. From reluctance to joy.</li>
</ul>
]]></description>
			<content:encoded><![CDATA[<p>As it turns out, one of the least used practices of agile development is also one of the most powerful.</p>
<p>Up into the start of last year, I only worked sporadically with pair programming. Last year, I was lucky enough to be part of a team that used pair programming all the time. Since I&#8217;ve experienced real pair programming, I never want to give it up.</p>
<p>Pair programming offers benefits to many stakeholders:</p>
<ul>
<li>As a developer, you will have more fun at work. You will get to know your colleagues better and experience flow practically the whole day. You will be tired by the end of the day, but you will also feel like you&#8217;ve accomplished good work.</li>
<li>The team will have a higher quality code base that everyone is comfortable with.</li>
<li>As an architect or team lead, you will have a good way to contribute even if you only have a little time before a meeting. You will also have a better chance to influence the rest of the team, instead of just issuing edicts that nobody follows.</li>
<li>As the project manager, you will have a more flexible team. If someone gets sick, goes on vacation or moves to another project, there won&#8217;t be a big problem.</li>
<li>As the customer, you will get better quality code faster.</li>
</ul>
<p>With these benefits in mind, why doesn&#8217;t everybody pair program? Well, it is unfamiliar, a little scary, and exhausting when you start out. Most developers are not used to having other watch them code. Or to focus on the task at hand the whole day.</p>
<p>Here are some techniques I&#8217;ve seen have effect for teams transitioning to pair programming:</p>
<ul>
<li>Code dojos: Everyone on the team gets together and programs a sample program or a spike together. Two people sit at the keyboard, while the rest watch on a projector. Rotate pairs frequently. This lets everyone get comfortable with coding as a social activity.</li>
<li>Pair programming should be the norm, but allow for exceptions. If people only pair program occasionally, they end up not pair programming at all. If people are forced to pair program when they just need some time by themselves to think, they will not be happy pair programming.</li>
<li>The pair programming star: Write the names of the team members in a circle. Every time two people pair program, draw a line between their names. Keep the pair programming star in a visible location.</li>
<li>Facilities: The furniture can make it harder to get started pair programming. Consider using two mice, two keyboards and perhaps two monitors per PC to make it easier. Or use VNC for desktop sharing.</li>
<li>Give it time: Pair programming is exhausting when you first start doing it. It will take a while before people are comfortable with the new pace. But once they switch, they will never want to go back.</li>
</ul>
<h3>Resources</h3>
<p>For more inspiration, see these presentations from the <a href="http://smidig2009.no">Smidig 2009</a> conference (in Norwegian):</p>
<ul>
<li><a href="http://tcs.java.no/tcs/?id=379B438E-11FA-418E-8A04-D02AF83B1698">Jøran Lillesand: Derre e itj smidi!</a>: On why pair programming is the very foundation of successful agile projects</li>
<li><a href="http://tcs.java.no/tcs/?id=3D998ED6-1BF4-46D7-BF40-25CC06BD1AA1">Ørjan Lillevik og Kari Røssland: Parprogrammering gir driv</a>: On what it feels like to be on a team that adopts pair programming. From reluctance to joy.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2010/01/13/getting-started-with-pair-programming/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My first katacast</title>
		<link>http://johannesbrodwall.com/2009/12/31/my-first-katacast/</link>
		<comments>http://johannesbrodwall.com/2009/12/31/my-first-katacast/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 10:29:13 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=500</guid>
		<description><![CDATA[After seeing some of the great examples of coders working on practiced problems on <a href="http://www.katacasts.com/">KataCasts</a>, I decided to try make my own. I am not happy with the pacing of the video. I'm about a minute too early relative to the music.

But I thought I'd post the video here, to see what you all think. Comments are welcome!

I hope the video will demonstrate how to use refactoring effectively to drive the design of a program.

I chose the FizzBuzz kata - that is, to generate a sequence of numbers where every number divisible by three is replaced by "fizz" and every number divisible by five is replaced by "five". The music changes to be more aggressive just as I induce a new requirement into the kata: The FizzBuzz generator should be programmable, so, in the kata, numbers divisible by two are replaced by "coconut" and numbers divisible by seven are replaced by "banana".

Thanks to Emily Bache for the inspiration for the kata.

Enjoy!

<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8459948&#38;server=vimeo.com&#38;show_title=1&#38;show_byline=1&#38;show_portrait=0&#38;color=&#38;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=8459948&#38;server=vimeo.com&#38;show_title=1&#38;show_byline=1&#38;show_portrait=0&#38;color=&#38;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><p><a href="http://vimeo.com/8459948">Fizz buzz code kata</a> from <a href="http://vimeo.com/user2873956">Johannes Brodwall</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

The video was made with <a href="http://www.jetbrains.com/idea/free_java_ide.html">IntelliJ IDEA Community Edition</a> on Windows Vista (!) with <a href="http://www.bbsoftware.co.uk/BBFlashBack_FreePlayer.aspx?cc=true">BB FlashBack Express</a> (free screen recorder), converted to AVI with Windows Media 1 codec and uploaded to Vimeo.]]></description>
			<content:encoded><![CDATA[<p>After seeing some of the great examples of coders working on practiced problems on <a href="http://www.katacasts.com/">KataCasts</a>, I decided to try make my own. I am not happy with the pacing of the video. I&#8217;m about a minute too early relative to the music.</p>
<p>But I thought I&#8217;d post the video here, to see what you all think. Comments are welcome!</p>
<p>I hope the video will demonstrate how to use refactoring effectively to drive the design of a program.</p>
<p>I chose the FizzBuzz kata &#8211; that is, to generate a sequence of numbers where every number divisible by three is replaced by &#8220;fizz&#8221; and every number divisible by five is replaced by &#8220;five&#8221;. The music changes to be more aggressive just as I induce a new requirement into the kata: The FizzBuzz generator should be programmable, so, in the kata, numbers divisible by two are replaced by &#8220;coconut&#8221; and numbers divisible by seven are replaced by &#8220;banana&#8221;.</p>
<p>Thanks to Emily Bache for the inspiration for the kata.</p>
<p>Enjoy!</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8459948&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=8459948&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a href="http://vimeo.com/8459948">Fizz buzz code kata</a> from <a href="http://vimeo.com/user2873956">Johannes Brodwall</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>The video was made with <a href="http://www.jetbrains.com/idea/free_java_ide.html">IntelliJ IDEA Community Edition</a> on Windows Vista (!) with <a href="http://www.bbsoftware.co.uk/BBFlashBack_FreePlayer.aspx?cc=true">BB FlashBack Express</a> (free screen recorder), converted to AVI with Windows Media 1 codec and uploaded to Vimeo.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/12/31/my-first-katacast/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Observations from katas</title>
		<link>http://johannesbrodwall.com/2009/12/23/observations-from-katas/</link>
		<comments>http://johannesbrodwall.com/2009/12/23/observations-from-katas/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 11:56:50 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=497</guid>
		<description><![CDATA[Lately, I've been working on two code katas, that is, programming exercises that I repeat until the motions are secure in my muscle memory. The katas I've chosen are:

<ul>
  <li><strong>Java EE Spike</strong>: An application that stores People with names to a database and lets me search for them. I've repeated this pair programming with several different programmers.</li>
  <li><strong>Programmable Fizz Buzz</strong>: Create a sequence of numbers 1,2,fizz,4,buzz,fizz,... you know the one. And the twist: Make it programmable, so that for example numbers divisible by 7 should be replaced with "coconut".</li>
</ul>

I've learned a lot from repeating these exercises:

<ul>
  <li>Using test-driven development it takes me longer to get to something that "should work in principle", but shorter to get to something that works correctly.</li>
  <li>When refactoring to a new data structure, add the new structure while keeping the old one, make switching between them as simple as changing a single line. Delete the old when it works.</li>
  <li>There's always an automated refactoring you still want to help you out. Extract Parameter Object was my big one.</li>
  <li>Writing for example a method invocation and then using quickfix to have the IDE generate the method is the quickest way of writing code available to you.</li>
  <li>After 8 iterations, the Java EE Spike takes me 80 minutes solo. Pair programming with another programmer who had practiced: 65 minutes. I don't know why!</li>
  <li>Pair programming a moderately complex kata like the Java EE Spike is fun. It's also a good chance to discuss different roles of different tests.</li>
  <li>There is a huge difference between a test that takes 3 seconds to run and one that takes 0.5 seconds when you're test driving. More surprisingly, there's a big difference between a test that takes 0.5 seconds and one that takes 0.01 seconds</li>
  <li>If you think test-driven development is not for you or that it's bunk, you probably write really slow tests.</li>
</ul>

What are your latest coding observations?
]]></description>
			<content:encoded><![CDATA[<p>Lately, I&#8217;ve been working on two code katas, that is, programming exercises that I repeat until the motions are secure in my muscle memory. The katas I&#8217;ve chosen are:</p>
<ul>
<li><strong>Java EE Spike</strong>: An application that stores People with names to a database and lets me search for them. I&#8217;ve repeated this pair programming with several different programmers.</li>
<li><strong>Programmable Fizz Buzz</strong>: Create a sequence of numbers 1,2,fizz,4,buzz,fizz,&#8230; you know the one. And the twist: Make it programmable, so that for example numbers divisible by 7 should be replaced with &#8220;coconut&#8221;.</li>
</ul>
<p>I&#8217;ve learned a lot from repeating these exercises:</p>
<ul>
<li>Using test-driven development it takes me longer to get to something that &#8220;should work in principle&#8221;, but shorter to get to something that works correctly.</li>
<li>When refactoring to a new data structure, add the new structure while keeping the old one, make switching between them as simple as changing a single line. Delete the old when it works.</li>
<li>There&#8217;s always an automated refactoring you still want to help you out. Extract Parameter Object was my big one.</li>
<li>Writing for example a method invocation and then using quickfix to have the IDE generate the method is the quickest way of writing code available to you.</li>
<li>After 8 iterations, the Java EE Spike takes me 80 minutes solo. Pair programming with another programmer who had practiced: 65 minutes. I don&#8217;t know why!</li>
<li>Pair programming a moderately complex kata like the Java EE Spike is fun. It&#8217;s also a good chance to discuss different roles of different tests.</li>
<li>There is a huge difference between a test that takes 3 seconds to run and one that takes 0.5 seconds when you&#8217;re test driving. More surprisingly, there&#8217;s a big difference between a test that takes 0.5 seconds and one that takes 0.01 seconds</li>
<li>If you think test-driven development is not for you or that it&#8217;s bunk, you probably write really slow tests.</li>
</ul>
<p>What are your latest coding observations?</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/12/23/observations-from-katas/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Why don&#8217;t we call our customers &#8220;clients&#8221;?</title>
		<link>http://johannesbrodwall.com/2009/11/15/why-dont-we-call-our-customers-clients/</link>
		<comments>http://johannesbrodwall.com/2009/11/15/why-dont-we-call-our-customers-clients/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 16:07:01 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Non-technical]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=483</guid>
		<description><![CDATA[Lately I've been thinking a lot about how easy it is to lose sight of the goal of the project and instead focus on whatever means someone first thought was a good starting point when the project was first conceived of. And I think it all comes down to words.

The first years I was working in this business, I didn't see any distinction between "the user" and "the customer". Once I started seeing the distinction, I started to understand that the person who is going to use the system we're developing is not the person who defines what the system should do and neither of these is usually the person that pays me to develop the system. So I starting distinguishing between the product owner, that is, the customer and the end user. But the product owner often calls the person I call "end user" his "customer". What's going on here? Let's check the dictionary:

<blockquote>CUSTOMER
Main Entry:  cus·tom·er
Pronunciation:  \ˈkəs-tə-mər\
Function:  noun
<b>1: one that purchases a commodity or service</b>
2: an individual usually having some specified distinctive trait

CLIENT
Main Entry:  cli·ent
Pronunciation:  \ˈklī-ənt\
Function:  noun
1: one that is under the protection of another : dependent
2a: a person who engages the professional advice or services of another
2b: customer
2c: a person served by or utilizing the services of a social agency
2d: a computer in a network that uses the services (as access to files or shared peripherals) provided by a server
</blockquote>

I've seen suppliers approach their work by asking for a specification of a product to deliver and then trying to deliver something to that specification for payment. The mental model is that of a customer going to the grocery story asking for "eight pounds of CRM software". My experience with organizations with this sort of mindset has always been unsatisfactory.

On the other hand, I've seen suppliers approach their work as an agent of the organization that pays them. "Our job is to enable someone else do their job better." This totally changes the way an organization deals with this relationship. The word "customer" may not be conductive to this sort of thinking. Instead, we should think of ourselves as agents acting on behalf of a <em>client</em>. As an agent, your responsibility is to enable your client. This includes helping your client to find better means of reaching their goal.

By the way, wikipedia defines the word "agent" as "a person who is authorized to act on behalf of another (called the Principal or client) to create a legal relationship with a Third Party". If the "third party" is the computer, then a good developer is an agent acting on their clients behalf in dealings with the computer software.

Why doesn't the software industry use the word "client" instead of "customer"?]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been thinking a lot about how easy it is to lose sight of the goal of the project and instead focus on whatever means someone first thought was a good starting point when the project was first conceived of. And I think it all comes down to words.</p>
<p>The first years I was working in this business, I didn&#8217;t see any distinction between &#8220;the user&#8221; and &#8220;the customer&#8221;. Once I started seeing the distinction, I started to understand that the person who is going to use the system we&#8217;re developing is not the person who defines what the system should do and neither of these is usually the person that pays me to develop the system. So I starting distinguishing between the product owner, that is, the customer and the end user. But the product owner often calls the person I call &#8220;end user&#8221; his &#8220;customer&#8221;. What&#8217;s going on here? Let&#8217;s check the dictionary:</p>
<blockquote><p>CUSTOMER<br />
Main Entry:  cus·tom·er<br />
Pronunciation:  \ˈkəs-tə-mər\<br />
Function:  noun<br />
<b>1: one that purchases a commodity or service</b><br />
2: an individual usually having some specified distinctive trait</p>
<p>CLIENT<br />
Main Entry:  cli·ent<br />
Pronunciation:  \ˈklī-ənt\<br />
Function:  noun<br />
1: one that is under the protection of another : dependent<br />
2a: a person who engages the professional advice or services of another<br />
2b: customer<br />
2c: a person served by or utilizing the services of a social agency<br />
2d: a computer in a network that uses the services (as access to files or shared peripherals) provided by a server
</p></blockquote>
<p>I&#8217;ve seen suppliers approach their work by asking for a specification of a product to deliver and then trying to deliver something to that specification for payment. The mental model is that of a customer going to the grocery story asking for &#8220;eight pounds of CRM software&#8221;. My experience with organizations with this sort of mindset has always been unsatisfactory.</p>
<p>On the other hand, I&#8217;ve seen suppliers approach their work as an agent of the organization that pays them. &#8220;Our job is to enable someone else do their job better.&#8221; This totally changes the way an organization deals with this relationship. The word &#8220;customer&#8221; may not be conductive to this sort of thinking. Instead, we should think of ourselves as agents acting on behalf of a <em>client</em>. As an agent, your responsibility is to enable your client. This includes helping your client to find better means of reaching their goal.</p>
<p>By the way, wikipedia defines the word &#8220;agent&#8221; as &#8220;a person who is authorized to act on behalf of another (called the Principal or client) to create a legal relationship with a Third Party&#8221;. If the &#8220;third party&#8221; is the computer, then a good developer is an agent acting on their clients behalf in dealings with the computer software.</p>
<p>Why doesn&#8217;t the software industry use the word &#8220;client&#8221; instead of &#8220;customer&#8221;?</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/11/15/why-dont-we-call-our-customers-clients/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The Malmö Experiment: Estimation Techniques Shootout</title>
		<link>http://johannesbrodwall.com/2009/11/05/the-malmo-experiment-estimation-techniques-shootout/</link>
		<comments>http://johannesbrodwall.com/2009/11/05/the-malmo-experiment-estimation-techniques-shootout/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 02:48:17 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Extreme Programming]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=480</guid>
		<description><![CDATA[At ØreDev I ran into Lasse Koskela. We started talking about estimation techniques, and we both felt that the dominant estimation technique of relative estimation with planning poker has been unchallenged for a very long time. We found ourselves wondering what the next big idea about estimation will be. After throwing a couple of ideas back and forth, we decided to invite to a workshop comparing a few estimation techniques. We decided to call the workshop "The Malmö Experiment."

The results of the experiment were interesting, but far from conclusive.

During the experiment, we gave the same set of requirements to three teams, each consisting of three estimators. Each team was told to use a different technique. We decided on the following techniques:

<ul>
  <li>Planning poker: The purpose is to give all requirements a relative number (the meaning of these numbers will later be measured based on the output of the iterations). Each estimator has a deck of cards and choose a card with the number he feels is appropriate for the current requirement. Everyone reveals the numbers at the same time to avoid anchoring. The team discusses and reestimates a requirement until their estimates converge.</li>
  <li>Table spread estimation: This is one of the new techniques we proposed. Each requirement is written on a card. The estimators spread the cards along a large table according to the relative effort required per requirement. Numbers can be imposed later if desired.</li>
  <li>Goldilocks estimation: The purpose is to restructure requirements until they all have roughly equal size. Instead of assigning a number to a requirement, the estimators pick one of three options: Too big (split up and estimate the parts again), Too small (merge with other requirements), or Just right. When all requirements have been split or merged into "Just Right" size, the estimation is complete.</li>
</ul>

All teams found their estimation techniques to be motivating, but the Table Spread and Goldilocks groups managed to complete the estimation much faster. The Table Spread estimation would obviously need more space if we had a lot of requirements, while the Goldilocks estimation would generate a large number of requirements.

Based on these experiences, we propose the following experiment in a project:
<ul>
  <li>Use Table Spread Estimation for Release planning. This will encourage the team to keep the number of requirements low instead of trying to plan too detailed too far ahead. Since the table spread is quick it can be redone every iteration.</li>
  <li>Use Goldilocks Estimation for the next few upcoming iterations to split up the requirements into equal sized items. This will generate a better set of work items. The shorter planning window will ensure that we won't have an unmanageable number of requirements.</li>
</ul>

These are currently very rough ideas and we have no idea of whether it will work as we expect. Let me know if you have any relevant experience or if you want more information.]]></description>
			<content:encoded><![CDATA[<p>At ØreDev I ran into Lasse Koskela. We started talking about estimation techniques, and we both felt that the dominant estimation technique of relative estimation with planning poker has been unchallenged for a very long time. We found ourselves wondering what the next big idea about estimation will be. After throwing a couple of ideas back and forth, we decided to invite to a workshop comparing a few estimation techniques. We decided to call the workshop &#8220;The Malmö Experiment.&#8221;</p>
<p>The results of the experiment were interesting, but far from conclusive.</p>
<p>During the experiment, we gave the same set of requirements to three teams, each consisting of three estimators. Each team was told to use a different technique. We decided on the following techniques:</p>
<ul>
<li>Planning poker: The purpose is to give all requirements a relative number (the meaning of these numbers will later be measured based on the output of the iterations). Each estimator has a deck of cards and choose a card with the number he feels is appropriate for the current requirement. Everyone reveals the numbers at the same time to avoid anchoring. The team discusses and reestimates a requirement until their estimates converge.</li>
<li>Table spread estimation: This is one of the new techniques we proposed. Each requirement is written on a card. The estimators spread the cards along a large table according to the relative effort required per requirement. Numbers can be imposed later if desired.</li>
<li>Goldilocks estimation: The purpose is to restructure requirements until they all have roughly equal size. Instead of assigning a number to a requirement, the estimators pick one of three options: Too big (split up and estimate the parts again), Too small (merge with other requirements), or Just right. When all requirements have been split or merged into &#8220;Just Right&#8221; size, the estimation is complete.</li>
</ul>
<p>All teams found their estimation techniques to be motivating, but the Table Spread and Goldilocks groups managed to complete the estimation much faster. The Table Spread estimation would obviously need more space if we had a lot of requirements, while the Goldilocks estimation would generate a large number of requirements.</p>
<p>Based on these experiences, we propose the following experiment in a project:</p>
<ul>
<li>Use Table Spread Estimation for Release planning. This will encourage the team to keep the number of requirements low instead of trying to plan too detailed too far ahead. Since the table spread is quick it can be redone every iteration.</li>
<li>Use Goldilocks Estimation for the next few upcoming iterations to split up the requirements into equal sized items. This will generate a better set of work items. The shorter planning window will ensure that we won&#8217;t have an unmanageable number of requirements.</li>
</ul>
<p>These are currently very rough ideas and we have no idea of whether it will work as we expect. Let me know if you have any relevant experience or if you want more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/11/05/the-malmo-experiment-estimation-techniques-shootout/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Effective Enterprise Java at Öredev</title>
		<link>http://johannesbrodwall.com/2009/11/03/effective-enterprise-java-at-oredev/</link>
		<comments>http://johannesbrodwall.com/2009/11/03/effective-enterprise-java-at-oredev/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:31:11 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=474</guid>
		<description><![CDATA[Just three weeks ago, I was asked to step in for Ted Neward to give a tutorial at Öredev on <a href="http://www.oredev.org/Prod/Oredev/site.nsf/docsbycodename/session?opendocument&#038;sid=2DDB2738A9A84259C125765D006D06EA&#038;day=2&#038;track=E92AC6A14535633BC12575A5004943A0">Effective Enterprise Java</a>. As I did not have time to get the tutorial materials printed, I present them here on the web for the participants and others.

<h3>1. Effect Enterprise Java architecture in 2009</h3>

Since the Effective Enterprise Java book was written, many of the topics regarding transactions, concurrency and shared state have been resolved. Here are the basic guidelines of an enterprise application in Java as of 2009:

<ol>
  <li>All processing is triggered by an event, such as an http-request, a timer or an incoming message</li>
  <li>Each processing event is handled in an isolated scope, never touching the data of another processing event. All coordination of data happens through the data layer. This means that objects are either stateful and short-lived or stateless and immortal.</li>
  <li>Each processing event is either completed or aborted totally. Very few applications will benefit from trying to automatically recover from most problems.</li>
  <li>Inconsistent updates are resolved when transactions are committed, usually through optimistic locking.</li>
</ol>

Some things I told the attendants to consider: First, today most people consider EJBs to be more trouble than value (with the exception of Entity beans 3.0 which is JPA which is really mostly Hibernate, which really isn't very much EJB). Second, all triggers can be forged. We return to the second issue when we discuss security.

<h3>2. Web integration testing</h3>

I showed a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/src/test/java/com/brodwall/kata/webcrud/PersonWebTest.java">practical demo using WebDriver and Jetty</a> to perform web integration tests as JUnit test. The remarkable things about this example is that it requires no installation of an app server (Jetty is installed as a Maven dependency), it requires no separate starting of an application server (Jetty can run embedded in the test) and it is very fast (Jetty starts up in about 200 milliseconds).

<h3>3. Hibernate integration testing</h3>

I showed a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/src/test/java/com/brodwall/kata/webcrud/HibernatePersonDaoTest.java">practical example of how to test a DAO implemented with Hibernate</a>. The remarkable things about this demonstration was that, again, no installation or startup is required (I use H2 as an in-memory database).

Hibernate is a power tool. I use the following analogy: If you're building a tunnel and need to mine through a mountain, you want to use dynamite. If you want to remove a rock from you back yard, you may want to use dynamite. But if you don't know what you're doing, chances are you may blow your foot off.

Hibernate is like that dynamite. You need knowledge and safety measures to deal with it correctly, but when you do, it can save you a lot of effort. Creating JUnit tests for your Hibernate code is one such safety measure.

<h3>4. Security</h3>

Almost all the threats an application developer should be concerned with are in the same class, namely that of Injection attacks. An injection attack is when a client tricks another process into treating data as instructions. For example by using SQL meta-characters:

<img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="Little Bobby Tables" width="400" />

An important source of injection vulnerabilities is HTML injection, also known as Cross-Site Scripting (XSS).

In both situations, and in all others, there's one important guideline: Data from the outside world should be considered "tainted". Never use tainted data in unsafe ways. When reading input parameters, validate against malicious characters (but please don't make poor "O'Reiley" unable to use your system). When writing HTML pages, always escape tainted data. When using tainted data during access to the database or with HSQL or JPAQL, always use PreparedStatement and send in data as parameters.

Another often overlooked exploit is request forgery, often used in combination with phishing attacks. To protect your users from request forgery, supply an authentication token as a hidden field with all forms. Or if you're lazy: Make sure all operations have confirmation dialogs.

<h3>5. Continuous Deployment</h3>

Continuous Deployment is the practice of rolling out a deployment to a server after every successful build on your Continuous Integration server. I described two ways of doing Continuous Deployment during the tutorial, but I will restrict this discussion to the more modern one.

Most teams doing continuous deployment use Maven or Ant to invoke the deployment tools of their respective application servers. Many application servers make this pretty hard, but the hardest part of the battle if finding out what command needs to be invoked. The Continuous Integration server can be configured to run this task.

After doing deployment, it is a good idea to run some sort of system level integration tests. Teams use replay of production data, load generators like JMeter and webcrawlers that validate HTML and CSS to do automated non-functional integration tests. If you keep your logs clean, you can actually gain quite a bit of confidence just by looking at the logs after applying simulated load to your system.

Some projects take this even further, by continuously deploying to production. Both IMVU and Flickr are known to practice this.

At any rate, the practice of doing continuous deployment should lead you to consider how to simplify your deployment and runtime configuration, which will result in an easier installation procedure into production, even if it's not automated.

<h3>Summary</h3>

Effective Enterprise Java development has progressed a lot since 2004. Much of the emphasis now is on how to improve testing in enterprise Java applications. The way applications usually process data has stabilized as well, with most application preferring each event to be processed in an isolated, transactional context with very little automated recovery.

In the end, Effective Enterprise Java is a lot simpler in 2009 than it was in 2004.

<h3>Material</h3>

<ul>
  <li><a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Effective%20Enterprise%20Java%20-%20%C3%98redev.ppt">My slides</a>, including topics that we didn't discuss as well as code for all the examples</li>
  <li>The complete source code for one iteration of my <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev">Enterprise Java Kata</a>, including a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/pom.xml">pom.xml</a> file with all dependencies needed to get the tests running</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Just three weeks ago, I was asked to step in for Ted Neward to give a tutorial at Öredev on <a href="http://www.oredev.org/Prod/Oredev/site.nsf/docsbycodename/session?opendocument&#038;sid=2DDB2738A9A84259C125765D006D06EA&#038;day=2&#038;track=E92AC6A14535633BC12575A5004943A0">Effective Enterprise Java</a>. As I did not have time to get the tutorial materials printed, I present them here on the web for the participants and others.</p>
<h3>1. Effect Enterprise Java architecture in 2009</h3>
<p>Since the Effective Enterprise Java book was written, many of the topics regarding transactions, concurrency and shared state have been resolved. Here are the basic guidelines of an enterprise application in Java as of 2009:</p>
<ol>
<li>All processing is triggered by an event, such as an http-request, a timer or an incoming message</li>
<li>Each processing event is handled in an isolated scope, never touching the data of another processing event. All coordination of data happens through the data layer. This means that objects are either stateful and short-lived or stateless and immortal.</li>
<li>Each processing event is either completed or aborted totally. Very few applications will benefit from trying to automatically recover from most problems.</li>
<li>Inconsistent updates are resolved when transactions are committed, usually through optimistic locking.</li>
</ol>
<p>Some things I told the attendants to consider: First, today most people consider EJBs to be more trouble than value (with the exception of Entity beans 3.0 which is JPA which is really mostly Hibernate, which really isn&#8217;t very much EJB). Second, all triggers can be forged. We return to the second issue when we discuss security.</p>
<h3>2. Web integration testing</h3>
<p>I showed a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/src/test/java/com/brodwall/kata/webcrud/PersonWebTest.java">practical demo using WebDriver and Jetty</a> to perform web integration tests as JUnit test. The remarkable things about this example is that it requires no installation of an app server (Jetty is installed as a Maven dependency), it requires no separate starting of an application server (Jetty can run embedded in the test) and it is very fast (Jetty starts up in about 200 milliseconds).</p>
<h3>3. Hibernate integration testing</h3>
<p>I showed a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/src/test/java/com/brodwall/kata/webcrud/HibernatePersonDaoTest.java">practical example of how to test a DAO implemented with Hibernate</a>. The remarkable things about this demonstration was that, again, no installation or startup is required (I use H2 as an in-memory database).</p>
<p>Hibernate is a power tool. I use the following analogy: If you&#8217;re building a tunnel and need to mine through a mountain, you want to use dynamite. If you want to remove a rock from you back yard, you may want to use dynamite. But if you don&#8217;t know what you&#8217;re doing, chances are you may blow your foot off.</p>
<p>Hibernate is like that dynamite. You need knowledge and safety measures to deal with it correctly, but when you do, it can save you a lot of effort. Creating JUnit tests for your Hibernate code is one such safety measure.</p>
<h3>4. Security</h3>
<p>Almost all the threats an application developer should be concerned with are in the same class, namely that of Injection attacks. An injection attack is when a client tricks another process into treating data as instructions. For example by using SQL meta-characters:</p>
<p><img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="Little Bobby Tables" width="400" /></p>
<p>An important source of injection vulnerabilities is HTML injection, also known as Cross-Site Scripting (XSS).</p>
<p>In both situations, and in all others, there&#8217;s one important guideline: Data from the outside world should be considered &#8220;tainted&#8221;. Never use tainted data in unsafe ways. When reading input parameters, validate against malicious characters (but please don&#8217;t make poor &#8220;O&#8217;Reiley&#8221; unable to use your system). When writing HTML pages, always escape tainted data. When using tainted data during access to the database or with HSQL or JPAQL, always use PreparedStatement and send in data as parameters.</p>
<p>Another often overlooked exploit is request forgery, often used in combination with phishing attacks. To protect your users from request forgery, supply an authentication token as a hidden field with all forms. Or if you&#8217;re lazy: Make sure all operations have confirmation dialogs.</p>
<h3>5. Continuous Deployment</h3>
<p>Continuous Deployment is the practice of rolling out a deployment to a server after every successful build on your Continuous Integration server. I described two ways of doing Continuous Deployment during the tutorial, but I will restrict this discussion to the more modern one.</p>
<p>Most teams doing continuous deployment use Maven or Ant to invoke the deployment tools of their respective application servers. Many application servers make this pretty hard, but the hardest part of the battle if finding out what command needs to be invoked. The Continuous Integration server can be configured to run this task.</p>
<p>After doing deployment, it is a good idea to run some sort of system level integration tests. Teams use replay of production data, load generators like JMeter and webcrawlers that validate HTML and CSS to do automated non-functional integration tests. If you keep your logs clean, you can actually gain quite a bit of confidence just by looking at the logs after applying simulated load to your system.</p>
<p>Some projects take this even further, by continuously deploying to production. Both IMVU and Flickr are known to practice this.</p>
<p>At any rate, the practice of doing continuous deployment should lead you to consider how to simplify your deployment and runtime configuration, which will result in an easier installation procedure into production, even if it&#8217;s not automated.</p>
<h3>Summary</h3>
<p>Effective Enterprise Java development has progressed a lot since 2004. Much of the emphasis now is on how to improve testing in enterprise Java applications. The way applications usually process data has stabilized as well, with most application preferring each event to be processed in an isolated, transactional context with very little automated recovery.</p>
<p>In the end, Effective Enterprise Java is a lot simpler in 2009 than it was in 2004.</p>
<h3>Material</h3>
<ul>
<li><a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Effective%20Enterprise%20Java%20-%20%C3%98redev.ppt">My slides</a>, including topics that we didn&#8217;t discuss as well as code for all the examples</li>
<li>The complete source code for one iteration of my <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev">Enterprise Java Kata</a>, including a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/pom.xml">pom.xml</a> file with all dependencies needed to get the tests running</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/11/03/effective-enterprise-java-at-oredev/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
