<?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</title>
	<atom:link href="http://johannesbrodwall.com/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>Fri, 12 Mar 2010 14:20:43 +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>6</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>3</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>7</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>Å trene på Java EE</title>
		<link>http://johannesbrodwall.com/2009/12/02/trene-pa-java-ee/</link>
		<comments>http://johannesbrodwall.com/2009/12/02/trene-pa-java-ee/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 19:25:52 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Norsk]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=489</guid>
		<description><![CDATA[For å bli bedre må man trene. For å bli bedre med avanserte ting, må man forstå de grunnleggende tingene bra. For å vite hvorfor man bruker avanserte verktøy, må man prøve å jobbe uten dem. Derfor har jeg de siste ukene trent mange ganger på å lage en veldig enkel webapplikasjon i Java. For hele applikasjonen har jeg startet med å skrive testene før koden som implementerer funksjonaliteten.

Dersom du vil prøve deg på samme øvelse, inneholder denne artikkelen litt informasjon for å komme i gang. Start med koden under og <em>følg feilmeldingene.</em> Send en kommentar dersom du ikke kommer videre fra en feilmelding, så får vi en FAQ.

<h3>Oppgaven</h3>

Løs et så enkelt som mulig problem som involverer websider og database med så enkel teknologi om mulig.

Oppgaven jeg har laget går ut på å <em>opprette personer med fullt navn og søke etter personer basert på navnet deres</em>. For å gjøre oppgaven så lite som mulig har jeg valgt å la personer kun ha ett informasjonsfelt: Fullt navn. Denne oppgaven tar cirka 2-3 timer uten øvelse og du kan få den ned i 60-90 minutter med trening.

Du kan naturligvis velge en annen oppgave, men uansett hva du velger: Det er mer lærerikt å gjenta den samme oppgaven flere ganger enn å utføre en avansert oppgave.

Når jeg utfører oppgaven er det viktigste jeg lærer meg å forstå feilmeldingene som guider meg gjennom utviklingen. Dersom du trenger hjelp til å komme til de første feilmeldingene kan du se resten av artikkelen.
]]></description>
			<content:encoded><![CDATA[<p>For å bli bedre må man trene. For å bli bedre med avanserte ting, må man forstå de grunnleggende tingene bra. For å vite hvorfor man bruker avanserte verktøy, må man prøve å jobbe uten dem. Derfor har jeg de siste ukene trent mange ganger på å lage en veldig enkel webapplikasjon i Java. For hele applikasjonen har jeg startet med å skrive testene før koden som implementerer funksjonaliteten.</p>
<p>Dersom du vil prøve deg på samme øvelse, inneholder denne artikkelen litt informasjon for å komme i gang. Start med koden under og <em>følg feilmeldingene.</em> Send en kommentar dersom du ikke kommer videre fra en feilmelding, så får vi en FAQ.</p>
<h3>Oppgaven</h3>
<p>Løs et så enkelt som mulig problem som involverer websider og database med så enkel teknologi om mulig.</p>
<p>Oppgaven jeg har laget går ut på å <em>opprette personer med fullt navn og søke etter personer basert på navnet deres</em>. For å gjøre oppgaven så lite som mulig har jeg valgt å la personer kun ha ett informasjonsfelt: Fullt navn. Denne oppgaven tar cirka 2-3 timer uten øvelse og du kan få den ned i 60-90 minutter med trening.</p>
<p>Du kan naturligvis velge en annen oppgave, men uansett hva du velger: Det er mer lærerikt å gjenta den samme oppgaven flere ganger enn å utføre en avansert oppgave.</p>
<p>Når jeg utfører oppgaven er det viktigste jeg lærer meg å forstå feilmeldingene som guider meg gjennom utviklingen. Dersom du trenger hjelp til å komme til de første feilmeldingene kan du se resten av artikkelen.</p>
<p><!-- more --></p>
<h3>Steg for steg: Startpunktet</h3>
<p>Selv om jeg valgte veldig enkel teknologi for implementasjonen, har jeg valgt et større sett med biblioteker for å skrive testene. Jeg bruker følgende når jeg skriver testene:</p>
<ul>
<li>JUnit 4.6</li>
<li>Jetty 6.1.22</li>
<li>HSqlDb 1.8.0.10</li>
<li>WebDriver-HtmlUnit 0.6.1039</li>
<li>Mockito 1.8.0</li>
<li>FEST-assert 1.2 (ikke påkrevd, men gjør testene søtere)</li>
</ul>
<p>Den eneste teknologien jeg har valgt for implementasjonen er Servlet-API 2.5 og Hibernate-Annotations 3.4.0.GA.</p>
<p>For at du skal slippe å plundre så mye med avhengigheter før du kommer i gang har jeg laget en <a href="http://svn.brodwall.com/demo/java-ee-spike-kata/pom.xml">pom.xml</a>-fil som du kan ta utgangspunkt i.</p>
<h3>Web-tester</h3>
<p>For å starte utviklingen, er det lurt med en test som starter på utsiden av applikasjonen. Noe slikt:</p>
<ol>
<li>Start opp miljøet</li>
<li>Legg inn en person</li>
<li>Søk etter personen</li>
</ol>
<p>Slik kommer du i gang med en test som går mot en web applikasjon:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">int</span> SERVER_PICKS_PORT <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
org.<span style="color: #006633;">mortbay</span>.<span style="color: #006633;">jetty</span>.<span style="color: #006633;">Server</span> server <span style="color: #339933;">=</span> 
       <span style="color: #000000; font-weight: bold;">new</span> org.<span style="color: #006633;">mortbay</span>.<span style="color: #006633;">jetty</span>.<span style="color: #006633;">Server</span><span style="color: #009900;">&#40;</span>SERVER_PICKS_PORT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
server.<span style="color: #006633;">addHandler</span><span style="color: #009900;">&#40;</span>
       <span style="color: #000000; font-weight: bold;">new</span> org.<span style="color: #006633;">mortbay</span>.<span style="color: #006633;">jetty</span>.<span style="color: #006633;">webapp</span>.<span style="color: #006633;">WebAppContext</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;src/main/webapp&quot;</span>, <span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
server.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> serverPort <span style="color: #339933;">=</span> server.<span style="color: #006633;">getConnectors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getLocalPort</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
org.<span style="color: #006633;">openqa</span>.<span style="color: #006633;">selenium</span>.<span style="color: #006633;">WebDriver</span> browser <span style="color: #339933;">=</span>
       <span style="color: #000000; font-weight: bold;">new</span> org.<span style="color: #006633;">openqa</span>.<span style="color: #006633;">selenium</span>.<span style="color: #006633;">htmlunit</span>.<span style="color: #006633;">HtmlUnitDriver</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
browser.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://localhost:&quot;</span> <span style="color: #339933;">+</span> serverPort <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
browser.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">linkText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Create person&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Dette oppsettet forventer å finne <code>web.xml</code>-fila på <code>src/main/webapp/WEB-INF/web.xml</code>.</p>
<h3>Funksjonell test</h3>
<p>En funksjonell test definerer <em>kravene</em> i applikasjonen. Det er lurt å gjøre funksjonelle tester så raske som overhode mulig, samtidig som de går gjennom alle kravene. En funksjonell test trenger ikke være en ende-til-ende test, slik som eksempelet over. Dette er viktig, fordi ende-til-ende tester er ofte veldig trege. Her er noen eksempler på funksjonelle tester:</p>
<ul>
<li>Vis en siden for å opprette nye personer</li>
<li>Opprett en ny person</li>
<li>Verifiser at personens navn er oppgitt og ikke inneholder ulovlige tegn</li>
<li>Vis en side for å søke etter personer</li>
<li>Vis alle personer dersom søkestreng ikke er angitt</li>
<li>Søk etter angitt søkestreng</li>
</ul>
<p>En funksjonell test kan se slik ut:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">PersonServlet servlet <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PersonServlet<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
HttpServletRequest req <span style="color: #339933;">=</span>
    org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">mock</span><span style="color: #009900;">&#40;</span>HttpServletRequest.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
HttpServletResponse resp <span style="color: #339933;">=</span>
    org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">mock</span><span style="color: #009900;">&#40;</span>HttpServletResponse.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
PersonDao personDao <span style="color: #339933;">=</span>
    org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">mock</span><span style="color: #009900;">&#40;</span>PersonDao.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
servlet.<span style="color: #006633;">setPersonDao</span><span style="color: #009900;">&#40;</span>personDao<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">when</span><span style="color: #009900;">&#40;</span>req.<span style="color: #006633;">getMethod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">thenReturn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">when</span><span style="color: #009900;">&#40;</span>req.<span style="color: #006633;">getPathInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">thenReturn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/create.html&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">when</span><span style="color: #009900;">&#40;</span>req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;full_name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">thenReturn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Johannes Brodwall&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">StringWriter</span> pageSource <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">StringWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">when</span><span style="color: #009900;">&#40;</span>resp.<span style="color: #006633;">getWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">thenReturn</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">PrintWriter</span><span style="color: #009900;">&#40;</span>pageSource<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
servlet.<span style="color: #006633;">service</span><span style="color: #009900;">&#40;</span>req, resp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
org.<span style="color: #006633;">mockito</span>.<span style="color: #006633;">Mockito</span>.<span style="color: #006633;">verify</span><span style="color: #009900;">&#40;</span>personDao<span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span>Person.<span style="color: #006633;">byName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Johannes Brodwall&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
org.<span style="color: #006633;">fest</span>.<span style="color: #006633;">assertions</span>.<span style="color: #006633;">Assertions</span>.<span style="color: #006633;">assertThat</span><span style="color: #009900;">&#40;</span>pageSource.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">contains</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Personen er opprettet&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Data-aksess-test</h3>
<p>Hibernate forenkler databasebruken mye. Men Hibernate er selv komplekst og når man bruker det på mer avanserte måter fortjener det egne tester. En typisk test med Hibernate kan være:</p>
<ol>
<li>Legg i tre personer i database</li>
<li>Søk etter en del av navnet på en av dem</li>
<li>Sjekk at du får tilbake akkurat den du forventet</li>
</ol>
<p>Når jeg starter med Hibernate, lager jeg en test som dette, og følger feilmeldingene. Pass på å både følge feilmeldinger i loggen og stack tracer.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">AnnotationConfiguration conf <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AnnotationConfiguration<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">setProperty</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Environment</span>.<span style="color: #003399;">URL</span>, <span style="color: #0000ff;">&quot;jdbc:hsqldb:mem:persondaotest&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
PersonDao dao <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HibernatePersonDao<span style="color: #009900;">&#40;</span>conf.<span style="color: #006633;">buildSessionFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
dao.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span>Person.<span style="color: #006633;">withName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
org.<span style="color: #006633;">fest</span>.<span style="color: #006633;">assertions</span>.<span style="color: #006633;">Assertions</span>.<span style="color: #006633;">assertThat</span><span style="color: #009900;">&#40;</span>dao.<span style="color: #006633;">find</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #006633;">containsExactly</span><span style="color: #009900;">&#40;</span>Person.<span style="color: #006633;">withName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Følg feilmeldingene herfra.</p>
<h3>Integrasjon</h3>
<p>En veldig vanlig måte for web serveren å overlevere spesielt ting som DataSources til applikasjonen er via JNDI. I Jetty kan du gjøre dette i Web-testen på følgende måte:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">org.<span style="color: #006633;">hsqldb</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">jdbcDataSource</span> ds <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> org.<span style="color: #006633;">hsqldb</span>.<span style="color: #006633;">jdbc</span>.<span style="color: #006633;">jdbcDataSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ds.<span style="color: #006633;">setDatabase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jdbc:hsqldb:mem:personwebtest&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ds.<span style="color: #006633;">setUser</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">new</span> org.<span style="color: #006633;">mortbay</span>.<span style="color: #006633;">jetty</span>.<span style="color: #006633;">plus</span>.<span style="color: #006633;">naming</span>.<span style="color: #006633;">Resource</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jdbc/primaryDs&quot;</span>, ds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Oppstart av Jetty som vist over</span></pre></div></div>

<h3>Konklusjon</h3>
<p>Å gjøre en liten øvelse som dette er en god måte å bli bevisst hvilke vaner du har og hvor lang tid det egentlig tar for deg å gjøre oppgavene dine. Du vil oppleve at det å skrive tester før koden føles som om det går saktere enn du tror du er vant til.</p>
<p>Men dersom du er som meg, vil du også oppleve noe annet: Når du tester ut applikasjonen første gang (du kan gjøre dette med Jetty, naturligvis) så er sjansene gode for at den vil være nokså feilfri og at debugging i stor grad er overflødig. Jeg vet ikke med deg, men debugging er en aktivitet jeg gjerne blir kvitt.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/12/02/trene-pa-java-ee/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tips for databasemigreringer</title>
		<link>http://johannesbrodwall.com/2009/11/24/tips-for-databasemigreringer/</link>
		<comments>http://johannesbrodwall.com/2009/11/24/tips-for-databasemigreringer/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 18:10:42 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[Norsk]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=486</guid>
		<description><![CDATA[En kollega spurte i dag om mine topp tips når det gjelder databaserefactorings. Her er mitt svar:

<ol>
  <li>Ha en organisert struktur med at man gjennomfører navngitte migreringer (a la <a href="http://api.rubyonrails.org/classes/ActiveRecord/Migration.html">Ruby-on-Rails sine migrations</a> eller <a href="http://dbdeploy.com/">dbdeploy</a>). Typisk er det vanlig og velfungerende å navngi scripts med løpenummer (001, 002, ...) eller timestamp (20091124071300, ...) og ha en tabell i databasen som holder styr på hva som har blitt kjørt</li>
  <li>Bruk views og materialiserte views for å støtte tilbakekompabilitet (NB: Oracle er veldig sterk på dette, andre databaser kan slite)</li>
  <li>Om mulig, gjør hver migrering bakoverkompatibel på en versjon av programvaren. Dette er lettere å få til jo hyppigere du releaser programvaren</li>
  <li>Skill endringer i skjema (for eksempel: legg på en kolonne) fra migrering av data (for eksempel: populere kolonnen). Feilene vil typisk ligge i #2 av disse, og den er lett å gjøre transaksjonell, mens skjemaendringer ikke er transaksjonelle i de fleste baser.</li>
</ol>

Har jeg dekket det viktigste da?]]></description>
			<content:encoded><![CDATA[<p>En kollega spurte i dag om mine topp tips når det gjelder databaserefactorings. Her var mitt svar:</p>
<ol>
<li>Ha en organisert struktur med at man gjennomfører navngitte migreringer (a la <a href="http://api.rubyonrails.org/classes/ActiveRecord/Migration.html">Ruby-on-Rails sine migrations</a> eller <a href="http://dbdeploy.com/">dbdeploy</a>). Typisk er det vanlig og velfungerende å navngi scripts med løpenummer (001, 002, &#8230;) eller timestamp (20091124071300, &#8230;) og ha en tabell i databasen som holder styr på hva som har blitt kjørt</li>
<li>Bruk views og materialiserte views for å støtte tilbakekompabilitet (NB: Oracle er veldig sterk på dette, andre databaser kan slite)</li>
<li>Om mulig, gjør hver migrering bakoverkompatibel på en versjon av programvaren. Dette er lettere å få til jo hyppigere du releaser programvaren</li>
<li>Skill endringer i skjema (for eksempel: legg på en kolonne) fra migrering av data (for eksempel: populere kolonnen). Feilene vil typisk ligge i #2 av disse, og den er lett å gjøre transaksjonell, mens skjemaendringer ikke er transaksjonelle i de fleste baser.</li>
</ol>
<p>Har jeg dekket det viktigste da?</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/11/24/tips-for-databasemigreringer/feed/</wfw:commentRss>
		<slash:comments>17</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>5</slash:comments>
		</item>
	</channel>
</rss>
