<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.connicus.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Terry Thibodeau's Blog</title><subtitle type="html" /><id>http://www.connicus.com/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.connicus.com/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.connicus.com/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.61129.2">Community Server</generator><updated>2008-02-25T12:58:00Z</updated><entry><title>How Did I Get Started In Software Development?</title><link rel="alternate" type="text/html" href="http://www.connicus.com/archive/2008/07/15/how-did-i-get-started-in-software-development.aspx" /><id>http://www.connicus.com/archive/2008/07/15/how-did-i-get-started-in-software-development.aspx</id><published>2008-07-15T14:22:00Z</published><updated>2008-07-15T14:22:00Z</updated><content type="html">Called out by Sean Feldman . Here we go: How old were you when you first started in programming? Not counting Turtle, I think the first actual program I wrote was a MadLibs story generator in grade 7. I would have been 12 or 13. It's no Pong , but there you go. How did you get started in programming? I took an interest in computers with the very first one I saw in 1981 (grade 1, an Apple computer). From that point, I loved computers and always gravitated to technology in some way. I continued using...(&lt;a href="http://www.connicus.com/archive/2008/07/15/how-did-i-get-started-in-software-development.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.connicus.com/aggbug.aspx?PostID=107" width="1" height="1"&gt;</content><author><name>tthibodeau</name><uri>http://www.connicus.com/members/tthibodeau.aspx</uri></author><category term="Personal" scheme="http://www.connicus.com/archive/tags/Personal/default.aspx" /></entry><entry><title>ALT.NET Canada Conference - time's running out</title><link rel="alternate" type="text/html" href="http://www.connicus.com/archive/2008/07/02/alt-net-canada-conference-time-s-running-out.aspx" /><id>http://www.connicus.com/archive/2008/07/02/alt-net-canada-conference-time-s-running-out.aspx</id><published>2008-07-02T20:45:00Z</published><updated>2008-07-02T20:45:00Z</updated><content type="html">As one of the organizers of the ALT.NET Canada conference, I thought I should probably do the obligatory "Come on out" post.:) So, if you haven't heard already, we are holding the first ever ALT.NET Canada Conference in Calgary, Alberta from August 15-17, 2008 ! Space is limited to the first 100 applicants, so sign up now ! You can read much more eloquent posts about the conference at the following fellow-organizer blogs: Donald Belcham Kyle Baley James Kovacs See you there!...(&lt;a href="http://www.connicus.com/archive/2008/07/02/alt-net-canada-conference-time-s-running-out.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.connicus.com/aggbug.aspx?PostID=105" width="1" height="1"&gt;</content><author><name>tthibodeau</name><uri>http://www.connicus.com/members/tthibodeau.aspx</uri></author><category term="conferences" scheme="http://www.connicus.com/archive/tags/conferences/default.aspx" /></entry><entry><title>Consolidating and Version-controlling Development Settings</title><link rel="alternate" type="text/html" href="http://www.connicus.com/archive/2008/05/06/Consolidating-and-Version_2D00_controlling-Development-Settings.aspx" /><id>http://www.connicus.com/archive/2008/05/06/Consolidating-and-Version_2D00_controlling-Development-Settings.aspx</id><published>2008-05-06T18:45:00Z</published><updated>2008-05-06T18:45:00Z</updated><content type="html">Those who know me know that I hate repetition. Reducing duplication and improving productivity is usually the driving force behind much that I do with computers (other than my day job of software development). After installing Visual Studio 2008 and new versions of Resharper, I realized that I was, once again, going to have to reset all of my preferences. Tired of dealing with this, I set on a mission to formulate a process to consolidate my Visual Studio, Macro, Resharper, and any other add-on settings...(&lt;a href="http://www.connicus.com/archive/2008/05/06/Consolidating-and-Version_2D00_controlling-Development-Settings.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.connicus.com/aggbug.aspx?PostID=71" width="1" height="1"&gt;</content><author><name>tthibodeau</name><uri>http://www.connicus.com/members/tthibodeau.aspx</uri></author><category term="Resharper" scheme="http://www.connicus.com/archive/tags/Resharper/default.aspx" /><category term="tools" scheme="http://www.connicus.com/archive/tags/tools/default.aspx" /><category term="productivity" scheme="http://www.connicus.com/archive/tags/productivity/default.aspx" /><category term="Visual Studio" scheme="http://www.connicus.com/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>The miracle hair!</title><link rel="alternate" type="text/html" href="http://www.connicus.com/archive/2008/05/05/the-miracle-hair.aspx" /><id>http://www.connicus.com/archive/2008/05/05/the-miracle-hair.aspx</id><published>2008-05-05T19:04:00Z</published><updated>2008-05-05T19:04:00Z</updated><content type="html">Since Justice appreciates my hair so much (see the last interview question), I thought I'd give the rest of the public a taste as well. Enjoy ;)...(&lt;a href="http://www.connicus.com/archive/2008/05/05/the-miracle-hair.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.connicus.com/aggbug.aspx?PostID=97" width="1" height="1"&gt;</content><author><name>tthibodeau</name><uri>http://www.connicus.com/members/tthibodeau.aspx</uri></author><category term="About Me" scheme="http://www.connicus.com/archive/tags/About+Me/default.aspx" /></entry><entry><title>Testing NHibernate object mappings in isolation (Part 2 - dependencies)</title><link rel="alternate" type="text/html" href="http://www.connicus.com/archive/2008/02/25/testing-nhibernate-object-mappings-in-isolation-part-2-dependencies.aspx" /><id>http://www.connicus.com/archive/2008/02/25/testing-nhibernate-object-mappings-in-isolation-part-2-dependencies.aspx</id><published>2008-02-25T19:58:00Z</published><updated>2008-02-25T19:58:00Z</updated><content type="html">&lt;P&gt;I thought I should post an update to "&lt;A class="" title="Testing NHibernate object mappings in isolation" href="http://www.connicus.com/archive/2008/02/21/testing-nhibernate-object-mappings-in-isolation.aspx" target=_blank&gt;Testing NHibernate object mappings in isolation&lt;/A&gt;" as that post didn't address dependent objects in your mapping files. For a simple mapping to a class with only fields or component object references*, the previous method works fine. &lt;/P&gt;
&lt;P&gt;When you start adding references to other entities in your mapping files, you must also add those mapping file references to the Configuration object. I've refactored the code&amp;nbsp;from the previous post to load the mapping file resource based on the class type. Notice the test, "Should_map_Conference_class", adds its dependencies to the configuration.&lt;/P&gt;
&lt;DIV class=Code&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;string&lt;/SPAN&gt; mappingFileAssemblyName = &lt;SPAN style="COLOR:#a31515;"&gt;"Namespace.NHibernateMappings"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;readonly&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;string&lt;/SPAN&gt; customConfigPath = &lt;SPAN style="COLOR:#2b91af;"&gt;Path&lt;/SPAN&gt;.Combine(&lt;SPAN style="COLOR:#2b91af;"&gt;Directory&lt;/SPAN&gt;.GetCurrentDirectory(), &lt;SPAN style="COLOR:#a31515;"&gt;@"localNHibernate.cfg.xml"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Configuration&lt;/SPAN&gt; configuration;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;SetUp&lt;/SPAN&gt;]&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; TestInitialize()&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;{&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; configuration = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Configuration&lt;/SPAN&gt;()&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; .Configure(customConfigPath);&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;}&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;TearDown&lt;/SPAN&gt;]&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; TearDown()&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;{&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;this&lt;/SPAN&gt;.configuration.BuildSessionFactory().Close();&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;}&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;Test&lt;/SPAN&gt;]&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; Should_map_Conference_class()&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;{&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; AddSingleClass(&lt;SPAN style="COLOR:blue;"&gt;typeof&lt;/SPAN&gt; (&lt;SPAN style="COLOR:#2b91af;"&gt;Address&lt;/SPAN&gt;));&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; AddSingleClass(&lt;SPAN style="COLOR:blue;"&gt;typeof&lt;/SPAN&gt; (&lt;SPAN style="COLOR:#2b91af;"&gt;Category&lt;/SPAN&gt;));&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; AddSingleClass(&lt;SPAN style="COLOR:blue;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR:#2b91af;"&gt;Conference&lt;/SPAN&gt;));&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;}&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Configuration&lt;/SPAN&gt; AddSingleClass(&lt;SPAN style="COLOR:#2b91af;"&gt;Type&lt;/SPAN&gt; persistentClassType)&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;{&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; &lt;SPAN style="COLOR:#2b91af;"&gt;Assembly&lt;/SPAN&gt; assembly = &lt;SPAN style="COLOR:#2b91af;"&gt;Assembly&lt;/SPAN&gt;.Load(mappingFileAssemblyName);&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;this&lt;/SPAN&gt;.configuration.AddResource(mappingFileAssemblyName + &lt;SPAN style="COLOR:#a31515;"&gt;"."&lt;/SPAN&gt; + persistentClassType.Name + &lt;SPAN style="COLOR:#a31515;"&gt;".hbm.xml"&lt;/SPAN&gt;, assembly);&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;}&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;If I were using C# 3.0 on this project, I could create an extension method for the NHibernate Configuration class to allow me to do something like:&lt;/P&gt;
&lt;DIV class=Code&gt;
&lt;P style="MARGIN:0px;"&gt;configuration.AddSingleClass(&lt;SPAN style="COLOR:blue;"&gt;typeof&lt;/SPAN&gt; (&lt;SPAN style="COLOR:#2b91af;"&gt;Address&lt;/SPAN&gt;), assembly)&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .AddSingleClass(&lt;SPAN style="COLOR:blue;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR:#2b91af;"&gt;Category&lt;/SPAN&gt;), assembly)&lt;/P&gt;
&lt;P style="MARGIN:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .AddSingleClass(&lt;SPAN style="COLOR:blue;"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR:#2b91af;"&gt;Conference&lt;/SPAN&gt;), assembly);&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=footnote&gt;* - A component is a contained object that is persisted as a value type, not an entity. See &lt;EM&gt;Component Mapping&lt;/EM&gt; in the NHibernate documentation.&lt;/P&gt;&lt;img src="http://www.connicus.com/aggbug.aspx?PostID=93" width="1" height="1"&gt;</content><author><name>tthibodeau</name><uri>http://www.connicus.com/members/tthibodeau.aspx</uri></author><category term="TDD" scheme="http://www.connicus.com/archive/tags/TDD/default.aspx" /><category term=".NET" scheme="http://www.connicus.com/archive/tags/.NET/default.aspx" /><category term="NHibernate" scheme="http://www.connicus.com/archive/tags/NHibernate/default.aspx" /></entry></feed>