<?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>the sleepy dev</title>
	<atom:link href="http://thesleepydev.co.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://thesleepydev.co.uk</link>
	<description>soporific software development</description>
	<lastBuildDate>Sun, 25 Jul 2010 18:14:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Static methods: feel the fear and do it anyway</title>
		<link>http://thesleepydev.co.uk/?p=184</link>
		<comments>http://thesleepydev.co.uk/?p=184#comments</comments>
		<pubDate>Sun, 25 Jul 2010 17:30:33 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://thesleepydev.co.uk/?p=184</guid>
		<description><![CDATA[When your tests go green, it&#8217;s often a good idea to think about tidying up the internals of the method you just added/changed.
One of my favourite things to do here is to extract out meaningful methods from the implementation e.g

if&#40;toolkit.Contains&#40;Tools.Hammer&#41;&#41;
&#123;
    var hammer = toolkit&#91;x.Tool.Hammer&#93;;
    Day.Morning.Do&#40;hammer.Execute&#41;;
    Day.Evening.Do&#40;hammer.Execute&#41;;
 [...]]]></description>
			<content:encoded><![CDATA[<p>When your tests go green, it&#8217;s often a good idea to think about tidying up the internals of the method you just added/changed.<br />
One of my favourite things to do here is to extract out meaningful methods from the implementation e.g</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">if</span><span style="color: #000000;">&#40;</span>toolkit.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span>Tools.<span style="color: #0000FF;">Hammer</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    var hammer <span style="color: #008000;">=</span> toolkit<span style="color: #000000;">&#91;</span>x.<span style="color: #0000FF;">Tool</span>.<span style="color: #0000FF;">Hammer</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
    Day.<span style="color: #0000FF;">Morning</span>.<span style="color: #0600FF;">Do</span><span style="color: #000000;">&#40;</span>hammer.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    Day.<span style="color: #0000FF;">Evening</span>.<span style="color: #0600FF;">Do</span><span style="color: #000000;">&#40;</span>hammer.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    ThisLand.<span style="color: #0000FF;">AllOver</span>.<span style="color: #0600FF;">Do</span><span style="color: #000000;">&#40;</span>hammer.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>&#8230; At the click of an alt-shift-m becomes :</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">if</span><span style="color: #000000;">&#40;</span>IHadAHammer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    IdHammerInThe<span style="color: #000000;">&#40;</span>Day.<span style="color: #0000FF;">Morning</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    IdHammerInThe<span style="color: #000000;">&#40;</span>Day.<span style="color: #0000FF;">Evening</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    AllOverThisLand<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// OK I took that one a bit too far.</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Very often, extracting methods will leave you with a helpful suggestion from our friend resharper: &#8220;This method could be made static&#8221;. I have often noticed a reticence from fellow developers for following this advice. Static methods tend to be considered harmful and seem to take us back to the bad old days of global methods (not to mention global state&#8230;). Added to that, the performance improvement you get is <a href="http://stackoverflow.com/questions/169378/c-method-can-be-made-static-but-should-it/169868#169868">negligible</a> and might smell like unnecessary optimisation. What tends to happen is that ReSharper is ignored (or the message is disabled) and we continue with something else.</p>
<p>Thisc course of action does rather miss the point: the method makes no use of &#8216;this&#8217;. So even if you don&#8217;t put the static keyword in front of it, the method is still basically static anyway. Does that not tell you that maybe that method might not belong here? But where should it go?</p>
<p>This is where the &#8216;do it anyway&#8217; part comes in. Go make the method static. If there are several similar methods (and there usually are), go make all of them static and then look for patterns:</p>
<ul>
<li>A set of functions that take in a type you control:

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">   <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> <span style="color: #0600FF;">static</span> HasExpiredPassword<span style="color: #000000;">&#40;</span>User user<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>...<span style="color: #000000;">&#125;</span>
   <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> <span style="color: #0600FF;">static</span> HasPermissionToEditResource<span style="color: #000000;">&#40;</span>User user, Resource resource<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>...<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Perhaps this reasoning could be part of the User class as instance methods.</li>
<li>Methods which take in a system type as the first parameter, all with the same/similar name, for example:

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span>  <span style="color: #FF0000;">bool</span> IsValidEmailAddress<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> emailAddress<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>...<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> GetEmailHostName<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> emailAddress <span style="color: #000000;">&#41;</span></pre></div></div>

<p>Maybe email address warrants a class of it&#8217;s own containing these methods. The EmailAddress class could end up being a magnet for many other similar methods dotted around other classes too.
</li>
<li>Either of the above but taking in a collection/IEnumerable of the same, e.g. :

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">static</span> MailAddressCollection BuildSenderList<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> emailAddresses<span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">static</span> IEnumerable<span style="color: #008000;">&lt;</span>User<span style="color: #008000;">&gt;</span> GetAllUsersInGroup<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span>User<span style="color: #008000;">&gt;</span> users, Group group<span style="color: #000000;">&#41;</span></pre></div></div>

<p>Here, extension methods are your friend for a quick fix (ReSharper can totally help you out here). Chances are that if &#8216;User&#8217; is part of your domain model, then &#8216;Users&#8217; should be too. So why not create a type representing the collection &#8211; Users, EmailAddresses &#8211; and migrate the static methods there.
</li>
</ul>
<p>Simply by following our refactoring tool&#8217;s suggestion, we have made the code more expressive and readable. The design of our code has fallen into place without us having to think too hard (a very good thing).</p>
<p>
   So what if you can&#8217;t find a way to move around those static methods? I would suggest that you should still go static to acknowledge that the methods are slightly disjunct from the class. Maybe as your codebase grows, you can revisit and find a place for these new concepts.</p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=184</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google letter template</title>
		<link>http://thesleepydev.co.uk/?p=172</link>
		<comments>http://thesleepydev.co.uk/?p=172#comments</comments>
		<pubDate>Sun, 06 Jun 2010 16:29:22 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://thesleepydev.co.uk/?p=172</guid>
		<description><![CDATA[I was hunting for a decent letter template on google docs and could not for the life of me find one. I like to have the recipient address on the left and the sender on the right rather than all on one line. There is a lot of weird stuff in the public templates site!
Anyway, [...]]]></description>
			<content:encoded><![CDATA[<p>I was hunting for a decent letter template on google docs and could not for the life of me find one. I like to have the recipient address on the left and the sender on the right rather than all on one line. There is a lot of weird stuff in the public templates site!</p>
<p>Anyway, here is the template:</p>
<p><iframe width="620" height="170" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://docs.google.com/embeddedtemplate?id=0Adhg3tLfif75ZGc0aHJyeDdfMTE1ZnFtd3E3Y3E"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=172</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spark codec for OpenRasta</title>
		<link>http://thesleepydev.co.uk/?p=120</link>
		<comments>http://thesleepydev.co.uk/?p=120#comments</comments>
		<pubDate>Fri, 29 May 2009 16:10:29 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[openrasta spark]]></category>

		<guid isPermaLink="false">http://thesleepydev.co.uk/?p=120</guid>
		<description><![CDATA[Update
I haven&#8217;t really had the chance to support this too much due to various reasons (new job, laptop with vmware image dying, supreme laziness and attention span issues). Anyway, the project is now on github and (thanks to some work from Lee Henson) is the most up to date: http://github.com/jennifersmith/openrasta-sparkcodec 
Hope that helps you all [...]]]></description>
			<content:encoded><![CDATA[<h3>Update</h3>
<p>I haven&#8217;t really had the chance to support this too much due to various reasons (new job, laptop with vmware image dying, supreme laziness and attention span issues). Anyway, the project is now on github and (thanks to some work from Lee Henson) is the most up to date: <a href="http://github.com/jennifersmith/openrasta-sparkcodec">http://github.com/jennifersmith/openrasta-sparkcodec</a> </p>
<p>Hope that helps you all out and thanks for your interest!</p>
<hr/>
<p>It all started after I went to Sebastian Lambla&#8217;s talk on <a href="http://www.ohloh.net/p/openrasta">OpenRasta</a> at a <a href="http://vbug.co.uk/">VBUG</a> event. I really got into the framework &#8211; it felt to me as a cleaner and lighter way to think about MVC when compared to ASP.NET MVC. At the same time, I really wanted to have look at the <a href="http://dev.dejardin.org/">Spark View Engine</a> as I think the syntax is a breath of fresh air and welcome relief from all the tagsoup we seem to get into when writing MVC views.</p>
<p>When I asked &#8216;Is there a Spark codec for OpenRasta?&#8217; I had the reply &#8216;No, but why don&#8217;t you write one&#8217;. Never one to back down from a challenge I did. And you can download it from <a href="http://code.google.com/p/openrastasparkcodec/">GoogleCode</a> (though I would prefer you grab the trunk cos the latest version is probably already out of date!).</p>
<p><strong>OpenRasta meet Spark, Spark meet OpenRasta</strong><br />
If you are not familiar with either of these projects, then this project probably means nothing to you. If you get one and not the other then read on.</p>
<p><strong>OpenRasta</strong> &#8216;is a Resource-Oriented framework to build MVC-style applications on asp.net 2 and above.&#8217; (I copied this from <a href="http://www.ohloh.net/p/openrasta">here</a>).  Easiest way to get into it I think is to either hear a talk on it, or use <a href="http://svn.caffeine-it.com/openrasta/trunk/doc/content/Tutorials/Create-First-Site.html">this tutorial</a>.</p>
<p>The <strong>Spark View Engine</strong> is written for ASP.NET MVC and provides a slightly alternative syntax for specifying views. Basically it uses an extended set of attributes and tags on top of plain old HTML to let you do crazy things like:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;viewdata</span> <span style="color: #000066;">products</span>=<span style="color: #ff0000;">&quot;IEnumerable[[Product]]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul</span> <span style="color: #000066;">if</span>=<span style="color: #ff0000;">&quot;products.Any()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li</span> <span style="color: #000066;">each</span>=<span style="color: #ff0000;">&quot;var p in products&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${p.Name}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;else<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>No products available<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/else<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Simple, readable and pretty cool I think, when your alternative is a big old mess of tagsoup. Out of all the alternatives, it is definitely the clearest and most logical I have seen so far. Any web-designers/front-end devs out there want to tell me if they agree? </p>
<p><strong>Using the Codec from OpenRasta</strong><br />
In a later post I might choose to talk about my design approach, but when it came to OpenRasta, this approach was very much &#8216;Copy what the webforms codec does&#8217;.  So to use the spark view engine, you start by adding this to the top of your configuration block:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    ResourceSpace.<span style="color: #0000FF;">Uses</span>.<span style="color: #0000FF;">SparkCodec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>This does some behind the scenes magic to register all the stuff you need to use the SparkCodec.</p>
<p>Next, for the resources you want to render using spark, you configure along the lines of:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">ResourceSpace.<span style="color: #0000FF;">Has</span>.<span style="color: #0000FF;">ResourcesOfType</span><span style="color: #008000;">&lt;</span>ShoppingList<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
					.<span style="color: #0000FF;">AtUri</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;/shoppinglist&quot;</span><span style="color: #000000;">&#41;</span>
					.<span style="color: #0000FF;">HandledBy</span><span style="color: #008000;">&lt;</span>ShoppingListHandler<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
					.<span style="color: #0000FF;">AndRenderedBySpark</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;shoppingList.spark&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>&#8230; note the &#8216;AndRenderedBySpark&#8217; extension method there which passes in the name of the spark template you are going to use. The Spark lookup procedure takes in a root folder as part of its configuration and I have defaulted this to &#8216;Views&#8217;. So ShoppingList.spark must exist in the folder views/.</p>
<p>There you are &#8211; you are all ready to start getting Sparky with your OpenRasta. Note that OpenRasta allows you to mix and match your codecs &#8211; so you can just have one or two views rendered using Spark if that is what you want.</p>
<p><strong>Extensions to the Spark syntax</strong></p>
<p>One of the things I liked about OpenRasta was some of the markup extensions that it contains. I.e. you can do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">   Xhtml.<span style="color: #0000FF;">TextBox</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">=&gt;</span>MyResource.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>And through the magic of expressions, the output html is something like:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyResourceTypeName.Name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Whatever the current value of the name is&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The base view class from which all spark views inherit (SparkResourceView) exposes the Xhtml interface so you can just use the extension method as is. However, I thought that seeing as the point of the Spark syntax is to hook tidily into html, I wanted to provide an alternative. So I have used the extensions facility in the Spark View Engine (which was simple once I got the hang of it), to add some custom attributes. Now if your view contains the following:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;viewdata</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;Customer&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;resource.Name&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">anotherattribute</span>=<span style="color: #ff0000;">&quot;somethingelse&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The output becomes:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;viewdata</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;Customer&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Customer.Name&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Fred&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">anotherattribute</span>=<span style="color: #ff0000;">&quot;somethingelse&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Similarly to hook into the URI-resolving stuff in OpenRasta you can have something like:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;viewdata</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;Customer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;resource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Click here to view the customer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">totype</span>=<span style="color: #ff0000;">&quot;IEnumerable&lt;Customer&gt;</span></span>&quot;&gt;Click here to view all customers<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>On render, this figures out the URIs based on what you set up for the resources in question as part of the configuration.</p>
<p>Anyway, this syntax is far from complete &#8211; it works enough to just about power the demo application that I packaged with the codec source so I suggest you take a look at this for more pointers.</p>
<p><strong>Futures</strong><br />
This started as a small pet project but if you want to give me a hand please please do catch up with me on <a href="http://twitter.com/JenniferSmithCo">twitter</a>. The same goes for any other feedback (apart from &#8216;it&#8217;s crap&#8217; &#8211; that would not be very nice). I have a small idea for an application that I wanted to have a go at with OpenRasta and as I get into implementing this I am sure I will come up with a few more extensions to the syntax.</p>
<p>Now it is far too hot and I am going out to get an ice lolly.</p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=120</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Adventures in BDD style testing &#8211; too many scenarios!</title>
		<link>http://thesleepydev.co.uk/?p=87</link>
		<comments>http://thesleepydev.co.uk/?p=87#comments</comments>
		<pubDate>Thu, 30 Apr 2009 06:50:43 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false">http://thesleepydev.co.uk/?p=87</guid>
		<description><![CDATA[I have been attempting to write a big article on my experiences of BDD/ BDD style testing or what ever you want to call it. However, I have learnt that big über articles generally are never finished (by reader or writer) so I have cut it down a bit&#8230;
So I have been using a style [...]]]></description>
			<content:encoded><![CDATA[<p><em>I have been attempting to write a big article on my experiences of BDD/ BDD style testing or what ever you want to call it. However, I have learnt that big über articles generally are never finished (by reader or writer) so I have cut it down a bit&#8230;</em></p>
<p>So I have been using a style of BDD for my current project for a couple of months now. As this was intended to be a &#8217;smart UI&#8217; application (no smirks at the back please&#8230;), I have only picked a few isolated areas that could be separated out and done properly. What I now have is a big mishmash of different styles, tests etc. but overall I am happy with the approach I have taken. As the part of the app I am dealing with has lots of rules, exceptions, caveats etc., expressing these in BDD-style sentences has had a big payoff. Only the other day I was asked how we handle a particular piece of data/conditions and all I had to do was read the names of my tests and I had the answer for them without having to remember anything ( I don&#8217;t remember code I have written 2 days ago, let alone 2 weeks ago!).</p>
<p>Anyway, there are some things I have got wrong. I haven&#8217;t really stuck to a Given->When->Then structure. I seem to have cobbled together the Given/When bits with a few ands. i.e.:</p>
<p><em>When the user requests money from his account and the pin is correct and he has enough money and he requests 10 pounds and he is wearing a brown that then return 10 pounds from the cash machine and debit his account by 10 quid</em></p>
<p>Whereas a better structure may be:</p>
<p><em><strong>Given</strong> that the user is wearing a brown hat <strong>and</strong> he has enough money <strong>and</strong> he has entered the correct pin number, <strong>When</strong> he requests ten pounds <strong>then</strong> a £10 note should be returned from the cash machine <strong>and</strong> user&#8217;s account should be debited by ten pounds<br />
</em></p>
<p>It&#8217;s bit more wordy, but it scans better and more importantly can be converted into some sort of code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> When_user_requests_ten_pounds <span style="color: #008000;">:</span> 
                              User_wearing_brown_hat_and_has_enough_money_and_entered_correct_pin
    <span style="color: #000000;">&#123;</span>
         <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Debit_his_account_with_10_pounds<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
         <span style="color: #000000;">&#123;</span>
         <span style="color: #000000;">&#125;</span>
&nbsp;
         <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Return_10_pounds_from_the_cash_machine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
         <span style="color: #000000;">&#123;</span>
         <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span></pre></div></div>

<p>Anyway this is all well and good until I start getting into counter examples. For example, if I had the following scenario and expected behaviour:</p>
<p><em><strong>Given</strong> that the moon is in the seventh house <strong>and</strong> jupiter aligns with mars, <strong>when</strong> a new age dawns <strong>then</strong> this should be the dawning of the age of aquarius.</em></p>
<p>(the <a href="http://www.lyricsbox.com/5th-dimension-the-lyrics-age-of-aquarius-vv2dwrs.html">original</a> sort of scans better)</p>
<p>I could fulfill the conditions of this slightly bizarre requirement with the following (equally bizarre) code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">       <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> NewAgeDawner
       <span style="color: #000000;">&#123;</span>
             <span style="color: #0600FF;">public</span> NewAge DawnNewAge<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
             <span style="color: #000000;">&#123;</span>
                  <span style="color: #0600FF;">return</span> NewAge<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>OwnedBy<span style="color: #008000;">=</span>Zodiac.<span style="color: #0000FF;">Aquarius</span><span style="color: #000000;">&#125;</span><span style="color: #008000;">;</span>
             <span style="color: #000000;">&#125;</span>
       <span style="color: #000000;">&#125;</span></pre></div></div>

<p>That would essentially cause the tests to pass but is obviously wrong as it happens whether the scenario is set up as described or not (i.e. it always dawns the age of aquarius regardless of position of moon and jupiter/mars alignment). At this point I find it useful to go back to my early electronics lessons and write a bit of a truth table to describe the behaviour I need to see:</p>
<style type="text/css">
/* inline styles mybad */
.truthTable,
.truthTable th,
.truthTable td
{
 border: 1px black solid;
}</p>
<p>.truthTable tr td
{
  border-width: 0 1px;
}
</style>
<table class="truthTable">
<tr>
<th>Moon in 7th</th>
<th>Jupiter aligned with mars</th>
<th>Age of aquarius?</th>
</tr>
<tr>
<td>
               0
          </td>
<td>
              0
          </td>
<td>
              0
          </td>
</tr>
<tr>
<td>
               0
          </td>
<td>
              1
          </td>
<td>
              0
          </td>
</tr>
<tr>
<td>
               1
          </td>
<td>
              0
          </td>
<td>
              0
          </td>
</tr>
<tr>
<td>
               1
          </td>
<td>
              1
          </td>
<td>
              1
          </td>
</tr>
</table>
<p>So even though I only care about the last item in this list (where both conditions are met) I have to write 4 tests. Not that I am complaining at all (not me&#8230;) &#8211; the more test code the better, but given that three of the four outcomes should have the same result, it&#8217;s a lot of duplication. For example, I have some behaviour in my system that sets a couple of fields based on arguments passed in and then persists the object to the database. However, there are a number of states in which the operation cannot succeed and I want to make sure the fields are not changed, and the operation returns a suitable result message explaining why it couldn&#8217;t work. For each of these invalid states, I must write three tests:</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">		[Test]
		public void Result_is_failure()
		{
			Result.Success.ShouldBeFalse();
		}
		[Test]
		public void Error_message_explains_failure_reason()
		{
			Result.Message.ShouldEqual(&quot;Moon is not in the seventh house...&quot;);
		}
		[Test]
		public void Save_not_called()
		{
			MyRepository.SaveWasNotCalled();
		}</pre></div></div>

<p>With the exception of the message (which will change each time), I have to copy paste all these tests for each invalid state. Is this really the right thing to do?</p>
<p>I know we should be free and easy with our test code and write as much as is necessary &#8211; generally ending up with more test code than production code, but by copy pasting?? Is there a better way?</p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=87</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Extension method assertions versus standard assertions</title>
		<link>http://thesleepydev.co.uk/?p=51</link>
		<comments>http://thesleepydev.co.uk/?p=51#comments</comments>
		<pubDate>Fri, 24 Apr 2009 14:03:37 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://thesleepydev.co.uk/?p=51</guid>
		<description><![CDATA[I have been playing around lately with assertions in my  tests and figuring out the best (funnest?) way to work with them. Within the context of BDD style testing there seems to have emerged a style for using extension methods for asserts. As I found out at the SkillsMatter   NBehave talk, NBehave comes [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing around lately with assertions in my  tests and figuring out the best (funnest?) way to work with them. Within the context of BDD style testing there seems to have emerged a style for using extension methods for asserts. As I found out at the <a title="SkillsMatter" href="http://www.skillsmatter.com" target="_self">SkillsMatter </a> <a title="NBehave bdd framework" href="http://nbehave.org/"> NBehave</a> talk, NBehave comes with a set of extension method wrapped assertion methods so I guess that is where the link comes from perhaps.</p>
<p><strong>What do I mean by extension method assertions?</strong></p>
<p>OK so a normal vanilla unit test might check that the conditions of the test are met as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">      Assert.<span style="color: #0000FF;">IsEqual</span><span style="color: #000000;">&#40;</span>foo, bar<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
      Assert.<span style="color: #0000FF;">IsNotNull</span><span style="color: #000000;">&#40;</span>foobar123<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Or if you have been bitten by the fluent bug:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">      Assert.<span style="color: #0000FF;">That</span><span style="color: #000000;">&#40;</span>foo, <span style="color: #008000;">Is</span>.<span style="color: #0000FF;">EqualTo</span><span style="color: #000000;">&#40;</span>bar<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
      Assert.<span style="color: #0000FF;">That</span><span style="color: #000000;">&#40;</span>foobar123, <span style="color: #008000;">Is</span>.<span style="color: #0000FF;">NotNull</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Anyway, if you use the extension methods approach you will typically have defined somewhere something like:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">class</span> AssertionExtensions
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> T ShouldBe<span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span>T<span style="color: #008000;">&amp;</span>gt<span style="color: #008000;">;</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span> <span style="color: #FF0000;">object</span> val<span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			Assert.<span style="color: #0000FF;">That</span><span style="color: #000000;">&#40;</span>val, <span style="color: #008000;">Is</span>.<span style="color: #0000FF;">InstanceOf</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">typeof</span> <span style="color: #000000;">&#40;</span>T<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #0600FF;">return</span> <span style="color: #000000;">&#40;</span>T<span style="color: #000000;">&#41;</span> val<span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> ShouldBeNull<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span> <span style="color: #FF0000;">Object</span> val<span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			Assert.<span style="color: #0000FF;">That</span><span style="color: #000000;">&#40;</span>val, <span style="color: #008000;">Is</span>.<span style="color: #0600FF;">Null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span></pre></div></div>

<p>Leaving your asserts looking something like:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">   foo.<span style="color: #0000FF;">ShouldEqual</span><span style="color: #000000;">&#40;</span>bar<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
   foobar123.<span style="color: #0000FF;">IsNotNull</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>You could even read that back and it might make some sort of sense: &#8220;Foo shoud equal bar&#8221;. &#8220;Foobar123 should not be null&#8221;. As far as C# goes, that is pretty damn readable (I see you Ruby-heads smirking at the back!).</p>
<p><strong>Taking it a bit further</strong></p>
<p>I have started to get into BDD style testing for project number one (well, the parts that aint smart-ui anyway), and I have got slightly carried away with my extension method asserts. As each test is testing a different outcome of the behaviour under test, I think the best tests only have one line of code in them. Something like:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>TestFixture<span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">public</span> When_user_sends_article_to_a_friend 
<span style="color: #000000;">&#123;</span>
       ....
       <span style="color: #000000;">&#91;</span>Test<span style="color: #000000;">&#93;</span>
       <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Email_is_sent_to_the_friends_address_via_email_service<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
       <span style="color: #000000;">&#123;</span>
               EmailService
                    .<span style="color: #0000FF;">EmailWasSent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
                    .<span style="color: #0000FF;">To</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Fred@flintstone.com&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
       <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>(For the record my assertions have never got to more than one method, but it would be possible right!).</p>
<p>Arguably you could just say this is a bit of syntactic sugar, but I think it hides the complexity of what it means to satisfy these requirements&#8230; which I believe is A Good Thing. At first glance, I should be able to read this code out loud and have half a chance at figuring out the intentions of what was supposed to be tested. I don&#8217;t need to worry whether EmailService is a stub/mock/stubbed-mock(!) &#8211; and indeed if it starts life as a mock then progresses to a concrete, this test doesn&#8217;t need to change.</p>
<p><strong>It&#8217;s not for BAs</strong><br />
One argument I have heard for extension-method assertions is that it &#8216;makes it readable for business analysts&#8217;. Now, if your business analyst happens to be a former programmer, you might be on to something. However, that is not usually the case, our BAs can&#8217;t understand it and such a claim rather detracts from the usefulness of these methods.<br />
Really what we should be thinking about is the how readable extension method assertions are for us! If someone asks me &#8216;what does this function do&#8217; and I wrote it about 10 days ago (this is about the maximum time I can remember anything about something I have created), I can find out easily and quickly. Similarly, the poor dev who comes after me could probably have a go at comprehending it too. </p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=51</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My morning&#8217;s work</title>
		<link>http://thesleepydev.co.uk/?p=54</link>
		<comments>http://thesleepydev.co.uk/?p=54#comments</comments>
		<pubDate>Fri, 17 Apr 2009 12:57:00 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://thesleepydev.co.uk/?p=54</guid>
		<description><![CDATA[If only I could afford a real artist&#8230;

]]></description>
			<content:encoded><![CDATA[<p>If only I could afford a real artist&#8230;</p>
<p><img class="alignnone size-full wp-image-53" title="thesleepydevlogo" src="http://thesleepydev.co.uk/wp-content/uploads/2009/04/thesleepydevlogo.gif" alt="thesleepydevlogo" width="322" height="482" /></p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=54</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A basic problem of mapping</title>
		<link>http://thesleepydev.co.uk/?p=29</link>
		<comments>http://thesleepydev.co.uk/?p=29#comments</comments>
		<pubDate>Mon, 13 Apr 2009 16:31:49 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://thesleepydev.wordpress.com/?p=29</guid>
		<description><![CDATA[So I have a very basic problem with no doubt a very basic solution which at the present time is eluding me.
For some reason on this project 90% of the objects I work with are already in existence (in the database as well as conceptually in space-time !). Therefore most creation code for my entities [...]]]></description>
			<content:encoded><![CDATA[<p>So I have a very basic problem with no doubt a very basic solution which at the present time is eluding me.</p>
<p>For some reason on this project 90% of the objects I work with are already in existence (in the database as well as conceptually in space-time !). Therefore most creation code for my entities is just for the purposes of reconstituting an object from a DTO. This is where I am having the problem. In a piece of functionality I haven&#8217;t even fully implemented yet I have the following:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> MyEntityDTO
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> OneField <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> AnotherField <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> MyEntity
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">readonly</span> <span style="color: #FF0000;">int</span> oneField<span style="color: #008000;">;</span>
	<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">readonly</span> <span style="color: #FF0000;">string</span> anotherField<span style="color: #008000;">;</span>
	<span style="color: #0600FF;">public</span> MyEntity<span style="color: #000000;">&#40;</span>MyEntityDTO dto<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		oneField <span style="color: #008000;">=</span> dto.<span style="color: #0000FF;">OneField</span><span style="color: #008000;">;</span>
		anotherField <span style="color: #008000;">=</span> dto.<span style="color: #0000FF;">AnotherField</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">public</span> MyEntityDTO CreateDTO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">return</span> <span style="color: #008000;">new</span> MyEntityDTO<span style="color: #000000;">&#40;</span>...<span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	... <span style="color: #0000FF;">insert</span> domain logic here...
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And a test akin to:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>TestFixture<span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> When_MyEntity_Is_Reconstituted_From_DTO
<span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #0600FF;">private</span> MyEntityDTO DTO <span style="color: #000000;">&#123;</span>get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span><span style="color: #000000;">&#125;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> When<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		DTO <span style="color: #008000;">=</span> Builder.<span style="color: #0000FF;">CreateWithAllFieldsFilledIn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		Result <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MyEntity<span style="color: #000000;">&#40;</span>DTO<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#91;</span>Test<span style="color: #000000;">&#93;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> AnotherField_Is_Copied_In<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		Result.<span style="color: #0000FF;">AnotherField</span>.<span style="color: #0000FF;">ShouldEqual</span><span style="color: #000000;">&#40;</span>DTO.<span style="color: #0000FF;">AnotherField</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>&#8230; and a similar test to test persistence to a DTO.</p>
<p>OK for starters, but I know that somewhere down the line, &#8216;MyEntity&#8217; is going to get quite a few more properties and value objects. So when I add a new property I have to do the following:</p>
<ul>
<li>Write a new test to test that the DTO property is copied to the MyEntity instance (thanking goodness for BDD style testing which makes this very simple)</li>
<li>Write a new test to test that the MyEntity property is copied to the DTO</li>
<li>Implement the property in the DTO</li>
<li>Implement the property in MyEntity</li>
</ul>
<p>Already this is getting my lazy-senses tingling. It&#8217;s only one property! What happens if I refactor three properties into a value object or add a dozen more. I can&#8217;t guarentee that future me is going to want to go through all those steps. Problem is I can&#8217;t see any way to simplify this in just code alone.</p>
<p>In an ideal world, I would use NHibernate, do away with the DTO and let my mapping do the work. However, this would contravene the <a href="http://en.wikipedia.org/wiki/Not_Invented_Here">NIH</a> rule of the current project I am working on. My data access layer is all hand-coded SQL so I try and keep it&#8217;s work to the absolute bare minimum (still seems to be where 99% of the bugs lie but that&#8217;s another story&#8230;).</p>
<p>Another idea would be to use <a href="http://automapper.codeplex.com/">automapper</a> (which I have been meaning to try for a while now) but I am stuck in 2.0 so no go there I presume.</p>
<p>I guess at the end of the day most coding problems are social &#8211; maybe I should be using NHibernate here and screw NIH syndrome!</p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=29</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>QCon 2009</title>
		<link>http://thesleepydev.co.uk/?p=8</link>
		<comments>http://thesleepydev.co.uk/?p=8#comments</comments>
		<pubDate>Sun, 08 Mar 2009 21:01:52 +0000</pubDate>
		<dc:creator>thesleepydev</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[qcon]]></category>

		<guid isPermaLink="false">http://jennifersmith.co.uk/?p=8</guid>
		<description><![CDATA[
I am attending QCon London 2009 next week and I am in the process of deciding which bits I will attend. Although this is the first proper conference I have been able to get to (benefits of controlling your own training budget!), I am aware that sometimes you can end up going to less than [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://qconlondon.com/"><img class="size-medium wp-image-12 alignnone" title="QCon Logo" src="http://jennifersmith.co.uk/wp-content/uploads/2009/03/qcon_logo_london_2009-300x174.jpg" alt="QCon London 2009" width="174" height="101" /></a></p>
<p>I am attending QCon London 2009 next week and I am in the process of deciding which bits I will attend. Although this is the first proper conference I have been able to get to (benefits of controlling your own training budget!), I am aware that sometimes you can end up going to less than you thought, but it&#8217;s good to have a plan. Aside from keynotes, my plan is currently:</p>
<p><strong>Wednesday</strong></p>
<p>Particularly keen on the <a href="http://qconlondon.com/london-2009/tracks/show_track.jsp?trackOID=220">Agile Track</a> on this day, particularly the Michael Feather&#8217;s <a href="http://qconlondon.com/london-2009/presentation/Test+Driven+Development%3A+Ten+Years+Later">TDD retrospective</a> but some of the <a href="http://qconlondon.com/london-2009/tracks/show_track.jsp?trackOID=231">Emerging Languages</a> stuff : particularly <a href="http://qconlondon.com/london-2009/presentation/Real+World+IronPython">Iron Python</a> and Martin Fowler&#8217;s <a href="http://qconlondon.com/london-2009/presentation/Three+years+of+real-world+Ruby">Ruby talk</a>. Might check out some of the <a href="http://qconlondon.com/london-2009/tracks/show_track.jsp?trackOID=227">Web as a Platform</a> stuff too.</p>
<p><strong>Thursday</strong></p>
<p>Mainly dominated by the <a href="http://qconlondon.com/london-2009/tracks/show_track.jsp?trackOID=228">DDD </a>track today. I must try and finish &#8216;the book&#8217; before I go (it&#8217;s really good and I can&#8217;t believe it is so long before I read it). Sadly this means I will miss the Guardian Architecture talk, but maybe <a href="http://qconlondon.com/london-2009/presentation/Rebuilding+guardian.co.uk+with+DDD">&#8216;Rebuilding guardian.co.uk with DDD&#8217;</a> will be more interesting/relevant. I also hope I can make some of the <a href="http://qconlondon.com/london-2009/tracks/show_track.jsp?trackOID=221">Agile organisational patterns</a> stuff too. Everything else looks quite interesting but the DDD stuff will probably be the biggest draw!</p>
<p><strong>Friday</strong></p>
<p>If I haven&#8217;t dropped from exhaustion, I like the look of the <a href="http://qconlondon.com/london-2009/tracks/">DSLs track</a> and <a href="http://qconlondon.com/london-2009/tracks/show_track.jsp?trackOID=232">Historically Bad Ideas</a> (at the least I think it would make me feel better about some of mine&#8230;). Obviously, Tony Hoare&#8217;s <a href="http://qconlondon.com/london-2009/presentation/Null+References%3A+The+Billion+Dollar+Mistake">null reference</a> talk is an absolute must and <a href="http://qconlondon.com/london-2009/presentation/Traditional+Programming+Models%3A+Stone+knives+and+bearskins+in+the+Google+age">Traditional Programming Modules&#8230;</a> will make me feel better about some of my more recent [enforced] working practices (I say no more than that). Might check out <a href="http://qconlondon.com/london-2009/presentation/DSLs+in+Groovy%3A+Say+What+You+Mean%2C+Mean+What+You+Say">Groovy</a> too&#8230;</p>
<p>Sadly, I can&#8217;t attend bullseye as after this, as we are off to walk a chunk of the South Downs way so I have to get my skates on to Brighton!</p>
<p>I think there is going to be some interesting stuff here. I picked QCon mainly for the interesting subjects and people that are talking. I prefer to attend the general software development talks rather than those relating to a specific technology as I find them more interesting, but I will try and make a bit of a mix of general/technology specific topics where I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://thesleepydev.co.uk/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
