<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xebia Blog</title>
	<atom:link href="http://blog.xebia.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com</link>
	<description></description>
	<lastBuildDate>Fri, 17 May 2013 01:35:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Google IO 2013: Day 2</title>
		<link>http://blog.xebia.com/2013/05/17/google-io-2013-day-2/</link>
		<comments>http://blog.xebia.com/2013/05/17/google-io-2013-day-2/#comments</comments>
		<pubDate>Fri, 17 May 2013 01:32:37 +0000</pubDate>
		<dc:creator>Misja Alma</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=11047</guid>
		<description><![CDATA[Quite a few interesting sessions today: Google Knowledge Graph With the Knowledge Graph, Google is trying to give a new dimension to its flagship product: Search. Users should be able to have a conversation with search, and search should anticipate on a user&#8217;s interests by showing related topics. So search needs to understand the context]]></description>
				<content:encoded><![CDATA[<p>Quite a few interesting sessions today:</p>
<p><strong>Google Knowledge Graph</strong></p>
<p>With the <a href="http://www.google.com/insidesearch/features/search/knowledge.html">Knowledge Graph</a>, Google is trying to give a new dimension to its flagship product: Search.<br />
Users should be able to have a conversation with search, and search should anticipate on a user&#8217;s interests by showing related topics.<br />
So search needs to understand the context of searches, in other words: it needs to understand the world. This is where Knowledge Tree comes in handy.<br />
Knowledge Tree is a hugh graph with semantic data about real world entities and their relations. This data has been gathered from Wikipedia, Google+ and many other sources.<br />
The complete tree is viewable and downloadable at <a href="http://www.freebase.com/">freebase.com</a>.<br />
<span id="more-11047"></span><br />
<strong>Freebase Api</strong></p>
<p>If you don&#8217;t feel like writing your query logic by yourslef, Google also offers a (free) Rest api:<br />
<a href="https://developers.google.com/freebase/">Freebase Api</a><br />
The following services are offered, many of them have their own JQuery plugin as well: </p>
<ul>
<li>autocomplete</li>
<li>semantic tagging</li>
<li>entity collections</li>
<li>geosearch collections</li>
<li>topical weblinks</li>
</ul>
<p><strong>Dart: new features</strong></p>
<p>The <a href="http://www.dartlang.org/">Dart</a> programming language has been around a few years already. It is Google&#8217;s scalable and typesafe alternative for Javascript. It can run in its own VM, in a special version of Chrome, or it can be compiled into Javascript.</p>
<p>During the last year quite a couple of new features have been added. Here are some highlights:</p>
<p><a href="http://www.dartlang.org/articles/mixins/">Mixins</a><br />
<a href="http://phylotic.blogspot.com/2012/11/dart-metadata-is-your-friend.html">Metadata</a><br />
<a href="http://blog.sethladd.com/2013/04/lazy-load-libraries-in-dart.html">Lazy loading of libraries</a><br />
<a href="http://blog.sethladd.com/2012/03/using-futures-in-dart-for-better-async.html">Futures</a><br />
<a href="http://blog.dartwatch.com/2013/03/getting-your-feet-wet-with-streams.html">streams</a></p>
<p>Also nice: you can try out Dart in realtime on try.dartlang.org</p>
<p>Dart&#8217;s performance has been enhanced: native Dart now runs many times faster than Javascript, thanks to, amongst others, utilization of SimD instructions by the Dart VM.</p>
<p><strong>&#8220;Chrome DevTools Revolution&#8221;</strong></p>
<p>The DevTools in <a href="https://www.google.com/intl/nl/chrome/browser/canary.html">Chrome Canary</a> have been updated with quite a few cool features. It should even be possible now to use Chrome DevTools as your only IDE: inline editing of Javascript and styling was already possible, but now it is also possible to save the edited code to disk (using Ctrl-S).</p>
<p>If you are using an IDE and have edited a source file, Chrome can now detect file system changes and refresh automatically.</p>
<p>Sass support has been added to Chrome DevTools. So you can trace a styling all the way to the Sass reference that defines it, inside Chrome Devtools.<br />
And also here it is possible to automatically reload the page when a sass file has been changed.</p>
<p>A lot of support was added for profiling Javascript:</p>
<ul>
<li>Timeline: a view to quickly see which method takes the most cpu cycles</li>
<li>FlameChart: a view with the same purpose but a different layout</li>
<li>Canvast profiling: a view showing which paint actions take the most time</li>
<li>Object allocation tracking: a memory profiler for javascript</li>
<li>Layout trashing details: a tool that can show inefficiencies or redundant Dom tree building</li>
<li>and <a href="http://www.html5rocks.com/en/mobile/profiling/#toc-managingperformance">more</a> ..</li>
</ul>
<p><strong>Portable Native Client</strong></p>
<p>This is Google&#8217;s solution to let you run C++ code inside your browser. Actually that was already possible with <a href="https://developers.google.com/native-client/">Native Client</a>, but Portable Native Client makes it easier to create C++ apps that will run on both Arm and x86 architectures.</p>
<p>Obviously Google needed to do a lot to prevent this from being a security risk. So the C++ code needs to be compiled with a custom compiler, which will create a .pexe file; this file runs inside a &#8216;native client process&#8217; with &#8216;software fault isolation&#8217;. What this means is that Chrome will scan the code before running it, to check for illegal instructions and for illegal access of certain memory regions.<br />
Apart from that, native client code can only be used in applications inside Chrome Webstore.<br />
This all should make Native Clients safe to use.</p>
<p>The advantage of Native Clients is obviously their performance: they run at 80% or 90% of the speed of a fully native application.</p>
<p>But the question is of course: why go through so much trouble, why not just download a fully native application to your cellphone or laptop?<br />
I guess the answer is that such a thing is not possible on Chromebooks. Google is trying hard to make Chrome the universal platform to run all your applications. And with Native Client, you can now get enough performance to run games as well. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/05/17/google-io-2013-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google IO 2013: some highlights from day 1</title>
		<link>http://blog.xebia.com/2013/05/16/google-io-2013-some-highlights-from-day-1/</link>
		<comments>http://blog.xebia.com/2013/05/16/google-io-2013-some-highlights-from-day-1/#comments</comments>
		<pubDate>Thu, 16 May 2013 00:34:12 +0000</pubDate>
		<dc:creator>Misja Alma</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=11037</guid>
		<description><![CDATA[Today was the first day of the Google IO conference in San Francisco. I was lucky enough to be able to attend so I can share some (personal) highlights of the day. In the keynote Google showed some of their latest developments: It is now possible to upload a batch of pictures to your online]]></description>
				<content:encoded><![CDATA[<p>Today was the first day of the Google IO conference in San Francisco. I was lucky enough to be able to attend so I can share some (personal) highlights of the day.</p>
<p>In the keynote Google showed some of their latest developments:<br />
It is now possible to upload a batch of pictures to your online storage and let Google decide which are the best ones to keep. For instance when you&#8217;ve been on holiday and have taken 600 pictures, too many to show to anybody, Google can propose a selection after doing some intelligent analysis:<br />
It can filter pictures if they are dupicates or if they are unclear. But it also recognizes if pictures contain some of your (Google+) relations, which would make them more interesting. Even more cool: with the help of some machine learning and a lot of training, Google can now estimate if a picture is pretty or not.<br />
Another cool feature: Google will recognize if you have multiple pictures of the same person in the same scene. Based on some intrapolation algorithm, it can generate new pictures in that scene. Some examples were shown and they were actually really good.<span id="more-11037"></span></p>
<p>Voice recognition was added Chrome (desktop and Chromebook only) so you can give spoken commands to let it do searches. Not really new, but what makes it special is that integration was added with Google Knowledge Tree, a giant graph database which contains semantic relations between entities.<br />
What this means is that Chrome might understand what you mean when you say something like: &#8220;Send Misja an e-mail with the shortest route from here to Amsterdam&#8221;. This does require that Misja is one of your Google+ contacts. Chrome will infer that &#8216;here&#8217; refers to your current location.</p>
<p>And there were many more announcements. You can see the full keynote speech <a title="here" href="http://www.youtube.com/watch?v=9pmPa_KxsAM">here</a>.</p>
<p>In the afternoon there was a choice of about 60 different presentations. Obviously too many to watch or to describe. Here are a few brief highlights:</p>
<p>Google has added App Script support to Google Forms.<br />
App Script support was already present in Gmail and Google Sheets and it enables you to write macro&#8217;s or other logic in Javascript. The Javascript can access and manipulate the document you are working on, it can use all Google Api&#8217;s and connect to databases.<br />
Now it can also be used in Google Forms. Quite useful if you want to add form validation for instance.<br />
You can try it out <a title="here" href="developers.google.com/apps-script">here</a></p>
<p>Google Compute Engine, Google&#8217;s cloud service, has gotten some useful pricing options for small businesses. The cheapest one can host your application already for less than 2 cents per hour. There&#8217;s not much use for buying your own server anymore if cloud computing becomes so cheap ..</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/05/16/google-io-2013-some-highlights-from-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting Deployit, Part 2</title>
		<link>http://blog.xebia.com/2013/05/14/scripting-deployit-part-2/</link>
		<comments>http://blog.xebia.com/2013/05/14/scripting-deployit-part-2/#comments</comments>
		<pubDate>Tue, 14 May 2013 19:28:14 +0000</pubDate>
		<dc:creator>Jan Vermeir</dc:creator>
				<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Deployit]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=11032</guid>
		<description><![CDATA[Like all software, Deployit plugins should be build automatically, deployed and tested whenever possible. Below I will explain how to setup continuous integration and testing for Deployit plugins. The general idea is that if you’re creating a larger set of plugins for Deployit, it makes sense to try to build and deploy them as often]]></description>
				<content:encoded><![CDATA[<p>Like all software, Deployit plugins should be build automatically, deployed and tested whenever possible. Below I will explain how to setup continuous integration and testing for Deployit plugins. The general idea is that if you’re creating a larger set of plugins for Deployit, it makes sense to try to build and deploy them as often as possible so you can catch errors early. We found that it is really easy to create plugins that work fine in isolation but fail when they are deployed together. Luckily it is also easy to catch these kinds of errors as I will show below.<br />
<span id="more-11032"></span><br />
This work is part of a larger effort to describe and explain Deployit. I’ve written a previous blog you can find here: <a href="http://blog.xebia.com/2013/03/24/scripting-deployit/" title="scripting-deployit">http://blog.xebia.com/2013/03/24/scripting-deployit/</a>.<br />
Code for the examples and plugins can be found on GitHub:<br />
<code>git clone git://github.com/jvermeir/DeployitBlogs.git<br />
cd DeployitBlogs<br />
git checkout ec6b748.<br />
</code><br />
I’ve borrowed heavily from work I did with my colleague Joris de Winne. </p>
<p>I will use a couple of plugins that define a new host type. They serve only to show how the build and test process works so please ignore their contents. In the source tree you can find them in the ‘citest/test’ directory. Each plugin comes with a buildAndCopy.sh script that does no more than copy a jar file to the plugins directory so it can be picked up by Deployit. </p>
<p>To run the examples you’ll need a shell and change to the directory named ‘citest’ in ‘DeployitBlogs’, the root of a project on GitHub I’ve described in a previous post.</p>
<p>The build and deploy script is started by typing</p>
<p><code>./basicDeployitStartupTest.sh p1<br />
</code><br />
which will do a clean install of Deployit, copy the plugin named p1 and finally start Deployit to find out if it still works. The script will log messages about the steps it takes, i.e.:</p>
<p><code>findAndTerminateDeployitProces<br />
installDeployit<br />
copyPluginsFromDistribution<br />
buildAndCopyPlugins<br />
validate<br />
</code><br />
The first step is to find and terminate a Deployit process that may already be running on the test server. This is done by looking for a Java process that runs Deployits main class com.xebialabs.deployit.DeployitBootstrapper, and then terminating this process. This may fail of course, meaning you’ll get errors later on. </p>
<p>Next, installDeployit() removes a previous version and unzips the Deployit server archive. The archive I’ve used is not the standard distribution but a version that was created from an existing install. Deployit needs a couple of answers when it starts for the first time, so all I did was run the installer, answer the questions, stop Deployit and zip the full directory into a new installer file that is unzipped by the installDeployit() method. So for this step to work you’ll have to do the same and store the results in $ROOTDIR/resources/deployit-$DEPLOYIT_VERSION-server-setup.zip. Refer to the script to find out where the shell variables should point to. </p>
<p>The third step, copyPluginsFromDistribution(), copies all default plugins from the available-plugins directory to the plugins directory so we can use all of Deployits features. You can change this if you don’t need all plugins for your use case. The third line in this method uses Linux find to copy even more plugins that are neither part of the standard distribution nor of your project. An example could be the weblogic plugin. These plugins should be copied in the lib directory under citest.</p>
<p>The fourth step, buildAndCopyPlugins(), builds a list of plugins you want to test and copies them to the plugins directory. The function takes a list of plugin names separated by a blank in a variable called $PLUGIN_NAMES.  It then loops over this list and calls a script named buildAndCopy.sh that should reside in the root directory of each plugin. The sample plugins in test/success show how this works. In the real world you might start a Jenkins build, copy an artifact from a repository or call Maven.<br />
The only requirement is that a build should log to the console and print a line with the text ‘BUILD FAILURE’ if something goes wrong. </p>
<p>Finally validate() tries to start Deployit and waits for the message &#8220;You can now point your browser to&#8221; to appear in the console log. The method checks every 5 seconds for a minute and reports the result. </p>
<p>To experiment you can use the two sets of plugins provided in the test/success and test/failure directories.<br />
<code>./basicDeployitStartupTest.sh p1<br />
</code> deploys a single plugin named p1 from test/success. This test should report success.<br />
<code>./basicDeployitStartupTest.sh -p test/failure p1 p2<br />
</code> should report failure because it tries to deploy the same plugin twice. This takes a while because the test keeps looking for a success message but an error is logged in stead. There&#8217;s some room for improvement here, I guess.</p>
<p>We’ve successfully used a predecessor of this script to keep a grip on a project with a large set of plugins defining many custom types. We ran the script as a Jenkins job triggered by a commit on Subversion. In our setting it proved a useful tool to catch type definition errors early on. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/05/14/scripting-deployit-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing a SOA-based Integration Layer Framework: Features</title>
		<link>http://blog.xebia.com/2013/04/21/developing-a-soa-based-integration-layer-framework-features/</link>
		<comments>http://blog.xebia.com/2013/04/21/developing-a-soa-based-integration-layer-framework-features/#comments</comments>
		<pubDate>Sun, 21 Apr 2013 21:12:06 +0000</pubDate>
		<dc:creator>Marco Fränkel</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10982</guid>
		<description><![CDATA[A few years ago I was asked by one of our customers to help them make better use of their integration layer. Ever since then me and my team have been working on a framework in support of that. This is the fourth in a series of blogs on the development of our framework, and]]></description>
				<content:encoded><![CDATA[<p><em>A few years ago I was asked by one of our customers to help them make better use of their integration layer. Ever since then me and my team have been working on a framework in support of that. This is the fourth in a series of blogs on the development of our framework, and discusses the features it provides. The one that was announced last time, about building blocks, is momentarily postponed.</em></p>
<p>So far I&#8217;ve discussed the <a title="Developing a SOA-based integration layer framework: goals" href="http://blog.xebia.com/2012/10/18/developing-a-soa-based-integration-layer-framework-goals/">goals</a> &amp; <a title="Developing a SOA-based integration layer framework: challenges" href="http://blog.xebia.com/2012/12/19/developing-a-soa-based-integration-layer-framework-challenges/">challenges</a> surrounding the development activities, but I&#8217;d like to focus more on the framework itself now, and what it brings to those that are using it.</p>
<p>As soon as a new party (be it service consumer or service provider) connects to our framework, it can profit directly from the wealth of functionality we deliver out-of-the-box. These ‘generic features’ are exactly what one would expect from a (logical) ESB, and are partly based on the <a title="Expanded Enterprise Service Bus Pattern" href="http://soapatterns.org/compound_patterns/enterprise_service_bus">Expanded Enterprise Service Bus Pattern</a>.</p>
<p><a href="http://blog.xebia.com/wp-content/uploads/2013/04/esb.png"><img alt="esb" src="http://blog.xebia.com/wp-content/uploads/2013/04/esb.png" width="482" height="350" /></a></p>
<p><span id="more-10982"></span></p>
<p>As our project was scrum driven, features were developed only when they were needed. Sometimes, during the design &amp; build phase, we discovered a better way of doing things, and sometimes the problem a feature was supposed to address was solved in a completely different way, outside of our scope. But in the end we managed to implement about 20 features, which can roughly be divided into five types: routing, robustness, security, transformation and data storage.</p>
<h3>Routing</h3>
<p>One of our main objectives is to get messages from A to B without A having to know where B is currently residing. To do this, we make extensive use of the WS-Addressing standard. One of the components in our framework, the routing service, uses the information in the message headers to decide what the next hop will be (hop in this case being another framework component). Most of the times a message is delivered to the backside as soon as it enters the integration layer, something we call <b>simple routing</b>.<em> </em></p>
<p>However, as soon as some special activity needs to be performed (like data model transformation for example), the message is detoured to one of the framework components not connected to the outside world. We classify those as <em>intermediate services</em>, and they are agnostic of nature – which means they have no clue about the context in which they are called. The necessary information for the message to continue its path is part of the addressing headers as well, making this <b>advanced routing</b>.</p>
<p><em></em>A special kind of advanced routing is <b>distribution, </b>which makes it possible to send one message to several subscribers at the same time, using WS-Notification in its most basic form. Finally <b>prioritized routing </b>is a feature which makes sure that a message gets ahead of the rest so to speak – very useful when dealing with a customer waiting for service at a counter while there’s also a bulk load being processed.</p>
<h3>Robustness</h3>
<p>Of course it’s of eminent importance that nothing goes wrong when delivering the message, or that when it does we can at least deal with the situation (<b>exception management</b>). First thing that happens when we receive a message is that we check to see if it complies with the industry &amp; design standards we enforce (<b>technical validation</b>). Sometimes the consumer/publisher doesn’t want to wait for the (functional) answer but still wants to be informed if his message was technically valid, in which case we send him a response stating just that (<b>technical acceptance</b>).</p>
<p>Two of our features deal with peak load: <b>throttling </b>makes sure the integration layer only takes in what it can handle, while <b>buffering </b>guarantees we don’t overwhelm the applications we connect to. Similar to the second one is <b>postponed delivery </b>which is used when we know beforehand the backside is not available.</p>
<p>But by far the most important of these types of feature is <b>guaranteed delivery</b>. We played around with a bidirectional variant (using WS-RM) but finally settled on an unidirectional implementation, meaning that before we send the message we first store it, and if we receive an HTTP error code we send it again.</p>
<p>Last (and actually least, as it’s hardly used) it’s also possible to have <b>syntactic validation of outgoing messages</b>. But as we like to follow Postel’s law (also known as the robustness principle) we feel it’s the consumer’s responsibility to make sure the message was valid to begin with (you can imagine this took some selling from our part). The only exception is when the payload is altered by the framework.</p>
<h3>Security</h3>
<p>Every application that wants to connect to the integration layer needs to make itself known using the WS-Security UsernameToken (<b>authentication</b>). For most of the services we expose that’s enough, in a few rare cases such an application has to have explicit permission (<b>authorization</b>).</p>
<p>Not used internally (only when we receive requests from certain external customers) is <b>integrity</b>, where we demand that certain parts of the message headers and payload are signed.</p>
<h3>Transformation</h3>
<p>Given the fact that not all applications connected to the framework ‘speak the same language’ (as mentioned in the previous blog), there’s an evident need for <b>data model transformation</b> &#8211; one of our most used features. A lot less popular is the <b>split </b>feature, which makes it possible to divide a big message into smaller parts.<em> </em></p>
<h3>Data storage</h3>
<p>The last few features play a more supportive role to the ones already mentioned. We provide <b>logging </b>to be used during testing &amp; bug-finding sessions and <b>persistence </b>when there’s a need to store the complete message. The latter is frequently used in combination with <b>resending </b>(which is necessary for the guaranteed delivery feature described above), but also in case of auditing requirements.</p>
<h2>Conclusion</h2>
<p>Most of these features have been around since the first version of our framework, and have proven their generic qualities over time. In a few cases we had to make some alterations and even now there are one or two features which we might implement differently in the future. There’s also a list of additional features but it’s rather short<strong></strong>, which I take as a sign that what we have here is pretty complete.</p>
<p>That’s number four; next time I’ll talk a bit about the more specific deliverables we provide our project teams.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/04/21/developing-a-soa-based-integration-layer-framework-features/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Toyota Kata by Mike Rother</title>
		<link>http://blog.xebia.com/2013/04/10/toyota-kata-by-mike-rother/</link>
		<comments>http://blog.xebia.com/2013/04/10/toyota-kata-by-mike-rother/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 10:37:46 +0000</pubDate>
		<dc:creator>Laurens Bonnema</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[kanban]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10978</guid>
		<description><![CDATA[Two days ago, I read the book Toyota Kata by Mike Rother. Like most management books, the central message is hammered home by repetition. Some people, like me, may find that a bit annoying. That does not make this book any less a must read though. If you&#8217;re interested in making Lean/Agile really work in]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/8253450@N03/8636357831" title="View 'Toyota Kata by Mike Rother' on Flickr.com"><img height="318" style="display:block; margin-left:auto; margin-right:auto;" border="0" src="http://farm9.staticflickr.com/8264/8636357831_33d6fd7bd2.jpg" alt="Toyota Kata by Mike Rother" width="500" title="Toyota Kata by Mike Rother"/></a>Two days ago, I read the book <a href="http://www.amazon.com/Toyota-Kata-Improvement-Adaptiveness-ebook/dp/B002NPC0Q2/ref=tmm_kin_title_0">Toyota Kata</a> by <a href="http://en.wikipedia.org/wiki/Mike_Rother">Mike Rother</a>. Like most management books, the central message is hammered home by repetition. Some people, like me, may find that a bit annoying. That does not make this book any less a must read though. If you&#8217;re interested in making Lean/Agile really work in your organization without running the risk of organizational gravity eroding all your hard efforts over time, this book has the answer on how to do that. I&#8217;ll be incorporating the concepts of the Toyota Kata in my consulting from now on. Empower yourself. Read this book now! Or at least check out my summary of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/04/10/toyota-kata-by-mike-rother/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting Deployit</title>
		<link>http://blog.xebia.com/2013/03/24/scripting-deployit/</link>
		<comments>http://blog.xebia.com/2013/03/24/scripting-deployit/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 19:11:42 +0000</pubDate>
		<dc:creator>Jan Vermeir</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Middleware]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10857</guid>
		<description><![CDATA[All I wanted to do was create a number of plugins and examples for Deployit using the different techniques available. While working on examples I was frustrated by having to clean up remainders of previous attempts, so following in the footsteps of greater men than my humble self (most notably professor Knuth who created TeX]]></description>
				<content:encoded><![CDATA[<p>All I wanted to do was create a number of plugins and examples for Deployit using the different techniques available. While working on examples I was frustrated by having to clean up remainders of previous attempts, so following in the footsteps of greater men than my humble self (most notably professor Knuth who created TeX so he could finish writing a series of books on computer science) I first wrote a script to create junk in the Deployit repository and then get rid of it in one sweeping go.<br />
<span id="more-10884"></span><br />
I’ve placed my code on Github (git clone git://github.com/jvermeir/DeployitBlogs.git).<br />
To try out the examples you’ll need Deployit 3.8.4 (the version I used, but I’m quite sure it’ll work fine with other versions as well). I’ve installed the server and cli in a directory referenced by an environment variable $DEPLOYIT_HOME. I’m using *nix style variable and scripts in my examples. If you insist on using Microsoft you can always download Cygwin or change the examples yourself. After checking out the sources and installing Deployit, $DEPLOYIT_HOME should contain the following folders:<br />
<code>deployit-3.8.4-server<br />
deployit-3.8.4-cli<br />
DeployitBlogs<br />
</code><br />
DeployitBlogs contains a directory named tools that for now holds no more than a couple of scripts, most notably three scripts named utils.py, cleanup.cli and deploy.cli. In src/test you’ll find a dar file I’m using to try out my scripts and plugins (deps.dar was build from another example I hope to explain later, for now it’s not important; all it does is copy some files and print a message to the console).<br />
Utils.py isn’t really a script but a plugin. It is supposed to be placed in $DEPLOYIT_HOME/cli/ext, but that can become rather tedious very quickly if you’re going through lots of versions, so I left the script in the tools directory and created a symbolic link to it so the cli will pick up new versions when it is restarted. Create a link in $DEPLOYIT_HOME/cli/ext:<br />
<code>cd $DEPLOYIT_HOME/deployit-3.8.4-cli/ext<br />
ln -s $DEPLOYIT_HOME/DeployitBlogs/tools/utils.py utils.py<br />
</code></p>
<p>One more piece of setup is necessary: create two test environments that are required by the scripts in examples I hope to discuss later. Open the Deployit client interface and create two environments named ‘localenv’ and ‘AnotherLocalEnv’. They should contain a overthere.SshHost named ‘local’ and ‘AnotherLocalHost’ respectively. I defined both hosts with default settings and a username of ‘deployit’, but the username doesn’t (yet) matter for the examples. It should exist though, so in my case Deployit just connects to localhost as user &#8216;deployit&#8217; to run the scripts.</p>
<p>The scripts in cleanup.cli and deploy.cli are no more than convenience wrappers that make it easier to test new versions of the plugin. After some command line input checking all they do is call one of the functions defined in utils.py.<br />
cleanup.cli is used as follows:<br />
<code>$DEPLOYIT_HOME/deployit-3.8.4-cli/bin/cli.sh -username admin -password admin -f $DEPLOYIT_HOME/DeployitBlogs/tools/deploy.cli -- $DEPLOYIT_HOME/DeployitBlogs/tools/src/test/deps.dar localenv<br />
</code></p>
<p>The command above starts the cli, connects using default credentials, starts the script named in the -f parameter and passes the two parameters following the double dash to the script.</p>
<p>To avoid even more typing I created a shell script d.sh that does no more than run the command line above. It takes the environment name as a parameter like this:<br />
<code>d.sh localenv<br />
</code></p>
<p>To call the cleanup script use:<br />
<code>c.sh deps<br />
</code></p>
<p>With all these details out of the way we can discuss the utils.py script.<br />
utils.py is read by the cli when it is started. Each method in the script is available from the cli command line, but there are two main entry points:<br />
<code>def deployApp(fileName, environmentName):<br />
def deleteApp(appName):<br />
</code><br />
These are the methods that are called from deploy.cli and cleanup.cli respectively.</p>
<p>deployApp is nothing more than a straightforward deployment of an application from a dar file, like explained in the cli guide (climanual.html) you can find in the server/doc/html directory (open the file and search for ‘Performing deployments’).<br />
Before it deploys an app from a DAR archive, deployApp calls deleteApp to erase all traces of previously imported or installed versions from each environment.<br />
DeleteApp calls undeployApps (see picture below) to find all versions of the app and undeploys them so they can be subsequently deleted by the call to deleteVersions.<br />
deleteVersions works like undeployApps: get a list of stuff to delete, loop and delete each version using repository.delete().</p>
<div id="attachment_10860" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.xebia.com/wp-content/uploads/2013/03/code.png"><img src="http://blog.xebia.com/wp-content/uploads/2013/03/code-300x188.png" alt="Main methods of utils.py" width="300" height="188" class="size-medium wp-image-10860" /></a><p class="wp-caption-text"><em>Main methods of utils.py</em></p></div>
<p>If you&#8217;re interested in the details you can clone the repo at<br />
<code>git clone git://github.com/jvermeir/DeployitBlogs.git<br />
cd DeployitBlogs/<br />
git checkout 94ff4af<br />
</code><br />
The code for this blog is located in the &#8216;tools&#8217; directory. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/03/24/scripting-deployit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Small data: workflow, long transactions and DB2</title>
		<link>http://blog.xebia.com/2013/03/06/small-data-workflow-long-transactions-and-db2/</link>
		<comments>http://blog.xebia.com/2013/03/06/small-data-workflow-long-transactions-and-db2/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 10:24:34 +0000</pubDate>
		<dc:creator>Gerbrand van Dieijen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10713</guid>
		<description><![CDATA[With all the big-data postings, now something about traditional SQL, running at DB2 9. We had created a web-application, that was basically a view for a database. The application displayed content of a database after the user would enter search parameters, or everything when no parameter was entered. The database contained a few hundred-thousands records.]]></description>
				<content:encoded><![CDATA[<p>With all the big-data postings, now something about traditional SQL, running at <a href="http://www-01.ibm.com/software/data/db2/">DB2</a> 9. We had created a web-application, that was basically a view for a database. The application displayed content of a database after the user would enter search parameters, or everything when no parameter was entered. The database contained a few hundred-thousands records. <em>All in all very simple.</em><br />
The software worked fine at our test-environment. But when we deployed the software into production, it would hardly ever display data. In the logs we found frequent locking errors as follow:</p>
<p>15:23 ERROR (org.hibernate.engine.jdbc.spi.SqlExceptionHelper) &#8211; DB2 SQL Error: SQLCODE=-911, SQLSTATE=40001, SQLERRMC=68, DRIVER=4.1</p>
<p><a href="https://www.google.com/search?q=SQLSTATE%3D40001">Searching</a> the web revealed what <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.msg.doc%2Fdoc%2Fr0sttmsg.htm">that error meant</a>: a deadlock or timeout has occurred. We knew the same database was also accessed by another application, <a href="http://www.activiti.org/">Activiti</a> running processes written in <a href="http://en.wikipedia.org/wiki/BPMN">BPMN</a>. The processes in the Activiti-engine only inserted a few records per minute, so we didn&#8217;t expect that application having a big influence. Yet how can a few inserts per minute have such a big impact?<br />
After some talking to a DBA&#8217;er and doing our own experimentation we found out about the problem, which will describe here.</p>
<p><span id="more-10713"></span>As said the other application was an <a href="http://www.activiti.org/">Activiti</a> that executed processes (to be exact: process-definitions in <a href="http://www.activiti.org/faq.html#WhatIsBpmn20">BPMN</a>). At several steps in the process, Java code was executed by the Activiti&#8217;s <a href="http://www.activiti.org/javadocs/org/activiti/engine/delegate/JavaDelegate.html">delegate</a> mechanism. That java code would insert data into our database.</p>
<p><a href="http://blog.xebia.com/wp-content/uploads/2013/02/Schermafbeelding-2013-02-12-om-16.45.21.png"><img class="alignnone size-full wp-image-10731" alt="Schermafbeelding 2013-02-12 om 16.45.21" src="http://blog.xebia.com/wp-content/uploads/2013/02/Schermafbeelding-2013-02-12-om-16.45.21.png" width="500" height="77" /></a></p>
<p>A DB2-DBA&#8217;er told us, when you&#8217;d insert a new record during a database-transaction, that record was locked until you would release the transaction by issuing a commit or rollback. Of course we already knew that. However, he also told use that other transactions could still be influenced by that lock: a SELECT without or with broad WHERE clause would have to wait until the first transaction finished. The reason for that: DB2 not just locks the record, but a part of the tablespace where that record happens to be inserted into.</p>
<p>While inserting that data would take very little time, the execution of the whole <strong>process-execution</strong> could take <strong>5 to 20 seconds</strong>. The reason for the long duration: part of the steps involved invoking other webservices, that were not always quick to respond. Since only at the end of the process a commit was performed, a lock existed for part of the database for up to 20 seconds. So this means our console couldn&#8217;t return any data if the other process was still busy, as shown below:</p>
<table>
<tbody>
<tr>
<th>Time</th>
<th>Process a(ctiviti)</th>
<th>Process c(onsole)</th>
<th></th>
</tr>
<tr>
<td>1</td>
<td>INSERT something INTO mytable</td>
<td></td>
<td>Process a is good to go</td>
</tr>
<tr>
<td>2</td>
<td></td>
<td>SELECT * FROM mytable</td>
<td>Process c has to wait for process a</td>
</tr>
<tr>
<td>3</td>
<td>INSERT something INTO myothertable</td>
<td></td>
<td>Process c still has to wait</td>
</tr>
<tr>
<td>4</td>
<td>commit</td>
<td></td>
<td>Process a commits, finally process c can continue</td>
</tr>
<tr>
<td>5</td>
<td></td>
<td>commit</td>
<td>Process c is now also finished</td>
</tr>
</tbody>
</table>
<p>We tried out by searching in our console on primary keys. Then our console would respond immediately, as expected: because then only a lock of a small part of the table is needed.</p>
<p>To get around the problem, we decided to commit from within each delegate, basically after each step in the process. We checked of course with the product-owner: for consistency having some data visible during the execution of the process wasn&#8217;t a problem.<br />
DB2 doesn&#8217;t support nested transaction, so in our delegate a new dbsession had to be opened (and closed):</p>
<pre>EntityManagerFactoryImpl entityManagerFactory = (EntityManagerFactoryImpl) Persistence.
    createEntityManagerFactory(properties.getProperty("myunitname");
sessionFactory = entityManagerFactory.getSessionFactory();
Session session = sessionFactory.openSession();
session.getTransaction().begin();
...
session.getTransaction().commit();
session.close();</pre>
<p>Note: if you use<a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/transaction.html"> Spring-transactions</a>, Spring will do the above boilerplate for you.</p>
<p>Now locks were held for a much shorter time. After this change, our console behaved normally.<br />
<a href="http://blog.xebia.com/wp-content/uploads/2013/02/Schermafbeelding-2013-02-12-om-16.50.16.png"><img class="alignnone size-full wp-image-10732" alt="Activiti with commit" src="http://blog.xebia.com/wp-content/uploads/2013/02/Schermafbeelding-2013-02-12-om-16.50.16.png" width="500" height="76" /></a></p>
<p>The behavior of the process as listed before was in fact desired in the first place. After all writes, a flush statement existed in the original code. On DB2 that statement would indeed cause the data to be written to disk, but the data wouldn&#8217;t be visible until the commit was performed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/03/06/small-data-workflow-long-transactions-and-db2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FitNesse and dependency management with Maven</title>
		<link>http://blog.xebia.com/2013/03/04/fitnesse-and-dependency-management-with-maven/</link>
		<comments>http://blog.xebia.com/2013/03/04/fitnesse-and-dependency-management-with-maven/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 15:15:38 +0000</pubDate>
		<dc:creator>Arjan Molenaar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10780</guid>
		<description><![CDATA[As a software developer you&#8217;re using dependency management to handle dependencies on your project; include frameworks and libraries to your project. If you&#8217;re a Java developer you&#8217;re probably using Maven. When you&#8217;re not using Maven you&#8217;re probably using one of the more versatile build tools like Ant or Gradle, both can use Ivy for dependency]]></description>
				<content:encoded><![CDATA[<p>As a software developer you&#8217;re using dependency management to handle dependencies on your project; include frameworks and libraries to your project. If you&#8217;re a Java developer you&#8217;re probably using <a href="http://maven.apache.org">Maven</a>. When you&#8217;re not using Maven you&#8217;re probably using one of the more versatile build tools like Ant or Gradle, both can use <a href="http://ant.apache.org/ivy">Ivy</a> for dependency management. Either way, you&#8217;re not putting binaries (jars) in your source control repository.</p>
<p>How about your <a href="http://fitnesse.org">FitNesse</a> acceptance suite? Since it&#8217;s all software and all belongs to the project, you probably want to have the same standards when executing the acceptance test suite. It&#8217;s really not that different from executing your regular (unit) tests.</p>
<p>In this blog I&#8217;ll explain how to launch a FitNesse suite from Maven. I&#8217;ll also elaborate on how to get FitNesse to recognize the dependencies required to launch the application. A future post will be dedicated to the FitNesse/Ivy combo.</p>
<p><span id="more-10780"></span></p>
<h2>Launching FitNesse from Maven</h2>
<p>When you start integration FitNesse through Maven, there are a few challenges ahead:</p>
<ol>
<li>Maven has a limited set of scopes in which you can define dependencies (compile, test, runtime)</li>
<li>Maven is using a fixes set of execution phases.</li>
<li>I&#8217;d like to start FitNesse in 2 modes: interactive and non-interactive.</li>
</ol>
<p>Since FitNesse is about acceptance tests it makes sense to execute those in the <tt>integration-test</tt> phase.  The integration-test phase is executed after the <tt>package</tt> stage. In interactive mode I&#8217;m not interested in a package, so I&#8217;ll launch FitNesse from the <tt>test</tt> stage directly. The way to make this possible is by using profiles.</p>
<h3>FitNesse in interactive mode</h3>
<p>First things first: in order to do <em>anything</em> with FitNesse we need to include the dependency. To start FitNesse we&#8217;ll use the <tt>runtime</tt> scope:</p>
<pre class="brush: xml; title: ; notranslate">&lt;dependencies&gt;
  &lt;!-- project dependencies go here ... --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.fitnesse&lt;/groupId&gt;
    &lt;artifactId&gt;fitnesse&lt;/artifactId&gt;
    &lt;version&gt;20121220&lt;/version&gt;
    &lt;scope&gt;runtime&lt;/scope&gt;
  &lt;/dependency&gt;
&lt;/dependencies&gt;
</pre>
<p>This goes in the normal dependency section.</p>
<p>Now let&#8217;s look at the profile. As said before, for interactive editing I&#8217;d like to start FitNesse from the <tt>test</tt> phase.</p>
<pre class="brush: xml; title: ; notranslate">&lt;profiles&gt;
  &lt;profile&gt;
    &lt;id&gt;fitnesse&lt;/id&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.6&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;start-fitnesse&lt;/id&gt;
              &lt;phase&gt;test&lt;/phase&gt;
              &lt;configuration&gt;
                &lt;tasks&gt;
                  &lt;echo taskname=&quot;fitnesse&quot; message=&quot;Starting FitNesse...&quot; /&gt;
                  &lt;java classname=&quot;fitnesseMain.FitNesseMain&quot; classpathref=&quot;maven.runtime.classpath&quot; fork=&quot;true&quot;&gt;
                    &lt;arg line=&quot;-p 8000&quot; /&gt;
                    &lt;arg line=&quot;-d .&quot; /&gt;
                  &lt;/java&gt;
                &lt;/tasks&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                &lt;goal&gt;run&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
&lt;/profiles&gt;
</pre>
<p>Mind the <tt>classpathref</tt> attribute on the Java tag. It&#8217;s referencing the runtime classpath definition from Maven. That easy.</p>
<p>This will allow you to start FitNesse using the following command:</p>
<pre class="brush: plain; title: ; notranslate">$ mvn -Pfitnesse test
</pre>
<p>Quite okay, right? You can start the wiki in stand-alone mode and use it as, well, a wiki.</p>
<h2>Maven support in FitNesse</h2>
<p>Now let&#8217;s see if we can make FitNesse import some dependencies through Maven. The dependencies are stated in the <tt>pom.xml</tt> file, so it makes no sense duplicating those. Since dependencies change over time it&#8217;s quite labour intensive to manage them by hand it FitNesse. The way to go is to include the <tt>maven-classpath-plugin</tt>. This plugin needs to be loaded along with the FitNesse binary, so FitNesse can make use of it. Let&#8217;s include it in the profile, then the profile definition looks like this:</p>
<pre class="brush: xml; title: ; notranslate">&lt;profiles&gt;
  &lt;profile&gt;
    &lt;id&gt;fitnesse&lt;/id&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.6&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;start-fitnesse&lt;/id&gt;
              &lt;phase&gt;test&lt;/phase&gt;
              &lt;configuration&gt;
                &lt;tasks&gt;
                  &lt;echo taskname=&quot;fitnesse&quot; message=&quot;Starting FitNesse...&quot; /&gt;
                  &lt;java classname=&quot;fitnesseMain.FitNesseMain&quot; classpathref=&quot;maven.runtime.classpath&quot; fork=&quot;true&quot;&gt;
                    &lt;arg line=&quot;-p 8000&quot; /&gt;
                    &lt;arg line=&quot;-d .&quot; /&gt;
                  &lt;/java&gt;
                &lt;/tasks&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                &lt;goal&gt;run&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.fitnesse.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-classpath-plugin&lt;/artifactId&gt;
        &lt;version&gt;1.6&lt;/version&gt;
        &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/profile&gt;
&lt;/profiles&gt;
</pre>
<p>That&#8217;s it for the dependency. Now let&#8217;s tell FitNesse about it. In a file named <tt>plugins.properties</tt> (in the same directory where your POM is located) we can define the plugin:</p>
<pre class="brush: plain; title: ; notranslate"># plugins.properties: Configuration for FitNesse
SymbolTypes = fitnesse.wikitext.widgets.MavenClasspathSymbolType
</pre>
<p>We&#8217;ll define our dependencies from a wiki page, hence define the plugin as <em>SymbolType</em>.</p>
<p>Now let&#8217;s relaunch FitNesse (<tt>Ctrl-C</tt> to terminate the running instance). It gives a message saying the plugin is loaded:</p>
<pre class="brush: plain; title: ; notranslate"> [fitnesse] Starting FitNesse 20121220... (Selenium 2.29.1)
      FitNesse (v20121220) Started...
          port:              8000
          root page:         fitnesse.wiki.FileSystemPage at ./FitNesseRoot
          logger:            none
          authenticator:     fitnesse.authentication.PromiscuousAuthenticator
          page factory:      fitnesse.responders.PageFactory
          page theme:        bootstrap
          page version expiration set to 0 days.
          Custom symbol types loaded:
              fitnesse.wikitext.widgets.MavenClasspathSymbolType
</pre>
<p>All that has to be done now is including the Maven classpath in hierarchy of the test suite. In a wiki page, define:</p>
<pre class="brush: plain; title: ; notranslate">!pomFile pom.xml
</pre>
<p>If you save the file you should see a lot of &#8220;classpath&#8221; entries show up on the page.</p>
<p>By default it will load the <tt>test</tt> scope (this is not related to the fact that we started FitNesse from the test phase). The plugin will display all dependencies.</p>
<p>One remark: why did I add the FitNesse dependency to the project dependencies and the plugin to the profile dependencies? You&#8217;ll need the fitnesse jar once you start executing tests. The plugin is not able to enable profiles at this moment. In practice this is hardly a problem.</p>
<h3>Running integration tests</h3>
<p>Executing FitNesse as part of the build cycle basically follows the same scheme. Let&#8217;s put it in a profile that&#8217;s active by default. This adds some flexibility in that the profile can be disabled to prevent the tests from running (for a local build or something).</p>
<pre class="brush: xml; title: ; notranslate">&lt;profiles&gt;
  &lt;!-- fitnesse profile omitted for clearity --&gt;
  &lt;profile&gt;
    &lt;id&gt;fitnesse-integration&lt;/id&gt;
    &lt;activation&gt;
      &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
    &lt;/activation&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.6&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;start-fitnesse-integration&lt;/id&gt;
              &lt;phase&gt;integration-test&lt;/phase&gt;
              &lt;configuration&gt;
                &lt;tasks&gt;
                  &lt;echo taskname=&quot;fitnesse&quot; message=&quot;Starting FitNesse...&quot; /&gt;
                  &lt;java classname=&quot;fitnesseMain.FitNesseMain&quot; classpathref=&quot;maven.runtime.classpath&quot; fork=&quot;true&quot; failonerror=&quot;true&quot;&gt;
                    &lt;arg line=&quot;-p 8001&quot; /&gt;
                    &lt;arg line=&quot;-c FitNesse.SuiteAcceptanceTests?suite&amp;amp;amp;format=text&quot; /&gt;
                    &lt;arg line=&quot;-d .&quot; /&gt;
                  &lt;/java&gt;
                &lt;/tasks&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                &lt;goal&gt;run&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.fitnesse.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-classpath-plugin&lt;/artifactId&gt;
        &lt;version&gt;1.6&lt;/version&gt;
        &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/profile&gt;
&lt;/profiles&gt;
</pre>
<p>Where I put <tt>FitNesse.SuiteAccceptanceTests</tt> it should point to your acceptance suite. The <tt>-c</tt> option is used to execute a command from the command line. The commands have the same format as the URL would have when you execute it in interactive mode. Hence the <tt>?suite&amp;format=text</tt>.</p>
<p>Now the integration tests are executed autoamtically when you perform a <tt>mvn install</tt>.</p>
<p>Note: if your application is a webapp, you can choose to launch it in the <tt>pre-integration-test</tt> phase and shut it down in the <tt>post-integration-test</tt> phase. The de-facto web server to use is Jetty, but that&#8217;s out of the scope of this blog. In the <a href="https://github.com/xebia/Xebium">Xebium</a> project, you can find a complete example of a <a href="https://github.com/xebia/Xebium/blob/master/pom.xml">POM file</a>.</p>
<h2>Dealing with Maven Home</h2>
<p>By default Maven will look in <tt>$HOME/.m2/</tt> for its <tt>settings.xml</tt>. When you have your settings on a different location you need to have the <tt>M2_HOME</tt> environment variable set to that location. The Maven classpath plugin takes into account the <tt>M2_HOME</tt> variable as of version 1.6.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/03/04/fitnesse-and-dependency-management-with-maven/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anatomy of a Looper</title>
		<link>http://blog.xebia.com/2013/02/24/android-looper-anatomy/</link>
		<comments>http://blog.xebia.com/2013/02/24/android-looper-anatomy/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 17:46:01 +0000</pubDate>
		<dc:creator>Barend Garvelink</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10764</guid>
		<description><![CDATA[There&#8217;s an intersting low-level class in the Android SDK called Looper. Each app has at least one, because it powers the UI Thread. You can create Android apps perfectly fine without ever using Looper yourself, but it&#8217;s an interesting thing, so let&#8217;s take a look under the bonnet. The visible building blocks are Looper, Handler]]></description>
				<content:encoded><![CDATA[<p>There&#8217;s an intersting low-level class in the Android SDK called <a href="http://developer.android.com/reference/android/os/Looper.html"><tt>Looper</tt></a>. Each app has at least one, because it powers the UI Thread. You can create Android apps perfectly fine without ever using Looper yourself, but it&#8217;s an interesting thing, so let&#8217;s take a look under the bonnet.</p>
<p><span id="more-10764"></span><br />
<div id="attachment_10765" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.xebia.com/wp-content/uploads/2013/02/android.os_.Looper-Overview.png"><img src="http://blog.xebia.com/wp-content/uploads/2013/02/android.os_.Looper-Overview-300x189.png" alt="Block diagram showing Looper, Message Queue, three Messages and two Handlers." width="300" height="189" class="size-medium wp-image-10765" /></a><p class="wp-caption-text">Structural overview of Android&#8217;s Looper API.</p></div></p>
<p>The visible building blocks are <tt>Looper</tt>, <a href="http://developer.android.com/reference/android/os/Handler.html"><tt>Handler</tt></a> and <a href="http://developer.android.com/reference/android/os/Message.html"><tt>Message</tt></a>. Behind the scenes, there&#8217;s <a href="http://developer.android.com/reference/android/os/MessageQueue.html"><tt>MessageQueue</tt></a>. Each Looper is tied to a single Thread, and each Thread has at most one Looper. The Looper is accessed primarily through the Handler class.</p>
<p>Handler has the methods through which you obtain message instances and submit them to the message queue of the associated looper. Once your message is at the front of the queue, the Handler is also the object to process that message. You can implement the message processing behaviour either by subclassing Handler and overriding the <a href="http://developer.android.com/reference/android/os/Handler.html#handleMessage(android.os.Message)"><tt>handleMessage(..)</tt></a> method, or by creating the Handler with an implementation of the <a href="http://developer.android.com/reference/android/os/Handler.Callback.html"><tt>Handler.Callback</tt></a> interface.</p>
<p>Messages have five public fields. The <tt>int what</tt> defines the message type. It allows a single Handler (or Handler Callback) to handle multiple kinds of messages using a <tt>switch</tt> construct. The two <tt>int</tt>s <tt>arg1</tt> and <tt>arg2</tt> and the object <tt>obj</tt> are free format arguments that you can use however you see fit. The <tt>replyTo</tt> field is outside the scope of this blog post.</p>
<h3>What about <tt>ExecutorService</tt>?</h3>
<p>Java 1.5 introduced the <tt>util.concurrent</tt> package and, with it, the <tt>Executor</tt> framework. This framework is included in the Android SDK and the Looper is similar in purpose to a <a href="http://developer.android.com/reference/java/util/concurrent/Executors.html#newSingleThreadExecutor()"><tt>SingleThreadExcecutor</tt></a>, albeit clearly less versatile: you can&#8217;t use <tt>Callable</tt>&#8216;s and <tt>Future</tt>s, you can&#8217;t change your mind about the chosen <tt>ExecutorService</tt> implementation or tune the queue length.</p>
<p>You might therefore ask &ldquo;Why reinvent the wheel?&rdquo;.</p>
<p>The reason is that Looper has a different performance profile. Recall that the UI thread is powered by a Looper. What you can&#8217;t tell from the diagram shown earlier is that the <tt>Message</tt> objects are kept in an object pool and used over and over. This means that, if you choose the message payload right, <em>a looper can run indefinitely without creating garbage collector load</em>.</p>
<p>The gold standard for a UI is to refresh sixty times per second. This gives the user the smoothest scrolling. Had the UI Thread been built on top of an executor service, the garbage collector load would have made such a refresh rate impossible and the user wouldn&#8217;t have been scrolling smoothly for very far.</p>
<h3>Putting Looper to use</h3>
<p>The most common use of the Looper API is as a means to hop onto the main thread from a background thread. This is how the <tt>onProgress()</tt> and <tt>onPostExecute()</tt> methods of <a href="http://developer.android.com/reference/android/os/AsyncTask.html"><tt>AsyncTask</tt></a> are implemented.</p>
<pre class="brush: java; title: ; notranslate">
class HandlerSample implements Handler.Callback {

  private final Handler mHandler = new Handler( Looper.getMainLooper(), this );
  private static final int MSG_TYPE_A = 1;
  private static final int MSG_TYPE_B = 2;

  /** E.g. a sensor callback or an IntentService. */
  void someMethodThatRunsInTheBackground() {

    // Background processing goes here...

    // The obtainMessage() and sendMessage() methods are thread-safe and can
    // be called without external synchronization.
    Message msg = mHandler.obtainMessage( MSG_TYPE_A, resultObj );
    mHandler.sendMessage( msg );
  }

  /** Invoked on the UI Thread, by means of Looper.getMainLooper(). */
  @Override public void handleMessage( Message msg ) {
    switch (msg.what) {
      case MSG_TYPE_A:
        // Processing goes here
        break;
      case MSG_TYPE_B:
        // Processing goes here
        break;
    }
  }
}
</pre>
<p>Incidentally, if you ever need to check whether the current thread is the Main thread, simly test <tt>(&nbsp;Looper.myLooper() == Looper.getMainLooper()&nbsp;)</tt>. This can be a useful complement to <a href="http://developer.android.com/reference/android/os/StrictMode.html"><tt>StrictMode</tt></a>.</p>
<h3>Using your own Looper</h3>
<p>Besides the main looper, it&#8217;s perfectly possible to create your own Looper and do message processing in a background thread. By nature, this is a low-level construct and not all apps need it. Peripheral I/O is a good candidate for handling in this manner, for example, <a href="http://stackoverflow.com/q/14919243/49489">talking Bluetooth to an Arduino</a>.</p>
<p>To begin using a looper, you need to call <tt>Looper.prepare()</tt> and <tt>Looper.loop()</tt> <em>on the Thread that will do the looping</em>. The call to <tt>loop()</tt> doesn&#8217;t return; from the moment you call this method, your thread is processing messages until the <tt>quit()</tt> method is called on its Looper.</p>
<pre class="brush: java; title: ; notranslate">
class BackgroundLooper extends Thread implements Handler.Callback {

  /** Careful: this field will be null for some time after start(). */
  public Handler handler;

  @Override public void run() {

    Looper.prepare();

    handler = new Handler( Looper.myLooper(), this );

    Looper.loop();
  }

  @Override public void handleMessage(Message msg) { /* ... */ }
}
</pre>
<p>The SDK includes <a href="http://developer.android.com/reference/android/os/HandlerThread.html">HandlerThread</a> to take the boiler plate off your hands and make all this a bit easier.</p>
<h3>Remarks</h3>
<ul>
<li>When using <tt>Handler</tt>, make sure you enqueue messages with the one of the <tt>send()</tt> methods and not with the <tt>dispatchMessage(..)</tt> method. The latter comes first in an alphabetically sorted autocompletion pop-up, and you wouldn&#8217;t be the first person to call the wrong method <img src='http://blog.xebia.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</li>
<li>If you create a Handler with a constructor that doesn&#8217;t take a Looper argument it will use the current thread&#8217;s Looper, throwing an Exception if there is none. I think it&#8217;s better to be explicit, and always use an initializing constructor with either <tt>Looper.getMainLooper()</tt> or <tt>Looper.myLooper()</tt> as an argument.</li>
<li>The <tt>MessageQueue</tt> is seldom used directly, but you can get it from the Looper to add an <a href="http://developer.android.com/reference/android/os/MessageQueue.IdleHandler.html"><tt>IdleHandler</tt></a> to it.</li>
<li>Be careful when you hold on to managed objects such as Activities and Views in a background service. Just like with AsyncTask, you can get into all kinds of trouble if you refer to a UI element that is no longer valid.</li>
<li>When you call <tt>Looper.quit()</tt>, the looper exits as soon as it can. It finishes processing the current message, but it doesn&#8217;t process any other messages left in its queue. If you want the looper to finish processing the remaining messages, put a &#8220;poison pill&#8221; message on the queue that tells your Handler to <tt>quit()</tt> its looper.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/02/24/android-looper-anatomy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sketchnoting For Absolute Beginners</title>
		<link>http://blog.xebia.com/2013/02/23/sketchnoting-for-absolute-beginners/</link>
		<comments>http://blog.xebia.com/2013/02/23/sketchnoting-for-absolute-beginners/#comments</comments>
		<pubDate>Sat, 23 Feb 2013 10:47:39 +0000</pubDate>
		<dc:creator>Laurens Bonnema</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Sketchnoting]]></category>
		<category><![CDATA[sketchnoting]]></category>

		<guid isPermaLink="false">http://blog.xebia.com/?p=10762</guid>
		<description><![CDATA[I&#8217;ve taken up sketchnoting recently, and I love it! So, what is sketchnoting? Why is it useful? And how do you get started? The answer to the first question is pretty straight-forward: Sketchnoting is a way of note taking that involves not just notes, but also sketches. Mike Rohde, the godfather of sketchnoting, defines it]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve taken up sketchnoting recently, and I love it! So, what is sketchnoting? Why is it useful? And how do you get started?</p>
<p>The answer to the first question is pretty straight-forward: Sketchnoting is a way of note taking that involves not just notes, but also sketches. <a href="http://rohdesign.com">Mike Rohde</a>, the godfather of sketchnoting, defines it as taking rich visual notes, mixing handwriting and drawing to create a more appealing set of notes. And that&#8217;s exactly what it is.</p>
<p><span id="more-10762"></span></p>
<p>To me, sketchnoting is appealing, because as it turns out I&#8217;ve been doing it for the past decade, thinking I should really structure my &#8220;<a href="http://en.wikipedia.org/wiki/Mind_map">mind maps</a>&#8221; more like <a href="http://en.wikipedia.org/wiki/Tony_Buzan">Tony Buzan</a>&#8216;s. Then, I saw an <a href="http://www.youtube.com/watch?v=3tJPeumHNLY">awesome TEDx vid</a> by <a href="https://twitter.com/ninmah">Rachel Smith</a> from <a href="http://www.grove.com">The Grove Consultants</a> and encountered <a href="http://sketchnotearmy.com">The Sketchnote Army</a>. It dawned on me that what I&#8217;d been doing had a name, was not as strange and uniquely &#8220;me&#8221; as I&#8217;d previously thought, and it was gaining momentum as a cool thing to do at conferences and meetings. I decided to get better at sketchnoting and went looking for ways to do so. I joined a <a href="http://www.meetup.com/Design-Thinking-via-Graphic-Facilitation/">Meetup group</a> by <a href="http://www.linkedin.com/in/phegenbart">Petra Hegenbart</a>. Never made it to one of those meetups, but in the online discussions we had leading up to the meetups, Petra mentioned an online <a href="http://learntoscribe.com">Rockstar Scribe</a> course by <a href="http://www.alphachimp.com">Alphachimp</a>. I enrolled in the course and subsequently read <a href="http://rohdesign.com/book/">The Sketchnote Handbook</a> by <a href="http://rohdesign.com">Mike Rohde</a>.</p>
<p><a href="http://www.flickr.com/photos/8253450@N03/8485382369" title="View 'Rockstar Scribe &#038; Sketchnote Handbook' on Flickr.com"><img height="314" style="float:center;" border="0" src="http://farm9.staticflickr.com/8237/8485382369_6e90bbf38a.jpg" alt="Rockstar Scribe &#038; Sketchnote Handbook" title="Rockstar Scribe &#038; Sketchnote Handbook" width="500"/></a></p>
<p>And now, I&#8217;m hooked. I&#8217;ve developed the sort of passion for sketchnoting that keeps you in a continuous flow. I _love_ to sketchnote, and feel like I _have_ to do it. Now, in and of itself, the fact that I think it&#8217;s fun is probably not enough reason for you to try your hand at it. So what is?</p>
<p>The main reason to start sketchnoting, in my opinion, would be that it allows for true active listening, where you engage with a topic in a holistic way allowing you to focus your attention and fully immerse yourself in a subject, be it a talk at a conference, a meeting or a group discussion. If you show what you&#8217;re doing to the people around you, e.g. by drawing your notes on a whiteboard, flip chart or projector, sketchnoting can contribute to a highly interactive and adaptive meeting. There is something about seeing the group discussion being drawn as they speak that captures people&#8217;s imagination and holds their attention in a way that just doesn&#8217;t seem to happen with a <a href="http://office.microsoft.com/en-us/powerpoint/">Powerpoint</a>, <a href="http://www.apple.com/iwork/keynote/">Keynote</a> or even a <a href="http://prezi.com/agsqmlhgwqg3/sketchnoting-for-absolute-beginners/">Prezi</a>.</p>
<p>So, how do you start? That&#8217;s the beauty of sketchnoting: You&#8217;re probably ready to start right now. Just get some paper and your favorite pen and you are ready to go. Just start listening for metaphors and models in the conversations around you and draw those images combined with carefully calligraphed text. If you&#8217;re like me though, you like to select &#8220;the best&#8221; gear for everything, including sketchnoting. If that&#8217;s you, this is my kit:</p>
<ul>
<li><strong>Analog Sketchnoting</strong></li>
<ul>
<li><strong>Paper: </strong><a href="http://www.moleskine.com/en/">Moleskine</a>, A4, A3, flip chart, <a href="http://www.cadstunter.nl/plotterpapier/a0-plotterpapier">plotter paper</a>.</li>
<li><strong>Markers: </strong>Black, grey, one color. I prefer <a href="http://discountoffice.nl/p/fineliner-technisch-artline-07mm-zwart/">0.7 ArtLine fine liners</a>, <a href="http://discountoffice.nl/p/edding-edding-345-highlighter-lgy/">Edding 345 grey markers</a>, and <a href="http://discountoffice.nl/p/schwan-stabilo-viltstift-stabilo-68-plastic-etui-20st-ass/">Stabilo felt pens</a> for color.</li>
<li><strong>Tape:</strong> Masking, <a href="http://duckbrand.com">Duck</a>, <a href="http://www.scotchbrand.com">Scotch</a>.</li>
</ul>
<li><strong>Digital Sketchnoting</strong></li>
<ul>
<li><strong>Computer: </strong><a href="http://www.wacom.com/products/pen-tablets/intuos">Wacom Intuos 5 Tablet</a> + <a href="http://www.autodesk.com/sketchbookpro">Sketchbook Pro</a>.</li>
<li><strong>iPad:</strong> <a href="http://www.tenonedesign.com/connect.php">Pogo Connect Stylus</a> + <a href="http://www.autodesk.com/sketchbookpro">Sketchbook Pro</a>.</li>
</ul>
</ul>
<p>Any way your structure your notes is fine, but there are a few common layouts you could use to get started. A two- or three-column spread with a header and footer, for example. Or a nine-box layout with the main topic in the center (yes, just like a mind map!). Basically, any page layout you find in a magazine or on a website might be useful.</p>
<p>I&#8217;ve done two presentations/workshops on sketchnoting so far. One at <a href="http://xebia.com">Xebia</a>, the other at <a href="http://www.meetup.com/agileholland/events/100475892/">Agile Holland</a>. Both were very successful in that most, if not all, participants have now taken up sketchnoting, have bought <a href="http://rohdesign.com/book/">the book</a>, and are having entirely too much fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2013/02/23/sketchnoting-for-absolute-beginners/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.xebia.com/feed/ ) in 0.54296 seconds, on May 18th, 2013 at 9:47 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 18th, 2013 at 10:47 am UTC -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache Is Fully Functional :-) ... A Quick Cache file was just served for (  blog.xebia.com/feed/ ) in 0.00044 seconds, on May 18th, 2013 at 10:21 am UTC. -->