<?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 Iterator</title>
	<atom:link href="http://theiterator.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://theiterator.com</link>
	<description>This is my blog. There are many like it, but this one is mine.</description>
	<lastBuildDate>Fri, 23 Sep 2011 06:35:16 +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>NHibernate and the dark secrets of unneeded cascaded updates</title>
		<link>http://theiterator.com/2011/09/nhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates/</link>
		<comments>http://theiterator.com/2011/09/nhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 06:35:16 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cascade]]></category>
		<category><![CDATA[nhibernate]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=122</guid>
		<description><![CDATA[I was having trouble with NHibernate cascading an update to a related entity regardless of cascade=&#8221;none&#8221;. During my investigation I learned that when you pass an entity to ISession.Save, .Update or .SaveOrUpdate, NHibernate goes through the entire object graph and updates persisted entities if it thinks they&#8217;re &#8220;dirty&#8221; &#8211; as in a changed state compared [...]]]></description>
			<content:encoded><![CDATA[<p>I was having trouble with NHibernate cascading an update to a related entity regardless of cascade=&#8221;none&#8221;. During my investigation I learned that when you pass an entity to ISession.Save, .Update or .SaveOrUpdate, NHibernate goes through the entire object graph and updates persisted entities if it thinks they&#8217;re &#8220;dirty&#8221; &#8211; as in a changed state compared to the cached one &#8211; regardless of your cascade setting. NHibernate has several ways to determine whether an object is dirty, the last resort one being comparing the values of each individual field of an entity.</p>
<p>Turns out, I had my mapping screwed up. My related entity Y had two enumeration fields that I&#8217;d mapped as Int32. This throws off the comparisons. Int32.Equals doesn&#8217;t consider an enum of value 0 equal to the Int32 value 0. So every time I saved an entity referring to Y it considered entity Y dirty and updated it. Solution: in your mapping file, define the type of the field as the actual enumeration type or just leave the type out and let NHibernate figure it out.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F&amp;title=NHibernate+and+the+dark+secrets+of+unneeded+cascaded+updates"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F&amp;title=NHibernate+and+the+dark+secrets+of+unneeded+cascaded+updates"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F&amp;title=NHibernate+and+the+dark+secrets+of+unneeded+cascaded+updates"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F&amp;t=NHibernate+and+the+dark+secrets+of+unneeded+cascaded+updates"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F&amp;title=NHibernate+and+the+dark+secrets+of+unneeded+cascaded+updates"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2011%2F09%2Fnhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates%2F&amp;title=NHibernate+and+the+dark+secrets+of+unneeded+cascaded+updates"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2011/09/nhibernate-and-the-dark-secrets-of-unneeded-cascaded-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Value does not fall within the expected range&#8221; while opening a file in Visual Studio 2008</title>
		<link>http://theiterator.com/2010/11/value-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008/</link>
		<comments>http://theiterator.com/2010/11/value-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 10:07:58 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=117</guid>
		<description><![CDATA[I came across a curious problem a couple of days ago. Visual Studio greeted me with a &#8220;Value does not fall within the expected range&#8221; when trying to open some of the configuration and text files in one of my solutions. This occurred even if I closed the solution and tried to open the individual [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a curious problem a couple of days ago. Visual Studio greeted me with a &#8220;<em>Value does not fall within the expected range&#8221; </em>when trying to open some of the configuration and text files in one of my solutions.</p>
<p>This occurred even if I closed the solution and tried to open the individual files. ProcessMonitor.exe revealed nothing. Disabling plugins didn&#8217;t help. Deleting .suo and .user files didn&#8217;t help.</p>
<p>Googling for a solution revealed a couple of patterns. People were getting this either in VB.NET Windows Forms projects, profiling C++ applications or trying to open TFS work items. The latter resonated. TFS, my long-time nemesis, we meet in battle again.</p>
<p>I tried <strong>removing the local path mapping for the project in my TFS workspace, deleted the folder and recreated the mapping</strong>. Win.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F&amp;title=%26%238220%3BValue+does+not+fall+within+the+expected+range%26%238221%3B+while+opening+a+file+in+Visual+Studio+2008"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F&amp;title=%26%238220%3BValue+does+not+fall+within+the+expected+range%26%238221%3B+while+opening+a+file+in+Visual+Studio+2008"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F&amp;title=%26%238220%3BValue+does+not+fall+within+the+expected+range%26%238221%3B+while+opening+a+file+in+Visual+Studio+2008"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F&amp;t=%26%238220%3BValue+does+not+fall+within+the+expected+range%26%238221%3B+while+opening+a+file+in+Visual+Studio+2008"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F&amp;title=%26%238220%3BValue+does+not+fall+within+the+expected+range%26%238221%3B+while+opening+a+file+in+Visual+Studio+2008"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2010%2F11%2Fvalue-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008%2F&amp;title=%26%238220%3BValue+does+not+fall+within+the+expected+range%26%238221%3B+while+opening+a+file+in+Visual+Studio+2008"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2010/11/value-does-not-fall-within-the-expected-range-while-opening-a-file-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The best of software technology presentations</title>
		<link>http://theiterator.com/2009/12/the-best-of-software-technology-presentations/</link>
		<comments>http://theiterator.com/2009/12/the-best-of-software-technology-presentations/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 06:11:59 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Industry and career]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=108</guid>
		<description><![CDATA[I watch a whole lot of presentations on Youtube, Vimeo and InfoQ. Here are some latest picks of the bunch: Eric Ries &#8211; The Lean Startup @ Oredev Really useful advise on startups, be it a new product, a new business endeavor or a whole new company altogether. Giles Bowket &#8211; Archaeopteryx MIDI generator @ [...]]]></description>
			<content:encoded><![CDATA[<p>I watch a whole lot of presentations on Youtube, Vimeo and InfoQ. Here are some latest picks of the bunch:</p>
<p><a href="http://www.vimeo.com/7849753">Eric Ries &#8211; The Lean Startup @ Oredev</a></p>
<p>Really useful advise on startups, be it a new product, a new business endeavor or a whole new company altogether.</p>
<p><a href="http://www.infoq.com/presentations/archaeopteryx-bowkett">Giles Bowket &#8211; Archaeopteryx MIDI generator @ Rubyfringe</a></p>
<p>I just love Giles&#8217; delivery on this one. He&#8217;s presenting a MIDI generator software he&#8217;s been working on and throws some cold water on the industry in the process. An absolute classic.</p>
<p><a href="http://www.youtube.com/watch?v=aJGC0JSlpPE">Steve Souders &#8211; Even Faster Websites @ Google I/O</a></p>
<p>Invaluable tips on performance optimizing web sites, presented by the maker of <a href="http://developer.yahoo.com/yslow/">YSlow</a>.</p>
<p><a href="http://www.youtube.com/watch?v=0SARbwvhupQ">Brian Fitzpatrick &amp; Ben Collins-Sussman &#8211; The Myth Of The Genius Programmer</a></p>
<p>A talk about confidence, communication and facing failure. Among other things. Nothing really revolutionary here, but should be a good reality-check for many. I know it was for me.</p>
<p>That&#8217;s it for now.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F&amp;title=The+best+of+software+technology+presentations"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F&amp;title=The+best+of+software+technology+presentations"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F&amp;title=The+best+of+software+technology+presentations"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F&amp;t=The+best+of+software+technology+presentations"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F&amp;title=The+best+of+software+technology+presentations"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F12%2Fthe-best-of-software-technology-presentations%2F&amp;title=The+best+of+software+technology+presentations"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/12/the-best-of-software-technology-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KLM WTF</title>
		<link>http://theiterator.com/2009/11/klm-wtf/</link>
		<comments>http://theiterator.com/2009/11/klm-wtf/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:55:30 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[klm wtf]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=101</guid>
		<description><![CDATA[I was trying to check into my flight on KLM&#8217;s web site. I navigated to the check in form, entered my booking number and was greeted with this. WTF?]]></description>
			<content:encoded><![CDATA[<p>I was trying to check into my flight on KLM&#8217;s web site. I navigated to the check in form, entered my booking number and was greeted with this. WTF?</p>
<p><a href="http://theiterator.com/klm_wtf.JPG"><img class="aligncenter" title="KLM WTF" src="http://theiterator.com/klm_wtf_small.JPG" alt="" width="500" height="294" /></a></p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F&amp;title=KLM+WTF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F&amp;title=KLM+WTF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F&amp;title=KLM+WTF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F&amp;t=KLM+WTF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F&amp;title=KLM+WTF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F11%2Fklm-wtf%2F&amp;title=KLM+WTF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/11/klm-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ninject &amp; WCF</title>
		<link>http://theiterator.com/2009/10/ninject-wcf/</link>
		<comments>http://theiterator.com/2009/10/ninject-wcf/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 11:05:35 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ninject]]></category>
		<category><![CDATA[wcf]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=92</guid>
		<description><![CDATA[Ninject relies on an HttpModule when instantiating the Kernel with OnePerRequestBehavior. WCF hosting infrastructure intercepts requests when the PostAuthenticateRequest is raised and doesn&#8217;t return processing to the ASP.NET HTTP pipeline. Ninject&#8217;s OnePerRequestModule only registers an event handler on the EndRequest event and thus isn&#8217;t ran on requests to a WCF service. A quick fix for [...]]]></description>
			<content:encoded><![CDATA[<p>Ninject relies on an HttpModule when instantiating the Kernel with OnePerRequestBehavior. WCF hosting infrastructure intercepts requests when the PostAuthenticateRequest is raised and doesn&#8217;t return processing to the ASP.NET HTTP pipeline. Ninject&#8217;s OnePerRequestModule only registers an event handler on the EndRequest event and thus isn&#8217;t ran on requests to a WCF service.</p>
<p>A quick fix for this is to enable AspNetCompatibilityMode on the WCF hosting infrastructure. In your web.config, add the following tag under your &lt;system.serviceModel&gt; declaration:</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;serviceHostingEnvironment</span> <span style="color: #000066;">aspNetCompatibilityEnabled</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>You also have to decorate your .svc class with the following attribute:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>AspNetCompatibilityRequirements<span style="color: #000000;">&#40;</span>RequirementsMode <span style="color: #008000;">=</span> AspNetCompatibilityRequirementsMode.<span style="color: #0000FF;">Allowed</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span></pre></div></div>

<p>I don&#8217;t know if this is an ideal solution however, and if it has any negative effects on performance etc. More elegant <a href="http://www.ohloh.net/p/ninject-extensions-wcf">solutions</a> seem to be available. More information on AspNetCompatibilityMode is available on <a href="http://msdn.microsoft.com/en-us/library/aa702682.aspx">MSDN</a>.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F&amp;title=Ninject+%26%23038%3B+WCF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F&amp;title=Ninject+%26%23038%3B+WCF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F&amp;title=Ninject+%26%23038%3B+WCF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F&amp;t=Ninject+%26%23038%3B+WCF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F&amp;title=Ninject+%26%23038%3B+WCF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F10%2Fninject-wcf%2F&amp;title=Ninject+%26%23038%3B+WCF"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/10/ninject-wcf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Semantic domain modeling</title>
		<link>http://theiterator.com/2009/02/semantic-domain-modeling/</link>
		<comments>http://theiterator.com/2009/02/semantic-domain-modeling/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 18:35:58 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[domain driven design]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=71</guid>
		<description><![CDATA[Coding, after all, is just writing. &#8211; Jeff Atwood Yup. Jeff covers some essential aspects of the curious relationship between writing and coding in his post, focusing on the perspective of style and readability. I&#8217;ll now give a shot on extending on that topic. I&#8217;ve been kicking around the subject of domain modeling in my [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Coding, after all, is just writing.</p></blockquote>
<p>&#8211; <a href="http://www.codinghorror.com/blog/archives/001184.html">Jeff Atwood</a></p>
<p>Yup. Jeff covers some essential aspects of the curious <strong>relationship between writing and coding</strong> in his post, focusing on the perspective of style and readability. I&#8217;ll now give a shot on extending on that topic. I&#8217;ve been kicking around the subject of domain modeling in my post drafts bin for quite a while, not knowing how to present it. Today it hit me during a sprint review at a client. There is nothing revolutionary here. It&#8217;s all <strong>basic domain modeling and design patterns</strong>, but viewed from a different angle.</p>
<p>Numerous are the times I have come across inconsistencies in domain models due to misunderstandings in the development process from the actual domain to object model. I&#8217;m sure you have too, and this is nothing new under the sun, and to some degree somewhat unavoidable. Perhaps you&#8217;ve also seen <strong>objects used for something they weren&#8217;t meant and designed for</strong>. This could be due to architectural shortcomings, laziness or just plain ignorance.</p>
<p>As a harsh example, I&#8217;ll describe a case of architectural shortcomings that forced me to do an ugly hack and thus leverage a wrong object for the job at hand. The GUI components of the application featured a parameter-generated form &#8211; dubiously titled ViewForm -  for performing complex database queries to ultimately retrieve an entity to open into another form for modification.</p>
<p>First of all, naming the form ViewForm is just a cracker-jack job at crafting an <a href="http://domaindrivendesign.org/discussion/messageboardarchive/UbiquitousLanguage.html">ubiquitous language</a>. It&#8217;s a form that views stuff. You must be shitting me. How about SearchForm? After all, it&#8217;s a form that searches stuff. Infrastructural domain objects should be named with equal care as the ones in the business end that have taken years and years to refine into concise,  yet semantically clean terms. Ultimately the distilled purpose of the ViewForm component is to search stuff, so I&#8217;ll assume from now on that this naming quirk hadn&#8217;t been there.</p>
<p>The hack in question? I was asked to implement a search form that queried two separate tables &#8211; <strong>import and export shipments</strong> &#8211; and opened a different form depending on the type of consignment the user double-clicked on. I ended up creating a dummy form with absolutely no visual components on it, and some code in the Form_Load (or such, luckily can&#8217;t remember a thing of the VB6 API&#8217;s) event handler that figured out which of the two consignments it was, opened the corresponding form and closed the dummy one.</p>
<p>The said form performed nicely enough in the job of querying, and being configurable and all that. The problem, however, presented itself when a series of domain modeling mistakes met, reaching <strong>a critical mass of code smell</strong>. Following are the essential shortcomings that led me to produce probably the ugliest hack I&#8217;ve ever had the balls to ship:</p>
<ol>
<li>We&#8217;re talking about ERP-style software here, and thus <strong>object-oriented programming should be a given</strong>. No objects here, other than infrastructural ones, courtesy of VB6 (Form, Control etc). This results in aforementioned search form querying for database rows instead of entities. So no strong typing to be relied on. That also means that refactoring the query form configuration model would&#8217;ve been a tedious exercise of implement-and-wait-for-the-bug-reports.</li>
<li>When the data schema is modeled merely as database tables and a bunch of functions scattered across random forms all over the place, the domain model easily scatters into a bit of a disorganized mush. In this case, the business requirements dictated that the system should handle import and export shipments, thus the developer creates <em>separate tables for them</em> without stopping for a minute to ponder the <em>semantics</em> of the two. <strong>A shipment is a shipment,</strong> regardless of its direction, I dare to assert.</li>
<li>The configuration data schema for the query form was modeled so that there was a query form definition and it had a bunch of associated column definitions. The gotcha was that the query form definition held the name of the <em>form</em> that would be opened when a user double-clicked a row in the results grid. The semantics of a query form per se come into question here &#8211; is query form a query form or a query-and-open-another-form form &#8211; but mostly in the sense of <strong>separation of concern</strong>.</li>
</ol>
<p>Though all of the aforementioned architectural turds play an important role, the third one is the most essential one in this particular case. The coding-as-writing analogy plays out here in the sense that <strong>having a semantically clean ubiquitous language paves the way for clean and pragmatic separation of concern</strong>. If the domain model defines a search form, you implement a search form that knows about searching for stuff, and that maybe something needs to be done with the stuff that it finds: something, but not what exactly.</p>
<p>Rather than referring to an individual form to open, the search definition should&#8217;ve pointed to a <a href="http://en.wikipedia.org/wiki/Strategy_pattern">strategy</a> object that would&#8217;ve done whatever it wanted with the row of information: figure out a form to open or perhaps perform some other processing on the record. Now I had to emulate that behavior using a Form object to do something it&#8217;s not designed nor meant for.</p>
<p>Moving on to unfolding screwup number two. I once tried fishing out a reason for the crowbar-separation of the two shipment directions and got something along the lines of &#8220;well it&#8217;s because they are a totally different business&#8221;. Well humm righty-o, but isn&#8217;t a shipment still a bunch of goods that is going from one place to another, results in costs to an array of involved parties and is dictated by a set of legislation, contracts and whatnot?</p>
<p>An imported shipment might hold some information that an exported one doesn&#8217;t and vice versa, but <strong>object-oriented programming provides inheritance and relational databases provides relationships for just that</strong>. Eventually both of the shipment types still need to be treated as equals, just like what happened here. Another highly probable case would be a statistical report on import-to-export ratios.</p>
<p>The key point I&#8217;m trying to make here, is that, if the <a href="http://domaindrivendesign.org/discussion/messageboardarchive/UbiquitousLanguage.html">ubiquitous language</a> has been crafted carefully, <strong>evaluating semantics provides a logical and robust back bone for designing the object model</strong>. Now that I think of it, I can&#8217;t see another way to really model a domain. Yet every day I witness failures &#8211; albeit smallers ones &#8211; in modeling that would&#8217;ve been solved by really grinding the terms used to describe the objects.</p>
<p>When an ubiquitous language starts to take shape, go through the terms described and really chew them fine. <strong>If the term isn&#8217;t concise or unambiguous enough, finetune it until it is</strong>. Then use that information to form a pragmatic object model that separates concerns logically.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F&amp;title=Semantic+domain+modeling"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F&amp;title=Semantic+domain+modeling"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F&amp;title=Semantic+domain+modeling"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F&amp;t=Semantic+domain+modeling"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F&amp;title=Semantic+domain+modeling"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fsemantic-domain-modeling%2F&amp;title=Semantic+domain+modeling"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/02/semantic-domain-modeling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to nest NHibernate mapping files in Visual Studio projects</title>
		<link>http://theiterator.com/2009/02/how-to-nest-nhibernate-mapping-files-in-visual-studio-projects/</link>
		<comments>http://theiterator.com/2009/02/how-to-nest-nhibernate-mapping-files-in-visual-studio-projects/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 16:13:19 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=65</guid>
		<description><![CDATA[Nesting files in Visual Studio projects is as simple as (pun intended) opening your project file into a text editor, finding your reference to a project file and adding &#60;DependentUpon&#62;Class.cs&#60;/DependentUpon&#62; within the element. However, there&#8217;s a catch. Nesting the files causes the file names to be overwritten. In this case, the .hbm.xml suffix gets dropped. [...]]]></description>
			<content:encoded><![CDATA[<p>Nesting files in Visual Studio projects is as simple as (pun intended) opening your project file into a text editor, finding your reference to a project file and adding &lt;DependentUpon&gt;Class.cs&lt;/DependentUpon&gt; within the element.</p>
<p>However, there&#8217;s a catch. Nesting the files causes the file names to be overwritten. In this case, the .hbm.xml suffix gets dropped. That effectively prevents Configuration.AddAssembly() from finding the mapping information. A way around this pitfall is defining the dependency as follows:</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;EmbeddedResource</span> <span style="color: #000066;">include</span>=<span style="color: #ff0000;">&quot;ServiceRequest.hbm.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DependentUpon<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ServiceRequest.cs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DependentUpon<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LogicalName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ServiceRequest.hbm.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LogicalName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EmbeddedResource<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Thanks go to Sami for cracking this nut with me.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F&amp;title=How+to+nest+NHibernate+mapping+files+in+Visual+Studio+projects"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F&amp;title=How+to+nest+NHibernate+mapping+files+in+Visual+Studio+projects"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F&amp;title=How+to+nest+NHibernate+mapping+files+in+Visual+Studio+projects"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F&amp;t=How+to+nest+NHibernate+mapping+files+in+Visual+Studio+projects"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F&amp;title=How+to+nest+NHibernate+mapping+files+in+Visual+Studio+projects"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-nest-nhibernate-mapping-files-in-visual-studio-projects%2F&amp;title=How+to+nest+NHibernate+mapping+files+in+Visual+Studio+projects"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/02/how-to-nest-nhibernate-mapping-files-in-visual-studio-projects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to lock your Mac OS X</title>
		<link>http://theiterator.com/2009/02/how-to-lock-your-mac-os-x/</link>
		<comments>http://theiterator.com/2009/02/how-to-lock-your-mac-os-x/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 11:28:32 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://theiterator.com/?p=61</guid>
		<description><![CDATA[Finder -&#62; Applications -&#62; Utilities -&#62; Keychain access Keychain access (menu item) -&#62; Preferences Check &#8220;Show Status in Menu Bar&#8221; To lock your workstation, click on the lock icon in your Menu Bar and click &#8220;Lock Screen&#8221; Just thought a no-nonsense reminder about this is in order.]]></description>
			<content:encoded><![CDATA[<ol>
<li>Finder -&gt; Applications -&gt; Utilities -&gt; Keychain access</li>
<li>Keychain access (menu item) -&gt; Preferences</li>
<li>Check &#8220;Show Status in Menu Bar&#8221;</li>
<li>To lock your workstation, click on the lock icon in your Menu Bar and click &#8220;Lock Screen&#8221;</li>
</ol>
<p>Just thought a no-nonsense reminder about this is in order.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F&amp;title=How+to+lock+your+Mac+OS+X"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F&amp;title=How+to+lock+your+Mac+OS+X"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F&amp;title=How+to+lock+your+Mac+OS+X"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F&amp;t=How+to+lock+your+Mac+OS+X"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F&amp;title=How+to+lock+your+Mac+OS+X"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F02%2Fhow-to-lock-your-mac-os-x%2F&amp;title=How+to+lock+your+Mac+OS+X"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/02/how-to-lock-your-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Chinese New Year 2009 in Helsinki</title>
		<link>http://theiterator.com/2009/01/chinese-new-year-2009-in-helsinki/</link>
		<comments>http://theiterator.com/2009/01/chinese-new-year-2009-in-helsinki/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 09:21:56 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[chinese new year]]></category>
		<category><![CDATA[wushu]]></category>

		<guid isPermaLink="false">http://www.theiterator.com/?p=58</guid>
		<description><![CDATA[The Chinese New Year was celebrated in Helsinki for the 3rd time on 25th January 2009. The event featured spectacular wushu, puppetry, chinese opera and dance performances. I froze my ass off standing in the slush photographing some of the performances. Enjoy.]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/nuancednb/sets/72157612935872023/"><img class="alignnone" title="Wushu at Chinese New Year 2009 in Helsinki" src="http://farm4.static.flickr.com/3449/3226379132_e9f2d7f3cb.jpg?v=0" alt="" width="500" height="332" /></a></p>
<p>The Chinese New Year was celebrated in Helsinki for the 3rd time on 25th January 2009. The event featured spectacular <a href="http://en.wikipedia.org/wiki/Wushu_(sport)">wushu</a>, puppetry, chinese opera and dance performances. I froze my ass off standing in the slush photographing some of the performances. <a href="http://flickr.com/photos/nuancednb/sets/72157612935872023/">Enjoy</a>.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F&amp;title=Chinese+New+Year+2009+in+Helsinki"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F&amp;title=Chinese+New+Year+2009+in+Helsinki"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F&amp;title=Chinese+New+Year+2009+in+Helsinki"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F&amp;t=Chinese+New+Year+2009+in+Helsinki"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F&amp;title=Chinese+New+Year+2009+in+Helsinki"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Fchinese-new-year-2009-in-helsinki%2F&amp;title=Chinese+New+Year+2009+in+Helsinki"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/01/chinese-new-year-2009-in-helsinki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log4net vs. Enterprise Library Logging Application Block</title>
		<link>http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/</link>
		<comments>http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 15:29:53 +0000</pubDate>
		<dc:creator>theiterator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[enterprise library]]></category>
		<category><![CDATA[log4net]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[logging application block]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.theiterator.com/?p=55</guid>
		<description><![CDATA[I was contemplating a logging strategy in the context of a customer project and I bumped into this slightly dated performance comparison between log4net and Microsoft Patterns &#38; Practices &#8211; Enterprise Library 3.1 Logging Application Block (which I&#8217;ll refer to as LAB from now on). Considering the fact that our logging library of choice is [...]]]></description>
			<content:encoded><![CDATA[<p>I was contemplating a logging strategy in the context of a customer project and I bumped into this slightly dated <a href="http://weblogs.asp.net/lorenh/archive/2005/02/18/376191.aspx">performance comparison</a> between <a href="http://logging.apache.org/log4net/index.html">log4net</a> and <a href="http://msdn.microsoft.com/en-us/library/dd203099.aspx">Microsoft Patterns &amp; Practices &#8211; Enterprise Library 3.1 Logging Application Block</a> (which I&#8217;ll refer to as LAB from now on). Considering the fact that our logging library of choice is LAB, I started wondering what the situation is today.</p>
<p>I wrote (heh) an empty trace listener for LAB and an empty appender for log4net and ran a couple of unit tests. While not nearly as dramatic as Loren Halvorson&#8217;s findings 4 years ago, the results weren&#8217;t exactly flattering from LAB&#8217;s perspective.</p>
<p>The unit tests wrote 100000 info level &#8211; not that it matters, after all we&#8217;re using empty appenders &#8211; log entries and timed the whole deal. Log4net&#8217;s effort took a respectable 153ms, while LAB&#8217;s time was a significantly longer 1396ms. I also tried actually writing the entries out, using FlatFileTraceListener and FileAppender on LAB and log4net respectively. The results: log4net 1450ms &#8211; LAB 4243ms. Not as dramatic, but relevant nevertheless.</p>
<p>Oh, and by the way, I&#8217;m not handing out a table of the dubiously conducted performance test results, because I&#8217;m mean and I want you guys to read my posts.</p>
<p>Going beyond performance, setting up LAB is &#8211; to put it gently &#8211; laborious. Microsoft&#8217;s documentation doesn&#8217;t offer configuration examples in their native xml form. Rather, they &#8220;encourage&#8221; you to use a configuration tool that is shipped with Enterprise Library. That sucks. I had to download and install Enterprise Library to use a tool to edit App.config, instead of just copying the DLL from a project I already had and modifying a copypasted configuration to suit my needs. I hate clicking around to produce stuff that&#8217;s essentially lines of code in my Visual Studio solution.</p>
<p>Then there&#8217;s the behemoth of an API that LAB sports. Constructing LogEntry objects, then asking whether it should be logged and then writing them out to the logger isn&#8217;t actually succinct. Surely you can encapsulate this behavior in your own helper methods, but I can hardly see the point in rewriting the API. Logging code should be really succinct, and by default log4net&#8217;s API provides ways to do just that.</p>
<p>log4net 1 &#8211; MS Logging Application Block 0</p>
<p>ps. Do note that Enterprise Library 3.1 is already outdated so I don&#8217;t know if these conclusions apply to Enterprise Library 4.1.</p>
<p class="bookmark-me"><a title="technorati.com" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/technorati.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="del.icio.us" href="http://del.icio.us/post?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/delicious.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="stumbleupon.com" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/stumbleupon.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="digg.com" href="http://digg.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/digg.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="www.facebook.com" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;t=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/facebook.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="reddit.com" href="http://reddit.com/submit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/reddit.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> <a title="twitthis.com" href="http://twitthis.com/twit?url=http%3A%2F%2Ftheiterator.com%2F2009%2F01%2Flog4net-vs-enterprise-library-logging-application-block%2F&amp;title=Log4net+vs.+Enterprise+Library+Logging+Application+Block"><img src="http://theiterator.com/wp-content/plugins/bookmark-me/images/twitter.png" style="margin:0;border:0;padding:0" alt="bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://theiterator.com/2009/01/log4net-vs-enterprise-library-logging-application-block/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

