<?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/"
	>

<channel>
	<title>jhollingworth</title>
	<atom:link href="http://jhollingworth.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://jhollingworth.com</link>
	<description>a blog about my life (twitter.com/jhollingworth)</description>
	<pubDate>Wed, 25 Aug 2010 20:17:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using extension methods with MSpec</title>
		<link>http://jhollingworth.com/?p=127</link>
		<comments>http://jhollingworth.com/?p=127#comments</comments>
		<pubDate>Fri, 07 May 2010 13:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[MSpec]]></category>

		<category><![CDATA[ideas]]></category>

		<category><![CDATA[Bdd]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=127</guid>
		<description><![CDATA[I was playing around with using extension methods within my mspec tests and think I have found a nice way of descriptively setting up variables]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D127"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D127&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I was playing around with using extension methods within my mspec tests and think I have found a nice way of descriptively setting up variables:</p>
<script src="http://gist.github.com/393381.js"></script>
<p>I am not too sure about the scanability of the tests since it requires a bit of jumping around to find out what is going on however I do like that the test is more English than C# <img src='http://jhollingworth.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=127</wfw:commentRss>
		</item>
		<item>
		<title>Machine.Specifications.BestPractices</title>
		<link>http://jhollingworth.com/?p=112</link>
		<comments>http://jhollingworth.com/?p=112#comments</comments>
		<pubDate>Fri, 07 May 2010 12:45:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[MSpec]]></category>

		<category><![CDATA[Bdd]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=112</guid>
		<description><![CDATA[Every once in a while a new evolution of tools comes along which makes the development of software substantially easier, simpler and funner. This happened with WPF, Monorail/ASP.NET MVC, Moq, OpenRasta and now MSpec. I'm not one for hyperbole but I think that MSpec has significantly improved the quality, readability and maintainability of my tests.

There are a lot of articles about how to get started with MSpec so there is little point writing yet-another-beginners-guide-to-mspec. Instead I thought I would share my best practices and general thoughts about MSpec. Much of this is just a re-iteration of points that Aaron has made on various places but has not been put into a central place.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D112"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D112&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Every once in a while a new evolution of tools comes along which makes the development of software substantially easier, simpler and funner. This happened with WPF, Monorail/ASP.NET MVC, Moq, OpenRasta and now MSpec. I&#8217;m not one for hyperbole but I think that MSpec has significantly improved the quality, readability and maintainability of my tests.</p>
<p>There are a lot of articles about how to get started with MSpec so there is little point writing yet-another-beginners-guide-to-mspec. Instead I thought I would share my best practices and general thoughts about MSpec. Much of this is just a re-iteration of points that Aaron has made on various places but has not been put into a central place.</p>
<p><strong>Core philosophies of MSpec</strong></p>
<ul>
<li><strong>Simple</strong> If you look at a lot of NUnit style tests, they are often incredibly complex and difficult to understand. I often have to read through lots of setups, methods, etc just to understand what is going on. You should strive to keep things as simple as physically possible. Ideally you should never have to navigate around away from the current spec to understand what is going on.</li>
<li><strong>Scannability</strong> You should be able to easily scan a spec and understand what is going on. Everything that is happening in the spec should be clear to the developer so when they come to maintain the class they can worry about writing more specs rather than figuring out how to add them.</li>
<li><strong>Anti-syntax</strong> MSpec tries as hard as possible to stop you from writing C#. In fact pretty much the only bit of C# you have to know is the () =&gt; (or as SerialSeb calls it, the penis operator). This allows you to concentrate on describing the behaviours you want the system under test to exhibit rather than writing C#.</li>
<li><strong>Best practices</strong> The syntax for MSpec forces you into using best practices e.g. by using lambdas, you often find yourself wanting to write single line assertations thus only testing a single thing at a time. Also, it has the whole arrange, act, assert pattern embedded in via the Establish, Because, It keywords (although this is common amongst all BDD frameworks. By making it harder to do things the wrong way, it is less prone to abuse and so even novice developers tend to write better tests.</li>
</ul>
<p><strong>Base class best practices</strong></p>
<p><strong></strong>The old school Mspec way to write specs was to encapsulate states in base classes, e.g. class When_a_users_email_is_invalid : with_an_invalid_email {}. This makes it harder to scan the spec and understand what is going on so this pattern has been discouraged by Aaron. Instead he suggestsyou should ideally have no base class whatsoever if the state you are testing is simple enough to be formed with a couple of lines. This is a pattern you should strive for but often there are a significant number of specs which all share some common variables, set up and events. When this is the case it is advisable to create a base class which contains any common set up (Aaron gives an example) with the name {ClassUnderTest}Context/Spec (We use context whereas Aaron uses Spec, this is down to personal choice).</p>
<p>The context should contain common objects that the class under test depends on and put them into the state the specification requires them to be in. If these objects need to be accessed via a subclass then expose them via a protected static field (note, not a property; they add unnecessary clutter).</p>
<p>The context should never contain a Because. Even if every single spec used the same same event it is still important for readability to have the actual event explicitly stated in the spec. I also found that when I put the Because in the context, when coming back to maintain the tests I would often want to test a different event meaning I would have to refractor all the existing specs. While I say that you must explicitly state the Because in each spec, the actual implementation can reside in the context. I find myself often using this pattern:</p>
<script src="http://gist.github.com/393348.js"></script>
<p><strong>Establish best practices</strong></p>
<p>The Establish keyword (i.e. the Given in other BDD frameworks) is the &#8220;arrange&#8221; in the &#8220;arrange, act assert&#8221; pattern. Knowing this, you must ensure that the only thing that you place in the Establish is code which for establishing the specific state of the system under test which is required for the expected behaviour defined by the specification. Although wisdom states that code in the Because/It should be terse (ideally one liners) within the Because there are no such restrictions. In complex scenarios the Because can often contain 5-10 LOC. Thankfully (like all keywords) they are inheritable and so you can move common set up into a base context with the order of execution going down the inheritance chain (i.e. base class first, spec last)</p>
<p><strong>Because best practices</strong></p>
<p><strong></strong>The code within the Because (i.e. the When/act) method should contain the event which causes the behaviour we are requiring e.g. invocation of a method/event. One issue I often see is people setting variables within the Because, unless setting that variable causes the event under test to occur (i.e. if it is a property with logic in the code behind) then that code should go in the Establish since it is establishing the state of the system under test and not causing the behaviour to actually occur. I would go as far as saying you should only allow invocation of methods/events/properties with logic in backing fields within your Because statement. Another further smell is when the Because statement is more than 1-2 lines. If this is the case, your are probably testing too many things at once and should re-evaluate the scope of the specification and/or refactor the system under test.</p>
<p>With regards to handling exceptions caused by an event, the advice on the MSpec GitHub page says that you should catch all exceptions and then handle each case individually. e.g.</p>
<script src="http://gist.github.com/393350.js"></script>
<p>However, unless you specifically state that the system under test should not throw an exception (e.g. It should_not_throw_an_exception = () =&gt; Exception.ShouldBeNull()) it often leads to the system throwing exceptions without you knowing. The intermediary solution to this has been to add a boolean to state whether we are expecting an exception in the spec e.g.</p>
<script src="http://gist.github.com/393352.js"></script>
<p>Personally I think this is pretty ugly and so I have been playing around on my fork of MSpec with this syntax:</p>
<script src="http://gist.github.com/393353.js"></script>
<p>Essentially the Expecting.Exception() method would tell the runner to catch any exceptions thrown from the Because action and place it in the Thrown.Exception property. What do you think? I would love some feedback on this syntax.</p>
<p><strong>It best practices</strong></p>
<p>The It&#8217;s (i.e. the Then/Assert) are where you describe the desired behaviour of the system under test. The name should be a descriptive sentence of a single desired behaviour you want to occur when the system is in the state established by the Establish and the event that occurred in the Because. The actual code for each It should only contain assertions, e.g. Exception.ShouldBeOfType(), Result.ShouldEqual(1), etc. It should not contain any other forms of code, e.g. clean up code/further events. Ideally each It should be a one liner since you should only be testing one thing at once. There are exceptions to this rule, however, if you find this becomes the norm then you should reconsider how much you testing at any one time.</p>
<p><strong>General Best Practices</strong></p>
<ul>
<li>If you are testing a class always add the subject (e.g. [Subject(typepof(ClassUnderTest))]) to the top of your spec. It just makes life *so* much easier when you want to navigate to the class under test.</li>
<li>Don&#8217;t use Behaves_Like. It massively reduces the scannability of a spec, requiring you to jump around classes to understand what is going on. The creator of MSpec even considered removing it because it contradicts the one of the core design goals of MSpec. DRY in tests is not nearly as important as comprehension.</li>
</ul>
<p><strong>Other thoughts</strong></p>
<ul>
<li>Anyone who has used MSpec with Moq will probably question why the keywords Establish, Because &amp; It were used over Given, When, Then. Although I personally don&#8217;t know myself I am assuming there is wisdom behind the madness. That said I think support for both set&#8217;s of keywords would defiantly make life easier for people using these combination of tools. It is something I have added to my fork of MSpec and have found it makes life significantly easier (I actually stole the idea from Gary Shutler)</li>
<li>There are a lot of really good ancillary tools being built to support MSpec (e.g. Machine.Specifications.AutoMocking,  Machine.Specifications.MVC). I am really excited about how the community around this tool is growing and is really good sign for the project. I would thoroughly recommend people both check out these projects and also see what else is missing!</li>
</ul>
<p>As I said at the beginning most of what I have said is not new and some is most probably wrong. However I have found that the current documentation is a little lacking (although it has recently improved) and so I thought it would be good to consolidate it into one place. These are only my thoughts about how you should use MSpec so I would love to hear what other people have to say about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=112</wfw:commentRss>
		</item>
		<item>
		<title>Email Address Validation in .NET</title>
		<link>http://jhollingworth.com/?p=104</link>
		<comments>http://jhollingworth.com/?p=104#comments</comments>
		<pubDate>Fri, 05 Mar 2010 16:28:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=104</guid>
		<description><![CDATA[
			
				
			
		
As Huddle grows we start to see more and more of the edge cases of the world. One bug I had to fix to our email regexp so that it would support single letter domains. Up until now we have been using Haaked&#8217;s regex which has been us well however it doesn&#8217;t validate single letter domains [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D104"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D104&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As <a href="http://huddle.net">Huddle</a> grows we start to see more and more of the edge cases of the world. One bug I had to fix to our email regexp so that it would support single letter domains. Up until now we have been using <a href="haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx">Haaked&#8217;s</a> regex which has been us well however it doesn&#8217;t validate single letter domains so we needed a better solution.</p>
<p>The solution was pretty stupidly simple actually, the .net framework already supports email validation!</p>
<pre name="code" class="c#">

try
{
   new MailAddress(&quot;foo@huddle.net&quot;);
   return true;
catch
{
   return false;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=104</wfw:commentRss>
		</item>
		<item>
		<title>My crazy (probably very stupid) idea for an mvc language</title>
		<link>http://jhollingworth.com/?p=83</link>
		<comments>http://jhollingworth.com/?p=83#comments</comments>
		<pubDate>Thu, 04 Mar 2010 14:29:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=83</guid>
		<description><![CDATA[I'm not certain why but for a while now I've really wanted to write a sort of python/ruby-esque DSL on top of ASP.NET MVC. I am probably going a little crazy and this is a dumb idea but I thought I might as well write it down and get it out of my system.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D83"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D83&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;m not certain why but for a while now I&#8217;ve really wanted to write a sort of python/ruby-esque DSL on top of ASP.NET MVC. I am probably going a little crazy and this is a dumb idea but I thought I might as well write it down and get it out of my system.</p>
<p>It would look something like this:</p>
<p>
controller User:<br />
 &nbsp; &nbsp;//Actions are composed of method + name</p>
<p> &nbsp; &nbsp;get Add:</p>
<p>  &nbsp; &nbsp;&nbsp; &nbsp;pass</p>
<p> &nbsp; &nbsp;post Add(userInputModel):</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;(homeInputModel -&gt; User).save</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;redirect controller:home, view:foo</p>
<p><br/></p>
<p>
//Automatic transformation of types (e.g. view model -&gt; domain object)</p>
<p>transformation HomeInputModel -&gt; User:</p>
<p> &nbsp; &nbsp;HomeInputModel.Name &lt;=&gt; User.Name</p>
<p> &nbsp; &nbsp;HomeInputModel.Email &lt;=&gt; User.Email</p>
<p> &nbsp; &nbsp;HomeInputModel.Password &lt;=&gt; User.Password
</p>
<p><br/></p>
<p>//Validation of domain objects before they are persisted</p>
<p>validate User:</p>
<p> &nbsp; &nbsp;//Basic boolean validation logic</p>
<p> &nbsp; &nbsp;Name.Length &gt; 0</p>
<p> &nbsp; &nbsp;//More complex business logic requiring a code block</p>
<p> &nbsp; &nbsp;Name n:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;if n.First() == &#8216;y&#8217;:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ValidationException &#8220;We don&#8217;t like people who&#8217;s name starts with y&#8221;</p>
<p><br/></p>
<p>
model User:</p>
<p> &nbsp; &nbsp;string Name</p>
<p> &nbsp; &nbsp;email Email //Built in type&#8217;s for common forms of data, e.g. emails, passwords. Enables default validation</p>
<p> &nbsp; &nbsp;password Password</p>
<p> &nbsp; &nbsp;Many&lt;Task&gt; Tasks //Complex db relationships inbuilt
</p>
<p><br/></p>
<p>Underneath this would all compile to C# or IronPython using NHibernate &amp; Asp.net mvc with various custom bits inbuilt. What do you think, am I going a little crazy?</p>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=83</wfw:commentRss>
		</item>
		<item>
		<title>.NET Library Directory</title>
		<link>http://jhollingworth.com/?p=76</link>
		<comments>http://jhollingworth.com/?p=76#comments</comments>
		<pubDate>Fri, 26 Feb 2010 12:49:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[.net]]></category>

		<category><![CDATA[ideas]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=76</guid>
		<description><![CDATA[About a year ago @davidpadbury and I were sitting in a pub drinking and pondering problems with the .net world. One major issue we had was there was no centralised way of discovering .net projects. I am currently thinking about building this as a side project and would love your feedback.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D76"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D76&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<div>
<p>About a year ago <a title="@davidpadbury" href="http://twitter.com/davidpadbury" target="_blank">@davidpadbury</a> and I were sitting in a pub drinking and pondering problems with the .net world. One major issue we had was there was no centralised way of discovering .net projects. If I want to build an REST API, how do I know what libraries are out there? <a title="Google doesn't seem to be that useful " href="http://www.google.co.uk/search?q=c%23+rest+API+library" target="_blank">Google doesn&#8217;t seem to be that useful</a>, so what should you do (Btw, <a title="OpenRasta" href="http://trac.caffeine-it.com/openrasta" target="_blank">OpenRasta</a> is probably the best way to go for a REST API)?</p>
<p>I am currently thinking about building this as a side project and would love your feedback. Currently I&#8217;m thinking it will provide categorization, overview of the project, aggregate of relevant links (wiki, tutorials, news, etc), latest binaries, etc. I was also thinking about building something similar to ruby gem&#8217;s on top. Jeremy Miller actually just <a title="mentioned this in his vision for FuBu" href="http://bit.ly/9L9Yl7" target="_blank">mentioned this in his vision for FuBu</a>. The thought of just typing &#8220;nug install lucene&#8221; get&#8217;s me a little excited <img src='http://jhollingworth.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>What do you think? Would this be a project people would find useful?</p></div>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=76</wfw:commentRss>
		</item>
		<item>
		<title>Programmatically adding log4net appenders</title>
		<link>http://jhollingworth.com/?p=68</link>
		<comments>http://jhollingworth.com/?p=68#comments</comments>
		<pubDate>Tue, 23 Feb 2010 11:25:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=68</guid>
		<description><![CDATA[I needed to programamatically add a log4net appender at runtime, the docs for all of this are all a little fuzzy so just for future reference here is a quick example
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D68"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D68&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I needed to programamatically add a log4net appender at runtime, the docs for all of this are all a little fuzzy so just for future reference</p>
<p><span id="more-68"></span></p>
<pre name="code" class="c#">

class FileCleanerAppender : RollingFileAppender

{

public FileCleanerAppender()

{

File = &quot;Foo.log&quot;;

AppendToFile = false;

RollingStyle = RollingMode.Once;

LockingModel = new MinimalLock();

Name = &quot;SomeAppender&quot;;

Layout = new PatternLayout { ConversionPattern = &quot;%m&quot; };

ActivateOptions();

}

}

((log4net.Repository.Hierarchy.Logger)LogManager.GetLogger(&quot;SomeLogger&quot;).Logger)

.AddAppender(new FileCleanerAppender());
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=68</wfw:commentRss>
		</item>
		<item>
		<title>Let&#8217;s stop talking about alt.net and starting writing code</title>
		<link>http://jhollingworth.com/?p=64</link>
		<comments>http://jhollingworth.com/?p=64#comments</comments>
		<pubDate>Thu, 21 Jan 2010 23:14:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=64</guid>
		<description><![CDATA[
			
				
			
		
I recently read Ian Cooper&#8217;s blog regarding the current state of Alt.net. There has (in my opinion at least) been a growing sense of disillusionment within the alt.net community of late and Ian has given some good arguments for some of the most common complaints. I completely agree with him on the points he made, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D64"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D64&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I recently read <a href="http://twitter.com/icooper">Ian Cooper&#8217;s</a> <a href="http://codebetter.com/blogs/ian_cooper/archive/2010/01/19/whither-alt-net.aspx">blog regarding the current state of Alt.net</a>. There has (in my opinion at least) been a growing sense of disillusionment within the alt.net community of late and Ian has given some good arguments for some of the most common complaints. I completely agree with him on the points he made, Alt.net was and still remains to be an incredibly important part of the .net community. The <a href="http://altnetpedia.com/OverviewWhatIsIt.ashx">principles</a> that<a href="http://twitter.com/laribee"> David Laribee</a> laid out have had a massive impact on the .net landscape; use of alternative languages is common place (Rake seems thankfully to be replacing NAnt), everyone knows how much money and time TDD will save (i&#8217;ve got a little bit of addiction for that green light) and the owners of JetBrains will be happy to hear that any dev worth his salt knows the R# was written by god himself.</p>
<p>My issues with alt.net arises from the fact that we seem to talk about the same things over and over and over and over again. I get it, IoC, ReST and TDD are all awesome but you are preaching to the converted! Yes, there are many people out there that have never used these tools and do not understand their benefits. Unfortunately very few (if any) of those people actually come to these events because they just don&#8217;t care that much about it. I understand that this is a battle some people want to fight but not me, I&#8217;m more interested in writing code. Personally I feel we must accept that people who actually give a damn about code are in the minority and move on to much more interesting things.</p>
<p>What about new members to the alt.net community you might ask? From people I have spoken to, the learning curve to entering the Alt.net community is actually quite high. There is also a degree of elitism; try telling an alt.net&#8217;er you don&#8217;t know what IoC is and enjoy the look of horror on their face. We need to lower the barrier to entering the community and make a more active effort to include new members who are genuinely interested in writing good code. You never know they could build the best thing since sliced MVC.</p>
<p>London is very lucky to have lots of people doing free talks tools that they have created/played with (many thanks to <a href="http://skillsmatter.com/">skillsmatter</a> for helping organising them). These talks are really important in helping exposing developers to new technologies but what about ideas/skills which are difficult to distill into a 30min talk e.g. how to create a well architected app? what&#8217;s the best way to test a legacy app? These sort of practical skills are ultimately much more important than using some new technology yet there seems to little available knowledge. If people are genuinely interested in helping to build a better .net community then I feel we need to stop talking about the alt.net principles and start looking at how we can apply them to actual problems.</p>
<p>Alt.net has produced all these great ideas which people have taken on board and gone off and built some really cool things. I think we need to start sharing what we have learnt in a format which encourages sharing of practical knowledge between developers.</p>
<p>So what am I proposing? Put simply I think we should have a way for people to publish problems/ideas they have which that require a technical implementation. These ideas can be anything really (e.g. a game, problem at work, etc). Ideally though they should be something which is a bit of fun (we spend all day at work doing boring dev work, this should be about having fun writing code). If other people are interested in the idea then you can work together (whether in the same place or remotely) on the project. If there are specific skills that you dont have but need then you should be able to contact the community and find a specialist (e.g. solr, BDD) who can give you some guidance. Every month we can all meet up and demo our projects (similar to what Y. Combinator does). This gives us a chance to get together, discuss our problems &amp; solutions and get some advice from other devs (oh and a good excuse for a drink).</p>
<p>I think if we concentrate more on writing actual code to solve fun problems, using the alt.net principles and community to help build the best solution, then we would all greatly benifit. What do you think? Would love to hear your thoughts!</p>
<p>James</p>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=64</wfw:commentRss>
		</item>
		<item>
		<title>FluentIoC 0.1 Released!</title>
		<link>http://jhollingworth.com/?p=7</link>
		<comments>http://jhollingworth.com/?p=7#comments</comments>
		<pubDate>Sat, 03 Jan 2009 00:20:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[fluentioc]]></category>

		<category><![CDATA[ioc]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=7</guid>
		<description><![CDATA[
			
				
			
		
A major problem I&#8217;ve found at huddle was what a pain in the arse configuring IoC using xml is! So instead of moaning about it I decided to write a new library called FluentIoC to make my life a bit easier.
The main aim&#8217;s of the project were

Not use any xml
Make it easy to configure and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D7"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D7&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A major problem I&#8217;ve found at <a href="http://www.huddle.net/">huddle</a> was what a pain in the arse configuring IoC using xml is! So instead of moaning about it I decided to write a new library called <a href="http://code.google.com/p/fluentioc/">FluentIoC</a> to make my life a bit easier.</p>
<p>The main aim&#8217;s of the project were</p>
<ul>
<li>Not use any xml</li>
<li>Make it easy to configure and use IoC</li>
<li>Easy to register multiple services &amp; components</li>
<li>Trying to keep DRY</li>
</ul>
<p>Here is a quick example of how to quickly get up and running</p>
<pre name="code" class="c#">

IoC.Configure(c =&gt;

c.Register&lt;IBar&gt;()
.ImplementedBy&lt;Bar&gt;()
.SetProperty(b =&gt; b.Message = &quot;Lamda&#039;s rocks!&quot;)
.UsingFactory&lt;BarFactory&gt;(f =&gt; f.CreateBar()),

c.RegisterAssembly(&quot;Project.Services&quot;)
.ImplementedBy(&quot;Project.Components&quot;)
);

IoC.Resolve&lt;IFoo&gt;();
</pre>
<p>I have just completed my third re-write of it and I think it&#8217;s finally ready for other developers to have a look at. We are currently using it in production so the code is pretty stable but I&#8217;m still going to call it a beta for a little while.</p>
<p>It currently uses Castle&#8217;s Windsor but I have wrapped everything Windsor specifc behind interfaces so it shouldn&#8217;t be too much extra work to get it working with Spring.Net or any of the other .NET IoC frameworks.</p>
<p>You can get the code from the <a href="http://code.google.com/p/fluentioc/">project home</a>, which also contains <a href="http://code.google.com/p/fluentioc/w/list">all the documentation</a>. Let me know what you think (my favorite type of feedback is checkin&#8217;s! ;))</p>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>New blog</title>
		<link>http://jhollingworth.com/?p=5</link>
		<comments>http://jhollingworth.com/?p=5#comments</comments>
		<pubDate>Fri, 02 Jan 2009 23:43:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=5</guid>
		<description><![CDATA[
			
				
			
		
Now that i&#8217;m not a student anymore I&#8217;ve decided that I can actually afford the £3.41/month to host my own blog so I&#8217;m moving from my old blog to here!
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D5"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D5&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Now that i&#8217;m not a student anymore I&#8217;ve decided that I can actually afford the £3.41/month to host my own blog so I&#8217;m moving from <a href="http://jhollingworth.wordpress.com">my old blog</a> to here!</p>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=5</wfw:commentRss>
		</item>
		<item>
		<title>ASP.NET Calender Validation</title>
		<link>http://jhollingworth.com/?p=3</link>
		<comments>http://jhollingworth.com/?p=3#comments</comments>
		<pubDate>Fri, 05 Dec 2008 20:28:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[c# asp.net calender validation]]></category>

		<guid isPermaLink="false">http://jhollingworth.com/?p=3</guid>
		<description><![CDATA[
			
				
			
		
Today I need to validate that a user had entered a date in an asp.net calender only to find that there were no solutions for it so for future reference, if you want a calendar validator use the following:


public class CalendarValidator : BaseValidator
{
	protected override bool ControlPropertiesValid()
	{
		return true;
	}

	protected override bool EvaluateIsValid()
	{
		var control = Parent.FindControl(ControlToValidate) as Calendar;

		if(null [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D3"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjhollingworth.com%2F%3Fp%3D3&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Today I need to validate that a user had entered a date in an asp.net calender only to find that there were no solutions for it so for future reference, if you want a calendar validator use the following:</p>
<pre name="code" class="c#">

public class CalendarValidator : BaseValidator
{
	protected override bool ControlPropertiesValid()
	{
		return true;
	}

	protected override bool EvaluateIsValid()
	{
		var control = Parent.FindControl(ControlToValidate) as Calendar;

		if(null == control)
		{
			throw new NullReferenceException(
				string.Format(”Could not find the control with id {0} on the page”, ControlToValidate)
			);
		}

		if(DateTime.MinValue == control.SelectedDate)
		{
			return false;
		}

		return true;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jhollingworth.com/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
	</channel>
</rss>
