<?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>Codelinq</title>
	<atom:link href="http://codelinq.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codelinq.com</link>
	<description>just one geeks blatherings</description>
	<lastBuildDate>Mon, 27 Jun 2011 03:29:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>I&#8217;m on the devlink 2011 front page!</title>
		<link>http://codelinq.com/blog/2011/06/27/im-on-the-devlink-2011-front-page/</link>
		<comments>http://codelinq.com/blog/2011/06/27/im-on-the-devlink-2011-front-page/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 03:28:21 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codelinq.com/?p=79</guid>
		<description><![CDATA[So one thing I love doing at devlink and codestock conferences is going to the open spaces technology conference. It&#8217;s kind of a conference within a conference.  When the 2011 devlink conference page went up, the first thing I noticed was that I (along with a few friends) were on the front page.  Seeing as [...]]]></description>
			<content:encoded><![CDATA[<p>So one thing I love doing at devlink and codestock conferences is going to the open spaces technology conference. It&#8217;s kind of a conference within a conference.  When the 2011 devlink conference page went up, the first thing I noticed was that I (along with a few friends) were on the front page.  Seeing as its getting close to the conference, I decided to snag a screenshot of the page for fun.</p>
<p><a href="http://codelinq.com/wp-content/uploads/2011/06/devlink2011.png" title="devlink2011"><img width="300" height="277" src="http://codelinq.com/wp-content/uploads/2011/06/devlink2011-300x277.png" class="attachment-medium" alt="I'm on the devlink 2011 home page" title="devlink2011"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://codelinq.com/blog/2011/06/27/im-on-the-devlink-2011-front-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StructureMap: Dynamically load Registry&#8217;s in a specific order</title>
		<link>http://codelinq.com/blog/2011/03/16/structuremap-dynamically-load-registrys-in-a-specific-order/</link>
		<comments>http://codelinq.com/blog/2011/03/16/structuremap-dynamically-load-registrys-in-a-specific-order/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 04:21:36 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codelinq.com/?p=53</guid>
		<description><![CDATA[Structuremap makes it easy to dynamically load and configure Registry objects at runtime. Here is an example: 1234567891011121314public class Bootstrapper &#123; &#160; &#160; public static void Bootstrap&#40;&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; ObjectFactory.Initialize&#40;init =&#62; &#160; &#160; &#160; &#160; &#123; &#160; &#160; &#160; &#160; &#160; &#160; init.Scan&#40;scan =&#62; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Structuremap makes it easy to dynamically load and configure Registry objects at runtime.</p>
<p>Here is an example:</p>
<div class="codecolorer-container csharp railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Bootstrapper<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Bootstrap<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ObjectFactory<span style="color: #008000;">.</span><span style="color: #0000FF;">Initialize</span><span style="color: #008000;">&#40;</span>init <span style="color: #008000;">=&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; init<span style="color: #008000;">.</span><span style="color: #0000FF;">Scan</span><span style="color: #008000;">&#40;</span>scan <span style="color: #008000;">=&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scan<span style="color: #008000;">.</span><span style="color: #0000FF;">AssembliesFromPath</span><span style="color: #008000;">&#40;</span>path<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scan<span style="color: #008000;">.</span><span style="color: #0000FF;">LookForRegistries</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>However, I ran into a problem where I have multiple registries in multiple Assemblies that need to be registered in a specific order.<br />
<span id="more-53"></span></p>
<p>To solve this problem I created a RegistryOrderAttribute that I can tack onto my registry classes like [RegistryOrder(Order = 1)]</p>
<p>This is what the RegistryOrderAttribute looks like:</p>
<div class="codecolorer-container csharp railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">&#91;</span>AttributeUsage<span style="color: #008000;">&#40;</span>AttributeTargets<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Class</span>, AllowMultiple <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span><br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> RegistryOrderAttribute <span style="color: #008000;">:</span> Attribute<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">int</span> Order <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Then I changed my ObjectFactory Initialization code to find and filter Registry types by the order and add them to the ObjectFactory:</p>
<div class="codecolorer-container csharp railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Ioc<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Bootstrap<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> path<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var registries <span style="color: #008000;">=</span> FindAssemblies<span style="color: #008000;">&#40;</span>path<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Where</span><span style="color: #008000;">&#40;</span>a <span style="color: #008000;">=&gt;</span> a <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0000FF;">SelectMany</span><span style="color: #008000;">&#40;</span>x <span style="color: #008000;">=&gt;</span> x<span style="color: #008000;">.</span><span style="color: #0000FF;">GetTypes</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Where</span><span style="color: #008000;">&#40;</span>t <span style="color: #008000;">=&gt;</span> t<span style="color: #008000;">.</span><span style="color: #0000FF;">IsSubclassOf</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">typeof</span> <span style="color: #008000;">&#40;</span>Registry<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Select</span><span style="color: #008000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t <span style="color: #008000;">=&gt;</span> <span style="color: #008000;">new</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type <span style="color: #008000;">=</span> t,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Attribute <span style="color: #008000;">=</span> t<span style="color: #008000;">.</span><span style="color: #0000FF;">GetCustomAttributes</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">.</span><span style="color: #0000FF;">OfType</span><span style="color: #008000;">&lt;</span>RegistryOrderAttribute<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">FirstOrDefault</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var sortedRegistries <span style="color: #008000;">=</span> registries<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Where</span><span style="color: #008000;">&#40;</span>a <span style="color: #008000;">=&gt;</span> a<span style="color: #008000;">.</span><span style="color: #0000FF;">Attribute</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OrderBy</span><span style="color: #008000;">&#40;</span>a <span style="color: #008000;">=&gt;</span> a<span style="color: #008000;">.</span><span style="color: #0000FF;">Attribute</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Order</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; ObjectFactory<span style="color: #008000;">.</span><span style="color: #0000FF;">Initialize</span><span style="color: #008000;">&#40;</span>init <span style="color: #008000;">=&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var registry <span style="color: #0600FF; font-weight: bold;">in</span> sortedRegistries<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;init<span style="color: #008000;">.</span><span style="color: #0000FF;">AddRegistry</span><span style="color: #008000;">&#40;</span>Activator<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateInstance</span><span style="color: #008000;">&#40;</span>registry<span style="color: #008000;">.</span><span style="color: #0000FF;">Type</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">as</span> Registry<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; ObjectFactory<span style="color: #008000;">.</span><span style="color: #0000FF;">AssertConfigurationIsValid</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> IEnumerable<span style="color: #008000;">&lt;</span>Assembly<span style="color: #008000;">&gt;</span> FindAssemblies<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> path<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> Directory<span style="color: #008000;">.</span><span style="color: #0000FF;">GetFiles</span><span style="color: #008000;">&#40;</span>path<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Where</span><span style="color: #008000;">&#40;</span>file <span style="color: #008000;">=&gt;</span> Path<span style="color: #008000;">.</span><span style="color: #0000FF;">GetExtension</span><span style="color: #008000;">&#40;</span>file<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Equals</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;.exe&quot;</span>, StringComparison<span style="color: #008000;">.</span><span style="color: #0000FF;">OrdinalIgnoreCase</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">||</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Path<span style="color: #008000;">.</span><span style="color: #0000FF;">GetExtension</span><span style="color: #008000;">&#40;</span>file<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Equals</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;.dll&quot;</span>, StringComparison<span style="color: #008000;">.</span><span style="color: #0000FF;">OrdinalIgnoreCase</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Select</span><span style="color: #008000;">&#40;</span>p <span style="color: #008000;">=&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> Assembly<span style="color: #008000;">.</span><span style="color: #0000FF;">LoadFrom</span><span style="color: #008000;">&#40;</span>p<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> T GetInstance<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> ObjectFactory<span style="color: #008000;">.</span><span style="color: #0000FF;">GetInstance</span><span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> IEnumerable<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span> GetAllInstances<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> ObjectFactory<span style="color: #008000;">.</span><span style="color: #0000FF;">GetAllInstances</span><span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://codelinq.com/blog/2011/03/16/structuremap-dynamically-load-registrys-in-a-specific-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOLID Principles: Part 1</title>
		<link>http://codelinq.com/blog/2011/03/08/solid-principles-part-1/</link>
		<comments>http://codelinq.com/blog/2011/03/08/solid-principles-part-1/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 05:16:07 +0000</pubDate>
		<dc:creator>scott</dc:creator>
		
		<guid isPermaLink="false">http://codelinq.com/?p=34</guid>
		<description><![CDATA[On Sunday I arrived home from CodePaLOUsa in Louisville. The first geek conference of the year and it must have lit a fire in me, because when I got home I started building a slide deck titled &#8220;Class Design&#8221;. My original idea for the title was &#8220;SOLID, DI, IoC&#8230; WTF?&#8221;. I have decided to also [...]]]></description>
			<content:encoded><![CDATA[<p>On Sunday I arrived home from CodePaLOUsa in Louisville. The first geek conference of the year and it must have lit a fire in me, because when I got home I started building a slide deck titled &#8220;Class Design&#8221;. My original idea for the title was &#8220;SOLID, DI, IoC&#8230; WTF?&#8221;. I have decided to also put together a blog series covering the topic. This is the first post of the series and serves as a jumping off point.<span id="more-34"></span></p>
<h2>SOLID</h2>
<p>Solid is the acronym given to the 5 principles of class design as defined by <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod" target="_blank">Bob Martin</a>.</p>
<p>SRP &#8211; Single Responsibility Principle</p>
<p>OCP &#8211; Open Closed Principle</p>
<p>LSP &#8211; Liskov Substitution Principle</p>
<p>DIP &#8211; Dependency Inversion Principle</p>
<p>ISP &#8211; Interface Segregation Principle</p>
]]></content:encoded>
			<wfw:commentRss>http://codelinq.com/blog/2011/03/08/solid-principles-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Concentrate for Pomodoro</title>
		<link>http://codelinq.com/blog/2011/02/26/using-concentrate-for-pomodoro/</link>
		<comments>http://codelinq.com/blog/2011/02/26/using-concentrate-for-pomodoro/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 21:50:48 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codelinq.com/?p=21</guid>
		<description><![CDATA[Using the Pomodoro technique has always been one of those things that I try to do with good intentions but fail miserably at. I am easily distracted and need to police myself from getting side tracked. Get Concentrating Today I setup Concentrate for use as a pomodoro timer, distraction blocker and &#8220;nagging boss&#8221;. Step 1: [...]]]></description>
			<content:encoded><![CDATA[<p>Using the Pomodoro technique has always been one of those things that I try to do with good intentions but fail miserably at. I am easily distracted and need to police myself from getting side tracked.</p>
<h2>Get Concentrating</h2>
<p>Today I setup Concentrate for use as a pomodoro timer, distraction blocker and &#8220;nagging boss&#8221;.<span id="more-21"></span></p>
<h3>Step 1: Create a Pomodoro Activity</h3>
<ul>
<li>I created an activity named &#8220;Coding in Windows&#8221; because this will be my pomodoro for when I am writing .Net code.</li>
<li>I set its &#8220;Default time to concentrate&#8221; to 25 minutes.</li>
<li>I added a &#8220;Switch to Space&#8221; action since this will need to put me on my windows desktop (in space 16).
<ul>
<li>Switch to &#8220;Space 16&#8243; on Concentrate.</li>
</ul>
</li>
<li>I added a &#8220;Quit Applications&#8221; action checked &#8220;<strong>Relaunch when done</strong>&#8221; and &#8220;<strong>Block applications while concentrating</strong>&#8221; and added the following apps:
<ul>
<li>TweetDeck</li>
</ul>
</li>
<li>I added a &#8220;Block Websites&#8221; action and added the following domain groups:
<ul>
<li>General Distractions</li>
<li>Social Networks</li>
<li>Video Sites</li>
</ul>
</li>
<li>I added a &#8220;Growl a Message&#8221; action to nag me at a specified interval:
<ul>
<li>Title: &#8220;Still Concentrating?&#8221;</li>
<li>Message: &#8220;Make sure you are focusing.&#8221;</li>
<li>Display: Every 5 minutes</li>
</ul>
</li>
</ul>
<h3>Step 2: Create a Break Time Activity</h3>
<ul>
<li>I created an activity named &#8220;Break Time&#8221;.</li>
<li>I set its &#8220;Default time to concentrate&#8221; to 5 minutes.</li>
<li>I added a &#8220;Growl a Message&#8221; action to tell me when break time is over.
<ul>
<li>Title: &#8220;Breaks Over!&#8221;</li>
<li>Message: &#8220;Get back to work!&#8221;</li>
<li>Display: &#8220;When Done&#8221;</li>
</ul>
</li>
</ul>
<h2>What&#8217;s wrong with this setup?</h2>
<ol>
<li>I have to remember to start Concentrate</li>
<li>I have to remember to start a pomodoro when I sit down to do work.</li>
<li>I have to remember to start the break time activity when I finish my pomodoro.</li>
<li>After breaking for 5 minutes I have to remember to start a pomodoro again.</li>
</ol>
<h3>Possible Solutions:</h3>
<p>Solution for #1: Have Concentrate start on startup.</p>
<p>Solution for #2: Make it a habit so that I always do it.. yup easier said than done.</p>
<p>Solution for #3: AppleScript to the rescue</p>
<ul>
<li>I created an &#8220;Run a Script&#8221; action to the &#8220;Coding for Windows&#8221; pomodoro activity and set to &#8220;Run when done&#8221;</li>
<li>Then added the following script:</li>
</ul>
<div class="codecolorer-container applescript railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="applescript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Concentrate&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">tell</span> activity <span style="color: #009900;">&quot;Break Time&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> concentrate<br />
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span></div></td></tr></tbody></table></div>
<p>Solution for #4: AppleScript to the rescue (again)</p>
<p>This time I didn&#8217;t want to just start a named activity because I may have multiple pomodoro&#8217;s that can be started from the break time pomodoro.</p>
<ul>
<li>I created an &#8220;Run a Script&#8221; action to the &#8220;Break Time&#8221; pomodoro activity and set to &#8220;Run when done&#8221;</li>
<li>Then added the following script:</li>
</ul>
<div class="codecolorer-container applescript railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="applescript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Would you like to concentrate again?&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Yes&quot;</span>, <span style="color: #009900;">&quot;No&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">2</span><br />
<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #ff0033;">the</span> button returned <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #ff0033;">the</span> <span style="color: #0066ff;">result</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #009900;">&quot;Yes&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Concentrate&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">set</span> activityList <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> activities<br />
&nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span><br />
&nbsp; &nbsp; <span style="color: #0066ff;">choose <span style="color: #ff0033; font-weight: bold;">from</span> list</span> activityList <span style="color: #ff0033; font-weight: bold;">with</span> prompt <span style="color: #009900;">&quot;Choose an activity:&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> x <span style="color: #ff0033; font-weight: bold;">in</span> <span style="color: #0066ff;">result</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Concentrate&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">tell</span> activity x <span style="color: #ff0033; font-weight: bold;">to</span> concentrate<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span><br />
&nbsp; &nbsp; <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span><br />
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://codelinq.com/blog/2011/02/26/using-concentrate-for-pomodoro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estimates and Deadline Negotiations</title>
		<link>http://codelinq.com/blog/2010/12/05/estimates-and-deadline-negotiations/</link>
		<comments>http://codelinq.com/blog/2010/12/05/estimates-and-deadline-negotiations/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 10:01:02 +0000</pubDate>
		<dc:creator>scott</dc:creator>
		
		<guid isPermaLink="false">http://codelinq.com/?p=8</guid>
		<description><![CDATA[In 2007, I left a job where I had to regularly give time estimates and meet deadlines that I defined. I was pretty good at estimating my own projects. In the years since, I haven&#8217;t had to give a detailed estimate nor have I had to negotiate a deadline with management or the customer. You [...]]]></description>
			<content:encoded><![CDATA[<p>In 2007, I left a job where I had to regularly give time estimates and meet deadlines that I defined. I was pretty good at estimating my own projects. In the years since, I haven&#8217;t had to give a detailed estimate nor have I had to negotiate a deadline with management or the customer. You see, my project lead was very good at setting deadlines and working with the dev team to get tasks completed on time.</p>
<p>Unfortunately, that project lead now works for Microsoft.<span id="more-8"></span></p>
<p>Last week I was asked by management to estimate the hours for the next release and give them a code-freeze date for my features. I decided to back into a number. First I knew that the customer wanted the release delivered very early Q1/2011. Second I knew I was going on vacation the last week of December and wouldn&#8217;t be back until Jan 3rd.  So I offered up Jan 15th for a code-freeze, and so the negotiations began.  We finally agreed on 12/24 code-freeze, followed by 12/27 internal testing, 1/7 customer testing and a release sometime after that.</p>
<p>Hmm.. its a good thing I work better under pressure.</p>
<p>Even with ZenParticles, my business partner handles the estimates for the most part. I need to step up and sharpen my estimation skills by helping him and even providing detailed estimates for small tasks at Leaf.</p>
<p>I think there is a much better way to estimate than picking a date out of thin air and negotiating&#8230; now to figure out what that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://codelinq.com/blog/2010/12/05/estimates-and-deadline-negotiations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

