<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>planetgeek.ch</title>
	
	<link>http://www.planetgeek.ch</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 08 Sep 2010 10:32:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/planetgeekch" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="planetgeekch" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>From User Stories To Architecture (long version)</title>
		<link>http://www.planetgeek.ch/2010/09/07/from-user-stories-to-architecture-long-version/</link>
		<comments>http://www.planetgeek.ch/2010/09/07/from-user-stories-to-architecture-long-version/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 14:00:29 +0000</pubDate>
		<dc:creator>Urs Enzler</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1878</guid>
		<description><![CDATA[This is the slide deck of my LAS 2010 presentation: From user stories to architecture. In this presentation, I’ll show you how we evolve the architecture of our software Sprint per Sprint (we develop software using Scrum). You’ll see the architectural challenges you have to face when developing software in an agile way and how [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/09/07/from-user-stories-to-architecture-long-version/";
		var dzone_title = "From User Stories To Architecture (long version)";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>This is the slide deck of my LAS 2010 presentation: From user stories to architecture.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/1Title.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="1 Title" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/1Title_thumb.png" border="0" alt="1 Title" width="244" height="184" /></a></p>
<p><span id="more-1878"></span></p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/2About.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="2 About" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/2About_thumb.png" border="0" alt="2 About" width="244" height="184" /></a></p>
<p>In this presentation, I’ll show you how we evolve the architecture of our software Sprint per Sprint (we develop software using Scrum).</p>
<p>You’ll see the architectural challenges you have to face when developing software in an agile way and how we cope with them to get an architecture that grows together with software.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/4agile.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="4 agile" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/4agile_thumb.png" border="0" alt="4 agile" width="244" height="184" /></a></p>
<p>Using Scrum, we build our software incremental and iterative:</p>
<p>Incremental means, building software feature by feature. Always a complete part at one.</p>
<p>Iterative means, building a first version of the software, get feedback on it and then improve the next version. Until the software is finalized.</p>
<p>When you combine both, software is built feature by feature (or user story by user story), get feedback on it and improve. It is important that a feature is always something complete. Something a real user can give feedback on.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/5problems.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="5 problems" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/5problems_thumb.png" border="0" alt="5 problems" width="244" height="184" /></a></p>
<p>This approach of building software leads to two problems regarding software architecture:</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/6incompletness.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="6 incompletness" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/6incompletness_thumb.png" border="0" alt="6 incompletness" width="244" height="184" /></a></p>
<p style="text-align: left;">The first is incompleteness.</p>
<p style="text-align: left;">Incompleteness because the requirements are never complete and will change due to feedback provided by your customer on your progress.</p>
<p style="text-align: left;">The team will learn while developing. The team members will get better at using the technology used in the project and they will get a deeper understanding of the problem domain solved.</p>
<p style="text-align: left;">We always have an incomplete picture because we cannot anticipate every change that will happen during the project lifetime.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/7change.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="7 change" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/7change_thumb.png" border="0" alt="7 change" width="244" height="184" /></a></p>
<p style="text-align: left;">The second problem we have to face is change.</p>
<p style="text-align: left;">Change happens because requirements get clearer. During development, the team will ask questions to the customer to get a better understanding of the problem to solve. These discussions result in requirements that are more precise as the project goes forward.</p>
<p style="text-align: left;">Plans may change due to a changed business situation. If your customer&#8217;s competitor made a move then your customer may have to react and change the scope of your project.</p>
<p style="text-align: left;">In projects that take more than a year to develop, or during maintenance, technology will probably change. Take the .NET framework for example. There is a major update about every two years. Or the operating system changes (from 32bit Windows XP to 64bit Windows 7). Your architecture will have to take these steps, too.</p>
<p style="text-align: left;">Finally, people change. Either because they learn new things, simply change their minds, or they change teams. Your architecture has to take this into account, too. The architecture is no good if the team does not understand it or thinks it’s bad.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/8solution.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="8 solution" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/8solution_thumb.png" border="0" alt="8 solution" width="244" height="184" /></a></p>
<p>We have to design and evolve our architecture in a way so that these problems are under control.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/9openness.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="9 openness" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/9openness_thumb.png" border="0" alt="9 openness" width="244" height="184" /></a></p>
<p>We design our code – and therefore our architecture – in a way that it is open for new features.</p>
<p>However, it is important that we can extend our design without breaking existing abstractions. Otherwise, we will end with endless refactoring. We can add new features without changing the existing code base.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/10felxibility.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px none;" title="10 felxibility" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/10felxibility_thumb.png" border="0" alt="10 felxibility" width="244" height="184" /></a></p>
<p>When requirements change, code has to change. If we want that our architecture remains stable, we have to ensure that we can make changes that are local.</p>
<p>Local means, a change influences as little code as possible. If possible, even without breaking any abstraction defined by our architecture.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/Simpel.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0pt none;" title="Simple" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/Simpel.png" border="0" alt="" width="244" height="183" /></a></p>
<p>Most important is simplicity. Simple things are easy to understand and therefore easy to extend or change. Simplicity means, the architecture fulfills all needs but in the least complex way possible.</p>
<p>There is no big design up front. Too much thinking ahead often leads to too complex architectures. Architectures, which are built to be flexible and extensible from the start, often break when the real problems arise.</p>
<p>There exist a lot of principles, practices and patterns helping to achieve a simple, extensible and flexible architecture and design:</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/11SOLID.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0pt none;" title="11 SOLID" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/11SOLID_thumb.png" border="0" alt="11 SOLID" width="244" height="184" /></a></p>
<p>One of the most prominent is S.O.L.I.D by Robert C. Martin.</p>
<p>Once you have an architecture in place, how do you keep it stable?</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/12Tests.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="12 Tests" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/12Tests_thumb.png" border="0" alt="12 Tests" width="244" height="184" /></a></p>
<p>We write automated tests, which guarantee us that the tested properties of the architecture remain stable while we extend and change our software.</p>
<p>We use mainly two kinds of tests to achieve this:</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/13UnitTests.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="13 Unit Tests" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/13UnitTests_thumb.png" border="0" alt="13 Unit Tests" width="244" height="184" /></a></p>
<p>The first kind of automated tests are unit tests.</p>
<p>Unit tests help us to build our software as a combination of individual units (classes, components). We can rearrange these units to achieve a change in the architecture while knowing that the building parts remain stable and will still work correctly.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/14AcceptanceTests.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="14 Acceptance Tests" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/14AcceptanceTests_thumb.png" border="0" alt="14 Acceptance Tests" width="244" height="184" /></a></p>
<p>The second kind of automated tests is acceptance tests.</p>
<p>Acceptance tests check a complete feature – end to end. Note: <em>almost</em> end to end: we replace for example the UI representation layer, data access layer and file system access with mock objects.</p>
<p>When we have to refactor parts of our software to enable the integration of a new feature, these acceptance tests guarantee that the existing functionality (functional and non-functional requirements) is not broken.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/15Scrum.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="15 Scrum" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/15Scrum_thumb.png" border="0" alt="15 Scrum" width="244" height="184" /></a></p>
<p style="text-align: left;">We use Scrum to develop software.</p>
<p style="text-align: left;">In Scrum, the project starts with a Kick-off meeting of some sort. Before the first Sprint (an iteration in Scrum), an initial product backlog is built to get a rough understanding of what is to be built.</p>
<p style="text-align: left;">Development happens in Sprints. Each Sprint starts with the Planning Meeting to plan the current Sprint (detailed discussion of what is to be built). The result is the Sprint Backlog.</p>
<p style="text-align: left;">Each day, the team stands together for the Daily Scrum Meeting to get a picture of the current status of the project.</p>
<p style="text-align: left;">To get feedback from any stakeholders, the newly built parts of the project are demonstrated in the Review.</p>
<p style="text-align: left;">Finally, each Sprint ends with the Retrospective, which the team uses to find improvements in the process as well as in the way they work (for example tools).</p>
<p style="text-align: left;">Now, let me add our activities regarding the lifecycle of the architecture:</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/16Architecture.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="16 Architecture" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/16Architecture_thumb.png" border="0" alt="16 Architecture" width="244" height="184" /></a></p>
<p style="text-align: left;">Let’s have a detailed look at the different actions.</p>
<p style="text-align: left;">After the initial product backlog is created, it’s time to start thinking about the architecture:</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/17Idea.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="17 Idea" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/17Idea_thumb.png" border="0" alt="17 Idea" width="244" height="184" /></a></p>
<p style="text-align: left;">The granularity of the initial architecture depends a lot on the type of the project. It has to be clear enough to get the development team running, but it should not be too specific either.</p>
<p style="text-align: left;">Firstly, because we want to start producing working code as fast as possible to get real feedback as soon as possible.</p>
<p style="text-align: left;">Secondly, architectural design decisions at this early stage may be difficult due to lack of know-how on the problem domain. If something does not yet have to be defined, then I’ll defer the decision to build up more knowledge first.</p>
<p style="text-align: left;">Therefore, the initial architecture is “only” a guideline for the team, describing the project in a very coarse way.</p>
<p style="text-align: left;">The architecture will gradually be refined during the project as you will see.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/18Workshop.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="18 Workshop" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/18Workshop_thumb.png" border="0" alt="18 Workshop" width="244" height="184" /></a></p>
<p style="text-align: left;">Every Sprint, my team holds an architecture workshop. Normally, on the first or second day of the Sprint.</p>
<p style="text-align: left;">The main topic is to build team-wide common knowledge needed to implement the User Stories (and other Backlog Items) of the current Sprint. Note that the team will come up with questions in the Sprint planning meeting while discussing the break-down of stories into tasks.</p>
<p style="text-align: left;">This meeting also helps to have equally distributed know-how of the architecture; resulting in better designs in each developer’s daily work.</p>
<p style="text-align: left;">Finally, the team may come up with architectural problems that were identified in previous Sprints. Either the team can solve them in this meeting or a team member takes responsibility for actions during the Sprint (normally the architect, but can be anyone on the team.).</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/19Feedback.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="19 Feedback" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/19Feedback_thumb.png" border="0" alt="19 Feedback" width="244" height="184" /></a></p>
<p style="text-align: left;">While the developers are working on the code, they gather feedback about the architecture: Can the new feature easily be integrated? Are there new insights that lead to changes of the architecture?</p>
<p style="text-align: left;">It is important that the team keeps track of architectural issues. We write these on cards and hang them on our Scrum Board.</p>
<p style="text-align: left;">But how do you generate feedback on your current architecture in an early Sprint, when only parts of the system are built?</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/20Simulators.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="20 Simulators" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/20Simulators_thumb.png" border="0" alt="20 Simulators" width="244" height="184" /></a></p>
<p>The key to this are simulators. Provide a simulation of the environment in which your architecture lives. Simulators can be mock objects used to isolate a dependency away from your system (e.g. the database, file system, user interface representation), or a real simulator for an instrument or other external device.</p>
<p>With these simulators you can check how your architecture will likely behave in the real world.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/21Refine.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="21 Refine" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/21Refine_thumb.png" border="0" alt="21 Refine" width="244" height="184" /></a></p>
<p style="text-align: left;">With every new feature in the software, the architecture is evolved further – always changing together with the code that it supports.</p>
<p style="text-align: left;">This leads to an architecture that really solves the problems at hand without far reaching assumptions that may never become valid.</p>
<p style="text-align: left;">Due to the fact that every developer drives the architecture, it becomes a team responsibility. Everyone can and should influence the architecture. That is important because the primary function of the architecture is to support the developers to solve the problem. Therefore, the responsibility lies with the ones who benefit.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/22Spike.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="22 Spike" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/22Spike_thumb.png" border="0" alt="22 Spike" width="244" height="184" /></a></p>
<p>Normally, evolving the architecture starts with a Spike. A limited amount of time to try something out. The important thing is that a spike is implemented end-to-end. Otherwise, it is probably not possible to predict how the architecture will influence the solution.</p>
<p>A spike is just a minimal path through the system.</p>
<p>An example: you have to build a search dialog, which allows a user to search for customers by specifying the search criteria (prename, name, address, age, …). The result is displayed afterwards in the user interface in a grid showing the complete data of all found customers.</p>
<p>The first step would be to implement the complete search functionality (UI, logic, query, display of results), but only with a single search criteria (e.g. name) and a very reduced results grid (show only name). This stripped down solution can be implemented very fast, because the individual layers are all simple (just for one criteria, show only name).</p>
<p>In upcoming Sprints, this Spike can be extended with further search criteria fields and a better results grid.</p>
<p>The benefit of using a Spike is that you can get feedback about the architectural impact with it, with just a fraction of the effort needed to build the complete search feature.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/23Review.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="23 Review" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/23Review_thumb.png" border="0" alt="23 Review" width="244" height="184" /></a></p>
<p style="text-align: left;">When everyone is changing the architecture just in the scope of their current problem, the design decisions taken may not be optimal from a broader point of view. These local decisions have to be transformed into global decisions.</p>
<p style="text-align: left;">For example, the same problem should be solved in the same way throughout the whole project; otherwise understandability of the code suffers.</p>
<p style="text-align: left;">Therefore, the team should review the current state of the architecture at the end of a Sprint to be ready for the future and refactor where necessary.</p>
<p style="text-align: left;">We use so called “commit-reviews” to reduce the amount of real reviews needed. In a commit-review the developer who coded a new feature shows all changes made to a fellow developer prior to commit the changes to the source code version system.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/24WorkingCode.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="24 Working Code" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/24WorkingCode_thumb.png" border="0" alt="24 Working Code" width="244" height="184" /></a></p>
<p>Reviews of the architecture are done on the code. And only working code is considered. We want to review the current state of what we really have not of …</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/25Documentation.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="25 Documentation" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/25Documentation_thumb.png" border="0" alt="25 Documentation" width="244" height="184" /></a></p>
<p>… what we would like to have.</p>
<p>The purpose of documentation is to facilitate communication of the design and architecture. It helps new team members to get running fast, or to define interfaces between different teams.</p>
<p>However, documentation is a bad basis for architecture validation.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/26Architect.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="26 Architect" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/26Architect_thumb.png" border="0" alt="26 Architect" width="244" height="184" /></a></p>
<p style="text-align: left;">The software architect is responsible to <em>drive</em> the architecture: Provide input to the team when asked and take the lead in the review of the architecture.</p>
<p style="text-align: left;">As I said earlier, every developer makes design decisions every day. Therefore, the software architect has to <em>coach</em> the team to help them take the right decisions.</p>
<p style="text-align: left;">Finally, whenever the team is not able to decide for itself which way to go then its the responsibility of the software architect to decide. The reason for this is that it is still better to decide wrongly (and hopefully correct it later) than not taking a decision at all and probably stalling parts of the development.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/27Speed.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="27 Speed" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/27Speed_thumb.png" border="0" alt="27 Speed" width="244" height="184" /></a></p>
<p>We have seen that agile architecture is not a “do it once forever”. Architecture is a process starting after the initial product backlog is written and ending when the project ends.</p>
<p>There is only a valid architecture if there is working code to proof it. Code to get feedback whether the architecture holds or has to be changed.</p>
<p>Architecture is a team effort. Every team member is responsible that the architecture is evolved to support the currently needed features.</p>
<p>Requirements and plans change and so will the architecture. Inspect and adapt continuously to keep up with the changed environment.</p>
<p>Finally, if the architecture is continuously evolved, it will help you to keep up your development speed throughout the whole project lifecycle.</p>
<p><a rel="lightbox" href="http://www.planetgeek.ch/wp-content/uploads/2010/09/28Extro.png"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="28 Extro" src="http://www.planetgeek.ch/wp-content/uploads/2010/09/28Extro_thumb.png" border="0" alt="28 Extro" width="244" height="184" /></a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/09/07/from-user-stories-to-architecture-long-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VI like editing in eclipse</title>
		<link>http://www.planetgeek.ch/2010/08/25/vi-like-editing-in-eclipse/</link>
		<comments>http://www.planetgeek.ch/2010/08/25/vi-like-editing-in-eclipse/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 15:01:37 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipase]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1818</guid>
		<description><![CDATA[Since a few days I&#8217;m using a plugin in eclipse which allows vi like editing. It&#8217;s called vrapper and can be found under http://vrapper.sourceforge.net. It is a very good light weight alternative to commercial vi plugins. In my opinion there are not more disadvantages as in other vi plugins. Sometimes it has hangers, this means [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/08/25/vi-like-editing-in-eclipse/";
		var dzone_title = "VI like editing in eclipse";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Since a few days I&#8217;m using a plugin in eclipse which allows vi like editing. It&#8217;s called vrapper and can be found under <a href="http://vrapper.sourceforge.net">http://vrapper.sourceforge.net</a>. It is a very good light weight alternative to commercial vi plugins. In my opinion there are not more disadvantages as in other vi plugins.<br />
Sometimes it has hangers, this means it does not fall back to the main state instead it hangs in any command mode. In this rare cases normally helps to restart the plugin with the icon in eclipse.<br />
The installation is very simple, only add the stable update site (<a href="http://vrapper.sourceforge.net/update-site/stable">http://vrapper.sourceforge.net/update-site/stable</a>). Or if not possible to use the update site just download the file from <a href="http://sourceforge.net/projects/vrapper/files/">http://sourceforge.net/projects/vrapper/files/</a>, just copy the files into the plugins directory <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  .</p>
<p>If you like to use vi commands look in and check it out.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/08/25/vi-like-editing-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bad DNS Server Settings in GPO</title>
		<link>http://www.planetgeek.ch/2010/08/22/bad-dns-server-settings-in-gpo/</link>
		<comments>http://www.planetgeek.ch/2010/08/22/bad-dns-server-settings-in-gpo/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 18:46:38 +0000</pubDate>
		<dc:creator>konrad.dambeck</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[Client]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[fix IP]]></category>
		<category><![CDATA[GPO]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/2010/08/22/bad-dns-server-settings-in-gpo/</guid>
		<description><![CDATA[For a Project I hade change the DNS Server settings on several client computers. All Clients hade fixed IP and DNS Settings on the clients and the customer want not to change to a DHCP. I can understand this approach because fixing the IP of computers can improve network security and awareness. My first approach [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/08/22/bad-dns-server-settings-in-gpo/";
		var dzone_title = "Bad DNS Server Settings in GPO";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>For a Project I hade change the DNS Server settings on several client computers. All Clients hade fixed IP and DNS Settings on the clients and the customer want not to change to a DHCP. I can understand this approach because fixing the IP of computers can improve network security and awareness. My first approach was to look inside the GPO of Windows XP. And after 2 minutes searching look what I fond under: “Computer Configuration – Administrative Templates – Network &#8211; DNS Client – DNS Servers”</p>
<p><span id="more-1814"></span>
<p>“ Defines the DNS servers to which a computer sends queries when it attempts to resolve names.</p>
<p>Warning: The list of the DNS servers defined in this setting supersedes DNS servers configured locally and those configured using DHCP. The list of DNS servers is applied to all network connections of multihomed computers to which this setting is applied.</p>
<p>To use this setting, click Enable, and then enter a space-delimited list of IP addresses (in dotted decimal format) in the available field. If you enable this setting, you must enter at least one IP address.</p>
<p>If this setting is not configured, it is not applied to any computers, and computers use their local or DHCP-configured parameters.”</p>
<p>After reading the description I Thanked this is it. So let me show you first the test environment. We got to server and a Client. The server running Windows 2003 and the client runs XP. The two servers (dc01.planetgeek.ch/ 172.16.111.120 and sql.platnetgeek.ch / 172.16.111.124) have installed DNS servers. The Client has only one DNS configured the dc001.</p>
<p>Setting up the new GPO and link it to the client pc.</p>
<p><b><a href="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image002.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image002_thumb.png" width="244" height="92" /></a></b><b></b></p>
<p><b></b></p>
<p>Now we use the client to review the impact of this GPO setting. First we use the gpresut to look if the GPO was adapted.</p>
<p><a href="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image004.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image004_thumb.png" width="244" height="92" /></a></p>
<p>After we are sure that the GPO was applied I do an “ipconfig /all” to check the DNS settings.</p>
<p><a href="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image006.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image006_thumb.png" width="244" height="114" /></a></p>
<p>Okay it looks like the DNS setting is not applied. I checked the result several times, rebooted the PC, used netsh to look on the DNS settings and searched for event log entries. Then I tried nslookup on the console. Look on witch DNS server the request goes. </p>
<p><a href="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image008.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://www.planetgeek.ch/wp-content/uploads/2010/08/clip_image008_thumb.png" width="244" height="45" /></a></p>
<p>It looks like the network tools (ipconfig, netsh and the tcp/ip Settings gui) from windows XP did not recognize the GPO Setting. I guess if you use this in large company this will end up in a debugging nightmare. Normally I hate this Microsoft bashing, because the Company make good and stable products. But this time the guys from Redmond did a very lousy job.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/08/22/bad-dns-server-settings-in-gpo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Udi Dahan talks about commercial options for nservicebus</title>
		<link>http://www.planetgeek.ch/2010/08/17/udi-dahan-talks-about-commercial-options-for-nservicebus/</link>
		<comments>http://www.planetgeek.ch/2010/08/17/udi-dahan-talks-about-commercial-options-for-nservicebus/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 10:40:51 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[nservicebus]]></category>
		<category><![CDATA[udi dahan]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/2010/08/17/udi-dahan-talks-about-commercial-options-for-nservicebus/</guid>
		<description><![CDATA[Udi Dahan gives insight into nservicebus future and commercial options for nservicebus. Read post intro and comment 23 about pricing options: http://nservicebus.grouply.com/message/8259 &#160;]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/08/17/udi-dahan-talks-about-commercial-options-for-nservicebus/";
		var dzone_title = "Udi Dahan talks about commercial options for nservicebus";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Udi Dahan gives insight into nservicebus future and commercial options for nservicebus. Read post intro and comment 23 about pricing options:</p>
<p><a href="http://nservicebus.grouply.com/message/8259" target="_blank">http://nservicebus.grouply.com/message/8259</a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/08/17/udi-dahan-talks-about-commercial-options-for-nservicebus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Obscure reactions within terminal client</title>
		<link>http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/</link>
		<comments>http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 05:37:37 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[flipp]]></category>
		<category><![CDATA[mstsc]]></category>
		<category><![CDATA[remote desctop]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabulator]]></category>
		<category><![CDATA[terminal client]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1798</guid>
		<description><![CDATA[Since we use the new terminal client from microsoft we register sometimes obscure reactions. For example: program flipping while pressing the tab key solo, get the dialog which is shown normally pressing &#8216;Ctr-Alt-Del&#8217; while pressing the delete key solo. The problem is&#8230; We discovered that it is very important in which order we release some [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/";
		var dzone_title = "Obscure reactions within terminal client";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Since we use the new terminal client from microsoft we register sometimes obscure reactions. For example: program flipping while pressing the tab key solo, get the dialog which is shown normally pressing &#8216;Ctr-Alt-Del&#8217; while pressing the delete key solo.<br />
<span id="more-1798"></span></p>
<h2>The problem is&#8230;</h2>
<p>We discovered that it is very important in which order we release some key combinations like &#8216;Alt-Shift&#8217;. If we press them in the order &#8216;Alt&#8217; and then &#8216;Shift&#8217; and release them in the order &#8216;Alt&#8217; and then &#8216;Shift&#8217; the terminal client will not receive the &#8216;Alt&#8217; key is released. So it is very important to release the keys in reverse order they were pressed. (And in our IDE we need this key combination a lot :S )</p>
<h2>What is to do when&#8230;</h2>
<p>If this happens just press the combination again and release the keys in reverse order. That&#8217;s the trick. <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiscreen with microsoft terminal client</title>
		<link>http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/</link>
		<comments>http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 14:34:25 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[dual screen]]></category>
		<category><![CDATA[mstsc]]></category>
		<category><![CDATA[mulit monitor]]></category>
		<category><![CDATA[Terminalclient]]></category>
		<category><![CDATA[windows XP]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1757</guid>
		<description><![CDATA[Since a few months I&#8217;m working in a new project where we have remote PC&#8217;s for developing. Since they updated the clients from Windows XP SP1 to SP3 we we have the new remote desktop client. Now it&#8217;s possible to show the terminal client on two monitors (or a monitor with a resolution over 1600&#215;1200). [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/";
		var dzone_title = "Multiscreen with microsoft terminal client";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Since a few months I&#8217;m working in a new project where we have remote PC&#8217;s for developing. Since they updated the clients from Windows XP SP1 to SP3 we we have the new remote desktop client. Now it&#8217;s possible to show the terminal client on two monitors (or a monitor with a resolution over 1600&#215;1200). We just had to do the following:</p>
<ol>
<li>create a Shortcut to mstsc.exe</li>
<li>add as params</li>
<ul>
<li>/w:2560 (The screen witdth)</li>
<li>/h:1024 (The screen height)</li>
<li>/v:hostname</li>
</ul>
</ol>
<p>The link will look like this: <strong>mstsc.exe /w:2560 /h:1024 /v:hostname</strong><br />
Our expirience was it works not bad. The only thing we noticed was, the client needs more power.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows7, Resharper 5.1, VS2010 and xunit.contrib problem</title>
		<link>http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/</link>
		<comments>http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 18:55:40 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Resharper]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Windows7]]></category>
		<category><![CDATA[Xunit]]></category>
		<category><![CDATA[Xunit.Contrib]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1780</guid>
		<description><![CDATA[Just a short notice. If you are using Resharper 5.1 under Windows7 and xunit.contrib and your unit tests are not executed anymore in VS2010 you need to check the following: Close all running VS2010 instances Upgrade to latest xunit.contrib for Resharper 5.1 If you have xunit.contrib under Program Files\Jetbrains\Resharper\..\Bin\Plugins then move them to [Root]:\Users\[YourUser]\AppData\Roaming\JetBrains\ReSharper\v5.1\vs10.0\Plugins\XunitContrib Open [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/";
		var dzone_title = "Windows7, Resharper 5.1, VS2010 and xunit.contrib problem";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Just a short notice. If you are using Resharper 5.1 under Windows7 and xunit.contrib and your unit tests are not executed anymore in VS2010 you need to check the following:</p>
<ol>
<li>Close all running VS2010 instances</li>
<li>Upgrade to latest xunit.contrib for Resharper 5.1</li>
<li>If you have xunit.contrib under Program Files\Jetbrains\Resharper\..\Bin\Plugins then move them to<br />
[Root]:\Users\[YourUser]\AppData\Roaming\JetBrains\ReSharper\v5.1\vs10.0\Plugins\XunitContrib</li>
<li>Open VS2010 again and you should be able to run the unit tests in unit test runner of Resharper again.</li>
</ol>
<p>Hope that helps</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fileformat and the impacts in bash scripts</title>
		<link>http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/</link>
		<comments>http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:22:47 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1746</guid>
		<description><![CDATA[I had the problem calling a bash script I got the error: &#8220;syntax error: unexpected end of file&#8221; and &#8220;: command not foundne 2: &#8221; I created a simple scritp for demonstration #!/bin/bash echo &#34;hello&#34; In this sample we have following error after execution: &#8220;: command not foundne 2: &#8221; As you can see, there is [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/";
		var dzone_title = "Fileformat and the impacts in bash scripts";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>I had the problem calling a bash script I got the error:<br />
<strong>&#8220;syntax error: unexpected end of file&#8221;<br />
</strong>and<br />
<strong>&#8220;: command not foundne 2: &#8221; </strong></p>
<p><span id="more-1746"></span>I created a simple scritp for demonstration</p>
<pre class="brush: bash;">
#!/bin/bash

echo &quot;hello&quot;
</pre>
<p>In this sample we have following error after execution: <strong>&#8220;: command not foundne 2: &#8221; </strong>As you can see, there is nothing on line 2.</p>
<p>The solution was as simple as the problem heavy.  Just execute the following command on the linux system.</p>
<pre class="brush: bash; light: true;">

dos2unix myScript.sh myScript.sh
</pre>
<p>And the script will work fine.</p>
<p>The easiest way to spot that the file format is wrong would be:</p>
<pre class="brush: bash; light: true;">

 head myScript.sh | od -c
</pre>
<p> 0000000   #   !   /   b   i   n   /   b   a   s   h  <strong>\r  \n  \r  \n</strong>   e<br />
 0000020   c   h   o       &#8220;   h   e   l   l   o   &#8221;<br />
 0000033</p>
<p>So you can see the newlines are done with <em>(\r\n)</em>. This can occur if you write the script under windows and moved it to a linux system. After executing dos2unix the head will look like this:</p>
<p> 0000000   #   !   /   b   i   n   /   b   a   s   h  <strong>\n  \n</strong>   e   c   h<br />
 0000020   o       &#8220;   h   e   l   l   o   &#8221;<br />
 0000031</p>
<p>Every &#8220;linefeed carriage return&#8221; is replaced with a simple &#8220;linefeed&#8221;.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mockito – Answer vs. Return</title>
		<link>http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/</link>
		<comments>http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 19:18:33 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[answer]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[Mocking]]></category>
		<category><![CDATA[Mockito]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1744</guid>
		<description><![CDATA[Did you had the problem your mock must act like a bean? And you could not create the object with the real implementation? And the interface was too large, so you would not create a innerclass for the test? I had this problem too. I solved it with the answer in mockito. First of all [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/";
		var dzone_title = "Mockito &#8211; Answer vs. Return";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Did you had the problem your mock must act like a bean? And you could not create the object with the real implementation? And the interface was too large, so you would not create a innerclass for the test? I had this problem too. I solved it with the answer in mockito.</p>
<p><span id="more-1744"></span>First of all we need an interface. On the interface we define a setter and a getter. Imagine we must be able to get back the value we set.  The sample interface will be quite easy but with a little imagination we know the interface would have a lot more methods. And we don&#8217;t want to implement the class in our test.</p>
<p>The interface would look like this:</p>
<pre class="brush: java;">
public interface SetGet {
    void setString(String newString);
    String getString();
}
</pre>
<p>We create the mock as usual:</p>
<pre class="brush: java;">
SetGetSample mock = Mockito.mock(SetGetSample.class);
</pre>
<p>Following code snipped shows how to record the value which is set on <strong>setString</strong>.</p>
<pre class="brush: java;">
doAnswer(new Answer&lt;Object&gt;() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
        theString = (String) invocation.getArguments()[0];
        return null;
    }
}).when(mock).setString(anyString());
</pre>
<p>We need the <em>Answer</em> for recording the input and do not give something back. Because there is a void return value we have to do the answer with the command <strong>doAnswer</strong> since the <em>when </em>only can be used on methods which have a return value.</p>
<p>We know there is a <strong>string</strong> used as parameter so we can cast the first argument to String. In other cases we should check if it is an instance of this type. And we set our field to the given value. (Yep, you read correct we need a field in the test class to set the value.</p>
<p>Now the code to get the recorded value:</p>
<pre class="brush: java;">
when(mock.getString()).thenAnswer(new Answer&lt;String&gt;() {
    @Override
    public String answer(InvocationOnMock invocation) throws Throwable {
        return theString;
    }
});
</pre>
<p>You see, know we use the standard <strong>when</strong> but we use the <strong>thenAnswer</strong> instead of the <strong>thenReturn</strong> the difference is: answer will everytime be executed. Return remembers the value we told them in the when. And the following test will become a green bar. <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: java;">
mock.setString(&quot;foo&quot;);
assertEquals(&quot;foo&quot;, mock.getString());

mock.setString(&quot;bar&quot;);
assertEquals(&quot;bar&quot;, mock.getString());
</pre>
<p>I think this is not the solution you should use for a large interface. But imho this is a practicable solution if there is just a set of one or two setter/getter.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad</title>
		<link>http://www.planetgeek.ch/2010/07/12/ipad/</link>
		<comments>http://www.planetgeek.ch/2010/07/12/ipad/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 15:07:26 +0000</pubDate>
		<dc:creator>konrad.dambeck</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[dropox]]></category>
		<category><![CDATA[funbox]]></category>
		<category><![CDATA[goodreader]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[mosess]]></category>
		<category><![CDATA[pocketCAS]]></category>
		<category><![CDATA[wlan]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/2010/07/12/ipad/</guid>
		<description><![CDATA[Currently I’m in the refresher course of the swiss armed forces in Andermatt. So I get plenty of time to test my new Apple iPad. I have the 16 GB model without the 3G (UMTS) modem. I decide to buy the cheapest model because I think I don’t need much storage on my web tablet. [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/12/ipad/";
		var dzone_title = "iPad";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Currently I’m in the refresher course of the swiss armed forces in Andermatt. So I get plenty of <a href="http://www.planetgeek.ch/wp-content/uploads/2010/07/charltonhestonMossesiPad.jpg"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; margin: 10px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="charlton-heston-Mosses-iPad" border="0" alt="charlton-heston-Mosses-iPad" align="left" src="http://www.planetgeek.ch/wp-content/uploads/2010/07/charltonhestonMossesiPad_thumb.jpg" width="164" height="165" /></a> time to test my new Apple iPad. I have the 16 GB model without the 3G (UMTS) modem. I decide to buy the cheapest model because I think I don’t need much storage on my web tablet. The 3G option was for me secondary because I own a notebook with built in UMTS modem. As a side note you can use the freeware Connectify to switch any pc in to a wlan access point <a href="http://www.connectify.me/">http://www.connectify.me/</a>. Or create a wlan network proxy with an iPhone and the app NetShare (10$) from the Sydia store.</p>
<p>First I will make my coming out as an Apple fan boy. So this article reflects my personal meaning and may not be 100% objective. The physical dimensions of the device are 243mm x 190mm x 13mm. The weight of the iPad is 0,68 kg or 0.73 kg for the 3G model. By the way the 3g models have also an compass and a GPS module. The display is 9.7 inch and has a resolution of 1024×768 (132ppi). The battery live is beyond 10 hours witch is very, very, very impressive. There are only three points witch are semi optimal. The reflecting display is not my favorite option. And if you use the iPad in the Sun in became a little bit hot and shuts himself down. The iBook store of Switzerland only host’s only free book from the Gutenberg project. As you can imagine Nathan the wise from Lessing is note my favorite bed lecture. </p>
<p> <span id="more-1738"></span>
<p>My top 5 apps for the iPad are:</p>
<p>FunBox: It is an very simple app. There are 60 buttons each of the buttons play’s a funny sound.    <br /><a href="http://linktoapp.com/FunBox" target="_blank">fun box</a></p>
<p>GoodReader is for my case the best eBook reader for the iPad. I assume you don’t need it if you buy books in the Apple Store. At the moment I buy e-books on the Exlibris web store and print the Adobe DRM contaminated files to a pdf printer (Freepdf) and send it to GoodReader.    <br /><a href="http://linktoapp.com/GoodReader" target="_blank">GoodReader</a></p>
<p>NewsRack (thx Dani for the hint) is very nice RSS reader. A very nice feature is the sync with the Google reader. The reader can cash posts and pictures.</p>
<p>PocketCAS is a very nice function plotter. Which is very usefully in my studies at the university of Lucerne   <br /><a href="http://linktoapp.com/PocketCAS" target="_blank">PocketCAS</a></p>
<p>Dropbox the best way to keep your files in sync.   <br /><a href="http://linktoapp.com/dropbox" target="_blank">dropbox</a></p>
<p>After all I like the iPad and give him 4.5 geeks from max 5 geeks</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/12/ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
