<?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; Software Development</title>
	<atom:link href="http://johannesbrodwall.com/category/software-development/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>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>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>Å 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>17</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>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>
		<item>
		<title>Staggering toward the project goal</title>
		<link>http://johannesbrodwall.com/2009/10/14/staggering-toward-the-project-goa/</link>
		<comments>http://johannesbrodwall.com/2009/10/14/staggering-toward-the-project-goa/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 20:38:39 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[Agile Release Patterns]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=458</guid>
		<description><![CDATA[<em>I'm working on a <a href="http://wiki.cantara.no/display/ARS/Agile+Release+Strategies+Home">collection of patterns for early releases</a> with Niklas Bjørnerstedt. Here are some of my thoughts based on this work.</em>

In a few different projects, I've noticed that the idea of "where are we going" seems to go though a familiar pattern:

<ol>
  <li>"The old system is the requirement document, just make the new one do the same things". After a while, someone will realize that it's rather pointless to replace a system with a new one that does the same thing, which leads to...</li>
  <li>"Analyze the business processes and make the new system automate all decisions that a human used to make." After a while, people start realizing that business rules are interpreted slightly different by different users and finding a consensus approach is hard. Besides, some of the decisions require human judgment. On top of this, progress towards implementing the business processes is much slower than expected. As a matter of fact, people are panicking as the project gets increasingly delayed, which leads to...</li>
  <li>"Just do whatever the old system did, with whatever improvements are dead easy. Just get this damned thing out the door." Even reducing the scope to just the "bare bones of the current system with minimal improvements" doesn't seem to give sufficient progress. Or sufficient value to justify the project. So, finally, we arrive at...</li>
  <li>"Can we just add a new piece of software that makes an existing business process easier. And repeat until the budget is spent."</li>
</ol>

The sad conclusion is that the original goal of replacing the old system begins to appear further into the future. At the same time, the new system will realize some value to some stakeholder pretty soon thereafter. Maybe the first step towards a successful replacement project is giving up replacing the old system?

The good news is that with an iterative approach to the requirement process, my current project was able to go through all these steps in a couple of months. Which beats my previous record of a year of full burn rate in stage 1.]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;m working on a <a href="http://wiki.cantara.no/display/ARS/Agile+Release+Strategies+Home">collection of patterns for early releases</a> with Niklas Bjørnerstedt. Here are some of my thoughts based on this work.</em></p>
<p>In a few different projects, I&#8217;ve noticed that the idea of &#8220;where are we going&#8221; seems to go though a familiar pattern:</p>
<ol>
<li>&#8220;The old system is the requirement document, just make the new one do the same things&#8221;. After a while, someone will realize that it&#8217;s rather pointless to replace a system with a new one that does the same thing, which leads to&#8230;</li>
<li>&#8220;Analyze the business processes and make the new system automate all decisions that a human used to make.&#8221; After a while, people start realizing that business rules are interpreted slightly different by different users and finding a consensus approach is hard. Besides, some of the decisions require human judgment. On top of this, progress towards implementing the business processes is much slower than expected. As a matter of fact, people are panicking as the project gets increasingly delayed, which leads to&#8230;</li>
<li>&#8220;Just do whatever the old system did, with whatever improvements are dead easy. Just get this damned thing out the door.&#8221; Even reducing the scope to just the &#8220;bare bones of the current system with minimal improvements&#8221; doesn&#8217;t seem to give sufficient progress. Or sufficient value to justify the project. So, finally, we arrive at&#8230;</li>
<li>&#8220;Can we just add a new piece of software that makes an existing business process easier. And repeat until the budget is spent.&#8221;</li>
</ol>
<p>The sad conclusion is that the original goal of replacing the old system begins to appear further into the future. At the same time, the new system will realize some value to some stakeholder pretty soon thereafter. Maybe the first step towards a successful replacement project is giving up replacing the old system?</p>
<p>The good news is that with an iterative approach to the requirement process, my current project was able to go through all these steps in a couple of months. Which beats my previous record of a year of full burn rate in stage 1.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/10/14/staggering-toward-the-project-goa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lær Scrum på 3 minutter</title>
		<link>http://johannesbrodwall.com/2009/09/07/l%c3%a6r-scrum-pa-3-minutter/</link>
		<comments>http://johannesbrodwall.com/2009/09/07/l%c3%a6r-scrum-pa-3-minutter/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 20:31:05 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[Extreme Programming]]></category>
		<category><![CDATA[Non-technical]]></category>
		<category><![CDATA[Norsk]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=453</guid>
		<description><![CDATA[<blockquote><em>This Norwegian language article introduces a short two-page guide I've written to explain Scrum to people who've only just heard of it.</em></blockquote>

I samarbeid med våre dyktige redaksjonelle medarbeidere på Steria, har jeg forfattet en "3 minutters guide" til Scrum. Denne tar for seg spørsmålene som "hva er egentlig Scrum".

[caption id="" align="alignnone" width="360" caption="Dette er Scrum"]<a href="http://steria.no/gloria/id/11004571/subid/0"><img alt="Hva er egentlig Scrum" src="http://steria.no/image/4954/1/4954_1.jpg" title="Hva er egentlig Scrum" width="360" height="152" /></a>[/caption]
  
3-minutterguidene kan lastes ned fra <a href="http://steria.no/gloria/id/11004571/subid/0">Sterias hjemmesider</a>.
  
Jeg planlegger å følge opp denne guiden med en guide som beskriver hva som skal til for å faktisk lykkes med Scrum. Har du noen ideer?]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>This Norwegian language article introduces a short two-page guide I&#8217;ve written to explain Scrum to people who&#8217;ve only just heard of it.</em></p></blockquote>
<p>I samarbeid med våre dyktige redaksjonelle medarbeidere på Steria, har jeg forfattet en &#8220;3 minutters guide&#8221; til Scrum. Denne tar for seg spørsmålene som &#8220;hva er egentlig Scrum&#8221;.</p>
<div class="wp-caption alignnone" style="width: 370px"><a href="http://steria.no/gloria/id/11004571/subid/0"><img alt="Hva er egentlig Scrum" src="http://steria.no/image/4954/1/4954_1.jpg" title="Hva er egentlig Scrum" width="360" height="152" /></a><p class="wp-caption-text">Dette er Scrum</p></div>
<p>3-minutterguidene kan lastes ned fra <a href="http://steria.no/gloria/id/11004571/subid/0">Sterias hjemmesider</a>.</p>
<p>Jeg planlegger å følge opp denne guiden med en guide som beskriver hva som skal til for å faktisk lykkes med Scrum. Har du noen ideer?</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/09/07/l%c3%a6r-scrum-pa-3-minutter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>En lynrask innføring i Scrum</title>
		<link>http://johannesbrodwall.com/2009/07/30/en-lynrask-innf%c3%b8ring-i-scrum/</link>
		<comments>http://johannesbrodwall.com/2009/07/30/en-lynrask-innf%c3%b8ring-i-scrum/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 09:33:09 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[Non-technical]]></category>
		<category><![CDATA[Norsk]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://johannesbrodwall.com/?p=411</guid>
		<description><![CDATA[<blockquote>This Norwegian language post talks a little about a quick intro to Scrum that I wrote for my employer</blockquote>

Jeg har forfattet en "3-minutters guide" til Scrum. Dette er en to siders lettlest artikkel som publiserer via min arbeidsgiver Steria. Denne har som mål å være tilgjengelig både for tekniske og ikke-tekniske prosjektdeltagere som gjerne vil forstå litt mer om hva Scrum dreier seg om.

Du finner artikkelen på <a href="http://steria.no/gloria/id/11004571/subid/0">Sterias arkiv over 3-minuttersguider</a>. Du kan <a href="mailto:johannes@brodwall.com">ta kontakt</a> dersom du ønsker et eller flere eksemplarer av guiden trykket på solid papir.

Jeg regner med å lage flere iterasjoner av denne guiden, så tips om forbedringer mottas med takk.]]></description>
			<content:encoded><![CDATA[<blockquote><p>This Norwegian language post talks a little about a quick intro to Scrum that I wrote for my employer</p></blockquote>
<p>Jeg har forfattet en &#8220;3-minutters guide&#8221; til Scrum. Dette er en to siders lettlest artikkel som publiserer via min arbeidsgiver Steria. Denne har som mål å være tilgjengelig både for tekniske og ikke-tekniske prosjektdeltagere som gjerne vil forstå litt mer om hva Scrum dreier seg om.</p>
<p>Du finner artikkelen på <a href="http://steria.no/gloria/id/11004571/subid/0">Sterias arkiv over 3-minuttersguider</a>. Du kan <a href="mailto:johannes@brodwall.com">ta kontakt</a> dersom du ønsker et eller flere eksemplarer av guiden trykket på solid papir.</p>
<p>Jeg regner med å lage flere iterasjoner av denne guiden, så tips om forbedringer mottas med takk.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/07/30/en-lynrask-innf%c3%b8ring-i-scrum/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Guidelines for eGovernment Projects</title>
		<link>http://johannesbrodwall.com/2009/06/04/guidelines-for-egovernment-projects/</link>
		<comments>http://johannesbrodwall.com/2009/06/04/guidelines-for-egovernment-projects/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 16:09:33 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[Communities]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=363</guid>
		<description><![CDATA[The Agency for Public Management and eGovernment in Norway is currently developing guidelines for IT-projects within the Norwegian governmental sector. The Norwegian Computing Association hosted a presentation and discussion about this work yesterday. I was privileged enough to summarize the comments from one of the three discussion groups at the meeting. For the enjoyment of [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>The <a href="http://www.difi.no/hovedEnkel.aspx?m=53850">Agency for Public Management and eGovernment</a> in Norway is currently developing guidelines for IT-projects within the Norwegian governmental sector. The Norwegian Computing Association hosted a <a href="http://dataforeningen.no/-mwRfGWB.ips">presentation and discussion</a> about this work yesterday. I was privileged enough to summarize the comments from one of the three discussion groups at the meeting. For the enjoyment of the internet, I hereby provide a few ideas on eGovernment projects.</em></p></blockquote>
<h3>Value first</h3>
<p>The speaker from The Norwegian Government Agency for Financial Management (SSØ) pointed out that many projects are not sufficiently concerned with satisfying real objectives. Such a project may be a technical success, but still not worth doing.</p>
<p>Guidelines for eGovernment projects must first and foremost focus on the value delivered by the project.</p>
<p>Beyond the remarks of SSØ, we believe it is important that this value is delivered <em>incrementally</em>. Too often, the idea is that a project represents a substantial investment that hopefully fulfills some objectives. If a project delays long before it proves its promise, the business case may prove to be a mirage.</p>
<p>The business case has to be concrete and verifiable. For example, if a project claims to be able to eliminate 100 full-time positions, plans to actually terminate these positions should be within the project scope.</p>
<p>When should a project be terminated? Too often, projects are terminated too late. Guidelines for eGovernment projects should provide guidance to allow a project to terminate when it has realized only some of its promise, if there are better uses for future investments. And without incremental deliveries, there is no way of doing this without losing the whole investment.</p>
<h3>Focus on experience</h3>
<p>If the effort of the Norwegian eGovernment guidelines only result in a static document, it fails. Instead, we need an ongoing <em>conversation</em> where projects can share experience and recommendations.</p>
<p>There is much experience from existing eGovernment projects that can be utilized. Some examples from the discussions:</p>
<ul>
<li>During a project start there are some activities that are useful and many that are just a waste of time. Even so, experience about what common activities that provide no value is not widely shared.</li>
<li>Some of the discussion participants have much insight into how to terminate projects ahead of plan. This experience can be critical to avoid throwing good money after bad. And to avoid throwing bad money after good.</li>
<li>There are a few competing contract standards that are frequently used in eGovernment projects. Often the specific choice of contract is more a matter of personal choice than experience.</li>
</ul>
<h3>The scope and impact of recommendations</h3>
<p>Many of my discussion partners were curious about the level of ambition regarding the official guidelines for eGovernment projects.</p>
<p>The overall goal of these standards is to create value in eGovernment projects. However, that goal is much too value to be a sufficient vision for the work ahead. It is especially important that the goals of the standard are Specific and Measurable if the end result is to be valuable.</p>
<p>During the discussion, it was also unclear what the scope of the recommendations would be. Early work on the standard could benefit from a table-of-contents that articulates what areas the standards will concern themselves with.</p>
<h3>Is &#8220;project&#8221; the right word?</h3>
<p>From the discussion, I draw my own conclusion:</p>
<p>To create effective eGovernment, it&#8217;s insufficient to look at projects in isolation. Instead, the various agencies must concern themselves with the full value proposition of their whole IT- and operational systems. Creating value in the context of a project can be a distraction from the everyday operational concerns of the organization. And the key to the value that can be created is in these everyday concerns.</p>
<p>A project runs the danger of becoming detached from the organization that it is created to serve and that will eventually bear the maintenance cost of the project deliveries. The number one concern should be to close this gap.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/06/04/guidelines-for-egovernment-projects/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PodCast: Linda Rising</title>
		<link>http://johannesbrodwall.com/2009/05/25/podcast-linda-rising/</link>
		<comments>http://johannesbrodwall.com/2009/05/25/podcast-linda-rising/#comments</comments>
		<pubDate>Mon, 25 May 2009 19:16:57 +0000</pubDate>
		<dc:creator>Johannes Brodwall</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=360</guid>
		<description><![CDATA[In this third podcast in the Oslo Developer Conversation series, I talk with Linda Rising about fearless change. We discuss the how to inspire an organization to change and touch on how developers are, at the end of the day, just another mammal.
See the (English language) podcast at ProgramUtvikling&#8217;s site.
]]></description>
			<content:encoded><![CDATA[<p>In this third podcast in the Oslo Developer Conversation series, I talk with Linda Rising about fearless change. We discuss the how to inspire an organization to change and touch on how developers are, at the end of the day, just another mammal.</p>
<p>See the (English language) podcast at <a href="http://www.programutvikling.no/podkast/">ProgramUtvikling&#8217;s</a> site.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannesbrodwall.com/2009/05/25/podcast-linda-rising/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
