<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Billy McCafferty</title>
        <link>http://geekswithblogs.net/Billy/Default.aspx</link>
        <description>whatever (but really just .NET)</description>
        <language>en-US</language>
        <copyright>Billy McCafferty</copyright>
        <managingEditor>geekswithblogs@emccafferty.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Billy McCafferty</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/Billy/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Moving Day</title>
            <link>http://geekswithblogs.net/Billy/archive/2006/09/20/91756.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I've moved!&amp;nbsp; My new home can be found at &lt;/FONT&gt;&lt;A href="http://devlicio.us/blogs/billy_mccafferty"&gt;&lt;FONT face=Arial size=2&gt;http://devlicio.us/blogs/billy_mccafferty&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=91756"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=91756" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/91756.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/09/20/91756.aspx</guid>
            <pubDate>Wed, 20 Sep 2006 16:43:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/91756.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/09/20/91756.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/91756.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/91756.aspx</trackback:ping>
        </item>
        <item>
            <title>Ruby-on-Rails Capabilities in ASP.NET</title>
            <category>ASP.NET</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/08/28/89563.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;It's great to see that ASP.NET tools are finally surfacing that leverage the same code-generation capabilities as Ruby-on-Rails.&amp;nbsp; ASP.NET ActionPack (&lt;/FONT&gt;&lt;A href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=actionpack"&gt;&lt;FONT size=2&gt;http://www.codeplex.com/Wiki/View.aspx?ProjectName=actionpack&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;) is one such example that builds data-access and presentation scaffolding.&amp;nbsp; Like RoR, ASP.NET ActionPack will automatically build admin screens for all your basic CRUD fuctionality; unlike RoR, ASP.NET ActionPack will even look for foreign keys within your DB schema and provide drop-down options to populate those foreign key values.&amp;nbsp; What the 10-minute webcast does not show is how to add methods&amp;nbsp;to a pre-generated class - I'll assume/suggest partial classes are leveraged here.&amp;nbsp; Additionally, it does not go into details concerning&amp;nbsp;modifications to&amp;nbsp;the presentation scaffolding.&amp;nbsp; But overall, it looks to be headed in the right direction and I look forward to seeing how it evolves.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=89563"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=89563" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/89563.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/08/28/89563.aspx</guid>
            <pubDate>Mon, 28 Aug 2006 18:16:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/89563.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/08/28/89563.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/89563.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/89563.aspx</trackback:ping>
        </item>
        <item>
            <title>Wrapping C# Events with Accessors</title>
            <category>C#</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/08/09/87497.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;It is a given that private members should be wrapped&amp;nbsp;with public accessors for proper encapsulation of class data.&amp;nbsp; But it is common to see people publicly declaring events, such as with &lt;CODE&gt;public event EventHandler SomeEventExposingHimself;&lt;/CODE&gt;.&amp;nbsp; Essentially, this is the same as exposing a private member to the world without accessors, such as with &lt;CODE&gt;public string SomeStringThatYouShouldNotHaveAccessToDirectly;&lt;/CODE&gt;.&amp;nbsp; Any subscriber listening for the event is now tied directly to the actual class member.&amp;nbsp; C# makes it easy to provide accessors for your events, just as it does for class members,&amp;nbsp;with the keywords &lt;CODE&gt;add&lt;/CODE&gt;&amp;nbsp;and &lt;CODE&gt;remove&lt;/CODE&gt;.&amp;nbsp;The following is an example of an event properly wrapped with public accessors:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;PRE&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;event&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;EventHandler&lt;/FONT&gt;&lt;FONT size=2&gt; EventModestlyExposed {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;  add&lt;/FONT&gt;&lt;FONT size=2&gt; {&lt;/P&gt;&lt;P&gt;    someEventNotWantingToExposeHimself += &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;  remove&lt;/FONT&gt;&lt;FONT size=2&gt; {&lt;/P&gt;&lt;P&gt;    someEventNotWantingToExposeHimself -= &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;value&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;event&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;EventHandler&lt;/FONT&gt;&lt;FONT size=2&gt; someEventNotWantingToExposeHimself;&lt;/P&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=87497"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=87497" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/87497.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/08/09/87497.aspx</guid>
            <pubDate>Wed, 09 Aug 2006 13:14:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/87497.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/08/09/87497.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/87497.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/87497.aspx</trackback:ping>
        </item>
        <item>
            <title>Model-View-Presenter split into two "new" patterns</title>
            <category>Architecture</category>
            <category>Model-View-Presenter</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/07/20/85815.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;For the past year or so, Martin Fowler has included the pattern Model-View-Presenter, or MVP,&amp;nbsp;in his upcoming addendum to&amp;nbsp; &lt;U&gt;Patterns of Enterprise Application Development&lt;/U&gt;.&amp;nbsp; Due to apparent confusions between MVC and MVP, Fowler has now split&amp;nbsp;this pattern into what he's calling &amp;#8220;Passive View&amp;#8221; (&lt;A href="http://martinfowler.com/eaaDev/PassiveScreen.html"&gt;http://martinfowler.com/eaaDev/PassiveScreen.html&lt;/A&gt;) and &amp;#8220;Supervising Controller/Presenter&amp;#8221; (&lt;A href="http://martinfowler.com/eaaDev/SupervisingPresenter.html"&gt;http://martinfowler.com/eaaDev/SupervisingPresenter.html&lt;/A&gt;).&amp;nbsp; (Now &lt;EM&gt;what&lt;/EM&gt; am I to do! ;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Passive View stresses zero/none/nada dependencies between the View and the Model.&amp;nbsp; Previously, with MVP, the View could be given a dependency to the Model to decrease the amount of communications between the View and the Presenter.&amp;nbsp; &lt;EM&gt;But&lt;/EM&gt;, from how I understand it, the Controller in Passive View (previously the Presenter in MVP) would now have a dependency&amp;nbsp;on&amp;nbsp;System.Web, in&amp;nbsp;ASP.NET anyway,&amp;nbsp;to facilitate direct communications with the View display elements.&amp;nbsp; A &amp;#8220;Test Double&amp;#8220; could then sit in for the View for unit testing purposes.&amp;nbsp; Although I &lt;EM&gt;really&lt;/EM&gt; don't like the idea of a controller depending on System.Web, Passive View&amp;nbsp;seems a bit simpler than MVP.&amp;nbsp; But instead of it depending on System.Web, Fowler suggests the use of a &amp;#8220;Gateway&amp;#8220; to avoid&amp;nbsp;the dependency.&amp;nbsp; The primary disadvantage to Passive View, in ASP.NET, is that it would become much more&amp;nbsp;tedius to bind to a webcontrol, such as the datagrid, if the View has no knowledge of the Model.&amp;nbsp; I suppose DTOs could be used in their stead.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Alternatively, Supervising Controller looks to be a &amp;#8220;flexible&amp;#8221; interpretation of the original MVP pattern.&amp;nbsp; I.e. the View isn't completely dumb and knows how to use a limited amount of the Model.&amp;nbsp; Supervising Controller leaves the data binding up to the View and only helps out when the logic becomes non-trivial.&amp;nbsp; I believe this is &lt;EM&gt;very&lt;/EM&gt; similar to how I discussed MVP to be in &lt;A href="http://www.codeproject.com/useritems/ModelViewPresenter.asp"&gt;http://www.codeproject.com/useritems/ModelViewPresenter.asp&lt;/A&gt;.&amp;nbsp; The primary benefit&amp;nbsp;to this pattern is that it makes the presentation logic easy to unit test.&amp;nbsp; The primary drawback, in my opinion, is that it makes it difficult to draw a clear line between what should go in the View (the code-behind in ASP.NET) and what should go in the Supervising Controller.&amp;nbsp; Passive View makes the&amp;nbsp;separation of responsibility&amp;nbsp;a bit more clear.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Now&amp;nbsp;off to go update my&amp;nbsp;class PPTs.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85815"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85815" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/85815.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/07/20/85815.aspx</guid>
            <pubDate>Thu, 20 Jul 2006 12:53:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/85815.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/07/20/85815.aspx#feedback</comments>
            <slash:comments>14</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/85815.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/85815.aspx</trackback:ping>
        </item>
        <item>
            <title>Using NHibernate with Multiple Databases</title>
            <category>ASP.NET</category>
            <category>C#</category>
            <category>NHibernate</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/07/17/85504.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I've added a new article to CodeProject.com concerning NHibernate with multiple databases with either ASP.NET or .NET.&amp;nbsp; The article can be found at &lt;A href="http://www.codeproject.com/useritems/NHibernateMultipleDBs.asp"&gt;http://www.codeproject.com/useritems/NHibernateMultipleDBs.asp&lt;/A&gt;.&amp;nbsp; Any and all feedback is certainly welcome.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;As an addendum, Hector Cruz has described an approach to&amp;nbsp;connecting to multiple DBs on the same server via NHibernate HBM files at&amp;nbsp;&lt;A href="http://forum.hibernate.org/viewtopic.php?t=962161"&gt;http://forum.hibernate.org/viewtopic.php?t=962161&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85504"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85504" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/85504.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/07/17/85504.aspx</guid>
            <pubDate>Tue, 18 Jul 2006 01:34:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/85504.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/07/17/85504.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/85504.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/85504.aspx</trackback:ping>
        </item>
        <item>
            <title>Converting System.Collections to System.Collections.Generic</title>
            <category>C#</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/07/10/84637.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I believe the following is the fastest way to convert a non-typed list to a strongly typed (generic) list using C# .NET:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt; &lt;FONT color=#008080&gt;List&lt;/FONT&gt;&lt;T&gt; ConvertToGenericList(&lt;FONT color=#008080&gt;&lt;FONT color=#008080 size=2&gt;IList&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; listOfObjects&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;) {&lt;BR&gt; &lt;FONT color=#008080&gt;  ArrayList&lt;/FONT&gt; notStronglyTypedList = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#008080&gt;ArrayList&lt;/FONT&gt;(&lt;FONT size=2&gt;listOfObjects&lt;/FONT&gt;);&lt;BR&gt;&lt;FONT color=#008080&gt;   return &lt;/FONT&gt;&lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#008080&gt;List&lt;/FONT&gt;&lt;T&gt;(notStronglyTypedList.ToArray(&lt;FONT color=#0000ff&gt;typeof&lt;/FONT&gt;(T)) &lt;FONT color=#0000ff&gt;as&lt;/FONT&gt; T[]);&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Note that this will fail if the non-typed collection contains anything that cannot be casted to type of T.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Please let me know if there's a more efficient way to do this!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=84637"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=84637" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/84637.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/07/10/84637.aspx</guid>
            <pubDate>Mon, 10 Jul 2006 18:55:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/84637.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/07/10/84637.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/84637.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/84637.aspx</trackback:ping>
        </item>
        <item>
            <title>NHibernate Best Practices with ASP.NET, Generics &amp; Unit Tests</title>
            <category>Architecture</category>
            <category>ASP.NET</category>
            <category>C#</category>
            <category>NHibernate</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/03/11/72094.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial&gt;I finally got around to it... the whole shebang of NHibernate best practices with ASP.NET and Generics.  The article, along with the related source, can be found at &lt;/FONT&gt;&lt;A href="http://www.codeproject.com/useritems/NHibernateBestPractices.asp" target=_blank&gt;&lt;FONT face=Arial&gt;http://www.codeproject.com/useritems/NHibernateBestPractices.asp&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;.  Your review, feedback and suggestions would be much appreciated!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;
&lt;HR id=null&gt;
&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;3/3/06 UPDATE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;I've updated the article on Code Project to include a unit testing project to show how to simulate the web context and how to create &amp;#8220;mock&amp;#8221; DAO objects within your unit tests.&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=72094"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=72094" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/72094.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/03/11/72094.aspx</guid>
            <pubDate>Sun, 12 Mar 2006 04:22:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/72094.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/03/11/72094.aspx#feedback</comments>
            <slash:comments>13</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/72094.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/72094.aspx</trackback:ping>
        </item>
        <item>
            <title>The solution for proper ASP.NET MVC</title>
            <category>ASP.NET</category>
            <category>C#</category>
            <category>Model-View-Presenter</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/03/15/72439.aspx</link>
            <description>&lt;P&gt;Arguments abound for whether or not ASP.NET provides adequate MVC.  On the other hand, many feel Page Controller and Front Controller are the way to go.  Others feel the entire page model should be abandoned in the favor of something more attuned to Ruby on Rails such as Castle MonoRail.  For me, I've always liked the page event model and feel user and server controls are wonderful, but have struggled with making the code behind strictly part of the view.  I believe Model-View-Presenter is the answer.  The following are some great resources to learn more about the technique:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.martinfowler.com/eaaDev/ModelViewPresenter.html"&gt;http://www.martinfowler.com/eaaDev/ModelViewPresenter.html&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://codebetter.com/blogs/jeremy.miller/archive/2006/02/01/137457.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2006/02/01/137457.aspx&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://codebetter.com/blogs/jeremy.miller/archive/2006/02/16/138382.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2006/02/16/138382.aspx&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://codebetter.com/blogs/jeremy.miller/articles/129546.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/articles/129546.aspx&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=72439"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=72439" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/72439.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/03/15/72439.aspx</guid>
            <pubDate>Wed, 15 Mar 2006 19:58:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/72439.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/03/15/72439.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/72439.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/72439.aspx</trackback:ping>
        </item>
        <item>
            <title>Journeys with Model-View-Presenter and ASP.NET</title>
            <category>Model-View-Presenter</category>
            <category>ASP.NET</category>
            <category>C#</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/03/30/73887.aspx</link>
            <description>&lt;P&gt;On a &lt;A href="http://geekswithblogs.net/billy/archive/2006/03/15/72439.aspx"&gt;previous post&lt;/A&gt;, I mentioned my introduction to Model-View-Presenter (MVP).  I've now gotten a chance to try it out on a new project and have been very pleased with the results thus far.  MVP provides an approach for clean separation of concerns within the ASP.NET presentation layer without dismissing the page event model.  MVP sees the code-behind, along with the ASPX page, as strictly part of the view and provides a patter to treat it accordingly.  Although the pattern itself is easy to understand after looking at an example, I expect it'll be another couple of years before strong MVP &amp;#8220;best practices&amp;#8221; emerge.  (I was surprised to find that MVP was actually conceived over ten years ago by IBM's Taligent and &lt;A href="http://www.object-arts.com/Papers/TwistingTheTriad.PDF"&gt;put to the test on Dolphin Smalltalk&lt;/A&gt;.  Even though it's been around for a while, it didn't get any substantial attention unitl recently with Martin Fowler's &lt;A href="http://www.martinfowler.com/eaaDev/ModelViewPresenter.html"&gt;inclusion of MVP in his upcoming book&lt;/A&gt;.)&lt;/P&gt;
&lt;P&gt;I'd like to put forth some rules of thumb for using MVP with ASP.NET that I've learned from a number of other sources and recent personal experiences.  These are very open to criticism...in fact, I encourage it!  By no means do I deliever these as true best practices of MVP - I hope to get as much feedback as possible concerning your own experiences and the applicability of these tips.  (I have not provided much with respect to MVP code samples since your favorite search engine can find you plenty.  The links below contain samples as well.)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;MVP Tips:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Calls from the presenter back to the view should resolve to simple accessors; the accessors should only accept/return model objects or primitives - business objects, data transfer objects, datasets, etc.  (&lt;A href="http://codebetter.com/blogs/jeremy.miller/archive/2006/02/01/137457.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2006/02/01/137457.aspx&lt;/A&gt;) 
&lt;LI&gt;The presenter constructor should accept the view it presents along with any services it may depend on (i.e. &lt;A href="http://www.martinfowler.com/articles/injection.html"&gt;dependency injection&lt;/A&gt;).  The following example serves to illustrates:&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;private readonly IEditCommentView view;&lt;BR&gt;private readonly ICommentDao commentDao;&lt;BR&gt;&lt;BR&gt;public EditCommentPresenter(IEditCommentView view, ICommentDao commentDao) {&lt;BR&gt;  this.view = view;&lt;BR&gt;  this.commentDao = commentDao;&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The presenter should never require a reference to &lt;FONT face="Courier New" size=2&gt;System.Web&lt;/FONT&gt;. 
&lt;LI&gt;Don't expose too much of how the view is implemented via its interface.  For instance, examine the following code...&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;public bool IsClassical {&lt;BR&gt;  get { &amp;#8230; }&lt;BR&gt;  set {&lt;BR&gt;    chkClassical.Checked = value;&lt;BR&gt;    txtComposer.Enabled = value;&lt;BR&gt;  }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In the above example, you could instead provide two setters on the view:  &lt;FONT face="Courier New" size=2&gt;IsClassical&lt;/FONT&gt; and &lt;FONT face="Courier New" size=2&gt;ComposerEnabled&lt;/FONT&gt;.  The downside to having two setters is that you've bound a very minor implmenation detail to the interface - arguably, you should be able to easily switch concrete views and have presentation variations among them all.  The counter-point is that the view should remain completely ignorant of business decisions and should leave all details up to the presenter; therefore, the view should have two setters:  &lt;FONT face="Courier New" size=2&gt;IsClassical&lt;/FONT&gt; and &lt;FONT face="Courier New" size=2&gt;ComposerEnabled&lt;/FONT&gt;.  Additionally, giving &lt;FONT face="Courier New" size=2&gt;ComposerEnabled&lt;/FONT&gt; its own setter allows it to be disabled for security reasons; regardless of the other settings.  (This example and discussion was brought up at &lt;A href="http://codebetter.com/blogs/ben.reichelt/archive/2005/11/18/learning_model_view_presenter.aspx"&gt;http://codebetter.com/blogs/ben.reichelt/archive/2005/11/18/learning_model_view_presenter.aspx&lt;/A&gt;.)  Personally, I've found the single setter to be cleaner and promotes a more cohesive interface.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It's common practice to partition the GUI into separate user controls for proper separation of concerns and maintainability.  An effect of this is that it becomes easy to define the view/presenter relationship from the code-behind of the containing ASPX page.  The following example illustrates the parent page determining this relationship between a contained usercontrol (i.e. the view defined as &lt;FONT face="Courier New" size=2&gt;commentListing&lt;/FONT&gt;), and the usercontrol's presenter (&lt;FONT face="Courier New" size=2&gt;ListCommentsPresenter&lt;/FONT&gt;):&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;ListCommentsPresenter presenter = new ListCommentsPresenter(commentListing, DaoFactory.GetCommentDao());&lt;BR&gt;commentListing.AttachPresenter(presenter);&lt;BR&gt;&lt;BR&gt;if (!IsPostBack) {&lt;BR&gt;  presenter.Init();&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The call to AttachPresenter binds the presenter to a private member within the user control.  With this approach, the usercontrol never has to know how to create the presenter nor need knowledge of the constructor arguments that go along with the presenter's creation.  Finally, the usercontrol doesn't have to worry about when to call Init.  (This implementation tip comes from &lt;A href="http://codebetter.com/blogs/jeremy.miller/archive/2006/02/01/137457.aspx"&gt;http://codebetter.com/blogs/jeremy.miller/archive/2006/02/01/137457.aspx&lt;/A&gt;.)&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Views should provide a &lt;FONT face="Courier New" size=2&gt;DisplayMessage&lt;/FONT&gt; property to the presenter so as to return feedback concerning the execution of an operation.  Alternatively, the presenter could return a &amp;#8220;presenter result&amp;#8220; object to indicate what should happen next:  redirect, stay on the page, go to login, etc.  (This latter tip came from Mike Mason's blog that's &lt;A href="http://72.14.203.104/search?q=cache:0qj2ZdSOKA0J:mikemason.ca/2006/02/15/+boy+meets+world+mvp&amp;hl=en&amp;gl=us&amp;ct=clnk&amp;cd=1"&gt;accessible via Google cache&lt;/A&gt;.) 
&lt;LI&gt;Unit tests should be used for guiding the communications protocol between a view and presenter.  Implementing the view itself should always be the last thing you do - NUnit and FitNesse can be used to validate most of the presentation before writing a scratch of HTML.  The primary benefit of this is ensuring you've done a good job of cleanly separating all possible business logic out of the view.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There are certainly other topics of discussion concerning MVP, but the above should be a good start with respect to &amp;#8220;better&amp;#8220; MVP practices.  Please send feedback, comments and criticisms my way!&lt;/P&gt;
&lt;P&gt;Billy&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=73887"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=73887" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/73887.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/03/30/73887.aspx</guid>
            <pubDate>Thu, 30 Mar 2006 18:59:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/73887.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/03/30/73887.aspx#feedback</comments>
            <slash:comments>22</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/73887.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/73887.aspx</trackback:ping>
        </item>
        <item>
            <title>Model-View-Presenter with ASP.NET:  An (almost) exhaustive examination</title>
            <category>ASP.NET</category>
            <category>C#</category>
            <category>Architecture</category>
            <category>Model-View-Presenter</category>
            <category>NHibernate</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/07/02/83906.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I've been working on an article for the past few weeks concerning the usage of the Model-View-Presenter pattern with ASP.NET.  The article has been completed and uploaded to &lt;/FONT&gt;&lt;A href="http://www.codeproject.com/useritems/ModelViewPresenter.asp"&gt;&lt;FONT face=Arial size=2&gt;http://www.codeproject.com/useritems/ModelViewPresenter.asp&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;.  I hope you find this article useful.  Please feel free to raise your questions and/or concerns.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=83906"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=83906" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/83906.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/07/02/83906.aspx</guid>
            <pubDate>Mon, 03 Jul 2006 01:22:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/83906.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/07/02/83906.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/83906.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/83906.aspx</trackback:ping>
        </item>
        <item>
            <title>Using NUnitAsp to test a secure webpage</title>
            <category>ASP.NET</category>
            <category>C#</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/05/10/77820.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;NUnitAsp&amp;nbsp;is a great tool for unit testing ASP.NET web pages.&amp;nbsp; Although&amp;nbsp;NUnitAsp tests are slow to run, they're especially useful&amp;nbsp;for running &amp;#8220;web smoke tests&amp;#8221; on a nightly basis.&amp;nbsp; (I&amp;nbsp;mark every&amp;nbsp;NUnitAsp&amp;nbsp;class with &lt;CODE&gt;&lt;FONT size=2&gt;[&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Category&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Web Smoke Tests"&lt;/FONT&gt;&lt;FONT size=2&gt;)]&lt;/CODE&gt; so that I can easily exclude them from my&amp;nbsp;more frequent&amp;nbsp;unit testing.)&amp;nbsp; On many projects, authentication is required to view a webpage.&amp;nbsp; When testing an application requiring Windows authentication, NUnitAsp can be easily configured to run as the current user logged in or as a specific domain user.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=2&gt;The sample test below shows how to run an NUnitAsp test using the credentials of the user that's currently logged in:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;FONT size=2&gt;&lt;P&gt;[&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Test&lt;/FONT&gt;&lt;FONT size=2&gt;]&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; TestProjectScope() {&lt;/P&gt;&lt;P&gt;  Browser.Credentials = System.Net.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;CredentialCache&lt;/FONT&gt;&lt;FONT size=2&gt;.DefaultCredentials;&lt;/P&gt;&lt;P&gt;  Browser.GetPage(&lt;FONT color=#800000 size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;http://localhost/WebPageToTest.aspx"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=2&gt;The sample test below shows how to run an NUnitAsp test using specific credentials.&amp;nbsp; If you're expecting the unit tests to be run from different computers, this is the recommended approach so that the tests are always run&amp;nbsp;as the same person for consistency:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;FONT size=2&gt;&lt;P&gt;[&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Test&lt;/FONT&gt;&lt;FONT size=2&gt;]&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; TestProjectScope() {&lt;/P&gt;&lt;P&gt;  Browser.Credentials = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;NetworkCredential&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"username"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"password"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"domain"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;  Browser.GetPage(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"&lt;FONT color=#800000 size=2&gt;http://localhost/WebPageToTest.aspx"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Note that the username/password/domain must represent actual credentials - the user must really exist.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=77820"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=77820" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/77820.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/05/10/77820.aspx</guid>
            <pubDate>Wed, 10 May 2006 12:48:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/77820.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/05/10/77820.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/77820.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/77820.aspx</trackback:ping>
        </item>
        <item>
            <title>Generic DAO with NHibernate</title>
            <category>C#</category>
            <category>NHibernate</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/02/15/69607.aspx</link>
            <description>&lt;PRE&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;FONT face=Arial&gt;4/28/06 Update:  The NHibernate codeproject.com article wins ASP.NET article of the month.  Woohoo!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;3/14/06 Update:  See how this is used in a sample application at &lt;A href="http://www.codeproject.com/useritems/NHibernateBestPractices.asp" target=_blank&gt;&lt;FONT face=Arial&gt;http://www.codeproject.com/useritems/NHibernateBestPractices.asp&lt;/FONT&gt;&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;&lt;HR id=null&gt;&lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;Hibernate.org has a &lt;/FONT&gt;&lt;A href="http://www.hibernate.org/328.html" target=_blank&gt;&lt;FONT face=Arial&gt;great article&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; on creating a generic DAO for Hibernate in Java.  Below is what I use for the C# port.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT face=Arial&gt;The interface for common CRUD functionality...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;interface&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;GenericDAO&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T, IdDataType&gt; {&lt;/P&gt;&lt;P&gt;  T GetById(IdDataType id, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT size=2&gt; shouldLock);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;  List&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; GetAll();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;  List&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; GetByExample(T exampleInstance, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt;[] propertiesToExclude);&lt;/P&gt;&lt;P&gt;  T SaveOrUpdate(T entity);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;  void&lt;/FONT&gt;&lt;FONT size=2&gt; Delete(T entity);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;The generic DAO implementation...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;abstract&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;GenericNHibernateDAO&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T, IdDataType&gt; : &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;GenericDAO&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T, IdDataType&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;  ///&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;PARAM name="sessionManager"&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;Could be set using contruction injection IoC&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;/PARAM&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; GenericNHibernateDAO(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ISessionManager&lt;/FONT&gt;&lt;FONT size=2&gt; sessionManager) {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.sessionManager = sessionManager;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; T GetById(IdDataType id, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT size=2&gt; shouldLock) {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ISession&lt;/FONT&gt;&lt;FONT size=2&gt; session = GetSession();&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;T entity;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (shouldLock) {&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;      &lt;/FONT&gt;entity = (T) session.Load(persitentType, id, &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;LockMode&lt;/FONT&gt;&lt;FONT size=2&gt;.Upgrade);&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;else&lt;/FONT&gt;&lt;FONT size=2&gt; {&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;      &lt;/FONT&gt;entity = (T) session.Load(persitentType, id);&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; entity;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;List&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; GetAll() {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; GetByCriteria();&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;protected&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;List&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; GetByCriteria(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;params&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ICriterion&lt;/FONT&gt;&lt;FONT size=2&gt;[] criterion) {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ISession&lt;/FONT&gt;&lt;FONT size=2&gt; session = GetSession();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ICriteria&lt;/FONT&gt;&lt;FONT size=2&gt; criteria = session.CreateCriteria(persitentType);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;foreach&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ICriterion&lt;/FONT&gt;&lt;FONT size=2&gt; criterium &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT size=2&gt; criterion) {&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;      &lt;/FONT&gt;criteria.Add(criterium);&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;GenericUtils&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; genericUtils = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;GenericUtils&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt;();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; genericUtils.ConvertToGenericList(criteria.List());&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;List&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; GetByExample(T exampleInstance, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt;[] propertiesToExclude) {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ISession&lt;/FONT&gt;&lt;FONT size=2&gt; session = GetSession();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ICriteria&lt;/FONT&gt;&lt;FONT size=2&gt; criteria = session.CreateCriteria(persitentType);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;Example&lt;/FONT&gt;&lt;FONT size=2&gt; example = &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Example&lt;/FONT&gt;&lt;FONT size=2&gt;.Create(exampleInstance);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;foreach&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; propertyToExclude &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT size=2&gt; propertiesToExclude) {&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;      &lt;/FONT&gt;example.ExcludeProperty(propertyToExclude);&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;criteria.Add(example);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;GenericUtils&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt; genericUtils = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;GenericUtils&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;T&gt;();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; genericUtils.ConvertToGenericList(criteria.List());&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; T SaveOrUpdate(T entity) {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ISession&lt;/FONT&gt;&lt;FONT size=2&gt; session = GetSession();&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;session.SaveOrUpdate(entity);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; entity;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; Delete(T entity) {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;ISession&lt;/FONT&gt;&lt;FONT size=2&gt; session = GetSession();&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;session.Delete(entity);&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ISession&lt;/FONT&gt;&lt;FONT size=2&gt; GetSession() {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;Check&lt;/FONT&gt;&lt;FONT size=2&gt;.Require(sessionManager != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"sessionManager was not set"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;    &lt;/FONT&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; sessionManager.OpenSession();&lt;/P&gt;&lt;P&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Type&lt;/FONT&gt;&lt;FONT size=2&gt; persitentType = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;typeof&lt;/FONT&gt;&lt;FONT size=2&gt;(T);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#808080&gt;  &lt;/FONT&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ISessionManager&lt;/FONT&gt;&lt;FONT size=2&gt; sessionManager;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;And for using this within your code...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ProjectDAONHibernate&lt;/FONT&gt;&lt;FONT size=2&gt; : &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;GenericNHibernateDAO&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Project&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt; {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;  public&lt;/FONT&gt;&lt;FONT size=2&gt; ProjectDAONHibernate(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ISessionManager&lt;/FONT&gt;&lt;FONT size=2&gt; sessionManager) : &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;base&lt;/FONT&gt;&lt;FONT size=2&gt;(sessionManager) {}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;HR id=null&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial size=4&gt;&lt;BR&gt;Notes:&lt;/FONT&gt;&lt;/P&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;NHibernate Generics: &lt;/STRONG&gt;To use generics with NHibernate, use the &amp;#8220;NHibernate Generics&amp;#8221; assembly available at &lt;A href="http://www.ayende.com/projects/nhibernate-query-analyzer/generics.aspx" target=_blank&gt;http://www.ayende.com/projects/nhibernate-query-analyzer/generics.aspx&lt;/A&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;SessionManager:&lt;/STRONG&gt; To help with NHibernate session management, a good tool of choice is Castle Project's NHibernate facility:&amp;nbsp; &lt;A href="http://www.castleproject.org/index.php/Facility:NHibernate" target=_blank&gt;http://www.castleproject.org/index.php/Facility:NHibernate&lt;/A&gt;.&amp;nbsp; Alternatively, a good design is explained in Chapter 8 of Hibernate In Action by Christian Bauer and Gavin King.&amp;nbsp; (They should be having a second edition coming out soon.)&amp;nbsp; The beneift of using Castle Project comes to light when used in conjunction with their Transaction factility;&amp;nbsp;the Transaction facility allows you to mark which actions should be transactional via inline attributes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;Design by Contract:&lt;/STRONG&gt;&amp;nbsp; You may have noticed &lt;FONT face="Courier New" color=#008080&gt;Check&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;.Require&lt;/FONT&gt; reference.&amp;nbsp; This is a completely optional,&amp;nbsp;design-by-contract constraint using the VERY light weight framework described at &lt;A href="http://www.codeproject.com/csharp/designbycontract.asp" target=_blank&gt;http://www.codeproject.com/csharp/designbycontract.asp&lt;/A&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;I've had wonderful success with NHibernate in the past and can continue to embrace it with C# 2.0 using generics.&amp;nbsp; The .NET community is finally starting to take notice of ORM tools like NHibernate which are helping to shave weeks, if not months, off of development.&amp;nbsp; I hope you all experience similar successes.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=69607"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=69607" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/69607.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/02/15/69607.aspx</guid>
            <pubDate>Wed, 15 Feb 2006 13:32:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/69607.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/02/15/69607.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/69607.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/69607.aspx</trackback:ping>
        </item>
        <item>
            <title>ReSharper 2.0 Beta Now Available!</title>
            <category>ASP.NET</category>
            <category>C#</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/04/25/76336.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;After using it for a couple of hours it looks stable and ready for use.&amp;nbsp; Needless to say, it's nice to have it back in VS 2005 since the out-of-the-box refactoring support freezes the IDE 1/2 the time and takes at least a minute to complete the other 1/2 of the time.&amp;nbsp; (I can finally get rid of all those extra C# using statements just taking up space!)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;When you install ReSharper 2.0, it forces you to install to VS 2005 hotfixes.&amp;nbsp; I'm not sure what happened after installing these hotfixes, but my ASP.NET solution compile times have gone from&amp;nbsp;1-2 minutes down to 10 seconds or so.&amp;nbsp; Whatever the cause, needless to say,&amp;nbsp;I'm happy with the results.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;You can download the beta at &lt;A href="http://www.jetbrains.com/resharper/beta20.html"&gt;http://www.jetbrains.com/resharper/beta20.html&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=76336"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=76336" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/76336.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/04/25/76336.aspx</guid>
            <pubDate>Tue, 25 Apr 2006 13:21:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/76336.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/04/25/76336.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/76336.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/76336.aspx</trackback:ping>
        </item>
        <item>
            <title>An alternative to "placeholder" Inheritance Mapping with NHibernate</title>
            <category>NHibernate</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/04/24/76254.aspx</link>
            <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Suppose you have a &amp;#8220;Project&amp;#8221;&amp;nbsp;object that has 0 or more &amp;#8220;Attachment&amp;#8221; objects in your domain.&amp;nbsp; (The Project class exposes an IList of Attachments and the Attachment has a reference to &amp;#8220;ParentProject.&amp;#8221;)&amp;nbsp; Now you'd like to introduce a new object called &amp;#8220;Cabinet&amp;#8221; which can also have a number of attachments associated with it.&amp;nbsp; (Cabinet also exposes an IList of Attachments.)&amp;nbsp; The question is, how&amp;nbsp;do we&amp;nbsp;manage the relationship via NHibernate and within the database so the attachment can be used by either Project or Cabinet and how does this affect the existing, one-to-many relationship between Project and Attachment?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;To solve the problem you can&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Create subclasses, &amp;#8220;ProjectAttachment&amp;#8221; and &amp;#8220;CabinetAttachment,&amp;#8220; and use&amp;nbsp;the inheritance-mapping-strategy table-per-hierarchy using a discriminator.&amp;nbsp; You'd then change the&amp;nbsp;Attachment listing&amp;nbsp;within Project to contain ProjectAttachment objects.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Create subclasses and use the inheritance-mapping-strategy&amp;nbsp;table-per-subclass.&amp;nbsp; This ends up with three tables.&amp;nbsp; You'd also have to change the Project-Attachment as show in the first option.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Create subclasses and use table-per-concrete-class.&amp;nbsp; This ends up with two tables.&amp;nbsp; You'd also have to change the Project-Attachment as show in the first option.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Don't subclass Attachment but create two many-to-many join tables:&amp;nbsp; one&amp;nbsp;between&amp;nbsp;Project and Attachment and one between Cabinet and Attachment.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The first three options, along with their benefits and limitations,&amp;nbsp;are discussed at &lt;A href="http://www.hibernate.org/hib_docs/nhibernate/html/inheritance.html"&gt;http://www.hibernate.org/hib_docs/nhibernate/html/inheritance.html&lt;/A&gt;.&amp;nbsp; The forth is a simple trick to avoid having to create container subclasses that do nothing but act as a relationship place-holder for the Project-Attachment and Cabinet-Attachment relationships.&amp;nbsp; Obviously, if ProjectAttachment has different&amp;nbsp;&lt;EM&gt;behavior&lt;/EM&gt; than CabinetAttachment, then subclassing is the best solution.&amp;nbsp; But in many cases, you simply want the same object (e.g. Attachment)&amp;nbsp;to be available to differen parent objects (e.g. Project and Cabinet).&amp;nbsp; In these cases, creating many-to-many relationships using join tables and maintaining the relationship from the parent object&amp;nbsp;keeps the domain model devoid of place-holder classes that may otherwise clutter the code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Billy&lt;/FONT&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=76254"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=76254" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/76254.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/04/24/76254.aspx</guid>
            <pubDate>Mon, 24 Apr 2006 17:43:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/76254.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/04/24/76254.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/76254.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/76254.aspx</trackback:ping>
        </item>
        <item>
            <title>Dependency Injection for Loose Coupling</title>
            <category>C#</category>
            <category>Architecture</category>
            <link>http://geekswithblogs.net/Billy/archive/2006/04/18/75505.aspx</link>
            <description>&lt;P&gt;This&amp;nbsp;post describes the use of Inversion-of-Control, or Dependency Injection, to promote loose &lt;BR&gt;coupling and convenient unit testing.&lt;BR&gt;&lt;BR&gt;----&lt;/P&gt;
&lt;H2 __designer:dtid="5348024557502475"&gt;Introduction&lt;/H2&gt;
&lt;P __designer:dtid="5348024557502471"&gt;In designing an object-oriented application, a major tenant of design is "loose coupling." Loosely, no mean for the pun, "loose coupling" means that objects should only have as many dependencies as is needed to do their job - and the dependencies should be few. Furthermore, an object's dependencies should be on interfaces and not on "concrete" object when possible. (A concrete object is any object created with the keyword &lt;CODE __designer:dtid="5348024557502472"&gt;&lt;FONT color=#990000&gt;new&lt;/FONT&gt;&lt;/CODE&gt;.) Loose coupling promotes greater reusability, easier maintainability, and allows you to easily provide "mock" objects in place of expensive services, such as a socket-communicator. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502473"&gt;"Dependency Injection" (DI), also more cryptically known as "Inversion of Control" (IoC), can be used as a technique for encouraging this loose coupling. There are two primary approaches to implementing DI: constructor injection and setter injection. Obviously, at some point, &lt;I __designer:dtid="5348024557502474"&gt;something&lt;/I&gt; must be responsible for creating the concrete objects that will be injected into another object. The injector can be a parent object, which I'll call the "DI controller," or can be externalized and handled by a "DI container" framework. What follows is a brief overview of the various approaches for using dependency injection techniques. &lt;/P&gt;
&lt;H2 __designer:dtid="5348024557502475"&gt;Constructor Injection&lt;/H2&gt;
&lt;P __designer:dtid="5348024557502476"&gt;Constructor Injection is the DI technique of passing an object's dependencies to its constructor. The below example includes a class, &lt;CODE __designer:dtid="5348024557502477"&gt;&lt;FONT color=#990000&gt;Customer&lt;/FONT&gt;&lt;/CODE&gt;, that exposes a method for retrieving every sales-order that the customer made on a particular date. Consequently, the &lt;CODE __designer:dtid="5348024557502478"&gt;&lt;FONT color=#990000&gt;Customer&lt;/FONT&gt;&lt;/CODE&gt; class needs a data-access object for communicating with the database. Assume an &lt;CODE __designer:dtid="5348024557502479"&gt;&lt;FONT color=#990000&gt;OrderDao&lt;/FONT&gt;&lt;/CODE&gt; ("order data-access object") exists which implements the interface &lt;CODE __designer:dtid="5348024557502480"&gt;&lt;FONT color=#990000&gt;IOrderDao&lt;/FONT&gt;&lt;/CODE&gt;. One way that a &lt;CODE __designer:dtid="5348024557502481"&gt;&lt;FONT color=#990000&gt;Customer&lt;/FONT&gt;&lt;/CODE&gt; object can get this dependency is by executing the following within the &lt;CODE __designer:dtid="5348024557502482"&gt;&lt;/CODE&gt;: &lt;CODE __designer:dtid="5348024557502483"&gt;&lt;FONT color=#990000&gt;IOrderDao orderDao = new OrderDao();&lt;/FONT&gt;&lt;/CODE&gt;. The primary disadvantage of this is two-fold: 1) the benefit of having the interface in the first place has been negated since the concrete instance was created locally, and 2) OrderDao cannot easily be replaced by a mock object for testing purposes. (Mock objects will be discussed shortly.) The aforementioned example follows: &lt;/P&gt;&lt;PRE __designer:dtid="5348024557502484"&gt;public class Customer {
    public Customer(IOrderDao orderDao) {
        if (orderDao == null) throw new ArgumentNullException("orderDao may not be null");
        
        this.orderDao = orderDao;
    }
    
    public IList GetOrdersPlacedOn(DateTime date) {
        ... code that uses the orderDao member get orders from the datasource ...
    }
    
    private IOrderDao orderDao;
}
&lt;/PRE&gt;
&lt;P __designer:dtid="5348024557502485"&gt;In the example, note that the constructor accepts an interface; it DOES NOT accept a concrete object. Also note that an exception is thrown if the &lt;CODE __designer:dtid="5348024557502486"&gt;&lt;FONT color=#990000&gt;orderDao&lt;/FONT&gt;&lt;/CODE&gt; parameter is null. This emphasizes the importance of receiving a valid dependency. Constructor Injection is, in my opinion, the preferred mechanism for giving an object its dependencies. It is clear to the developer invoking the object which dependencies need to be given to the &lt;CODE __designer:dtid="5348024557502487"&gt;&lt;FONT color=#990000&gt;Customer&lt;/FONT&gt;&lt;/CODE&gt; object for proper execution. But consider the following example... Suppose you have a class with 10 methods that have no dependencies but you're adding a new method that &lt;I __designer:dtid="5348024557502488"&gt;does&lt;/I&gt; have a dependency on IOrderDao. You could change the constructor to use Constructor Injection, but this may force you to change constructor calls all over the place. Alternatively, you could just add a new constructor that takes the dependency, but then how does a developer easily know when to use one constructor over the other. Finally, if the dependency is very expensive to create, why should it be created and passed to the constructor when it may only be used rarely? "Setter Injection" is another DI technique that can be used in situations such as this. &lt;/P&gt;
&lt;H2 __designer:dtid="5348024557502489"&gt;Setter Injection&lt;/H2&gt;
&lt;P __designer:dtid="5348024557502490"&gt;Setter Injection does not force dependencies to be passed to the constructor. Instead, the dependencies are set onto public properties exposed by the object in need. As implied previously, the primary motivators for doing this include 1) supporting dependency injection without having to modify the constructor of a legacy class and 2) allowing expensive resources or services to be created as late as possible and only when needed. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502491"&gt;The code below modifies the Constructor Injection example to use Setter Injection instead: &lt;/P&gt;&lt;PRE __designer:dtid="5348024557502492"&gt;public class Customer {
    public Customer() {}

    public IOrderDao OrderDao {
        set { orderDao = value; }
        get {
            if (orderDao == null) throw new MemberAccessException("orderDao has not been initialized");
            return orderDao;
        }
    }
    
    public IList GetOrdersPlacedOn(DateTime date) {
        ... code that uses the OrderDao public property to get orders from the datasource ...
    }
    
    // Should not be called directly; use the public property instead
    private IOrderDao orderDao;
}
&lt;/PRE&gt;
&lt;P __designer:dtid="5348024557502493"&gt;In the above example, the constructor accepts no arguments. Instead, the invoking object is responsible for setting the &lt;CODE __designer:dtid="5348024557502494"&gt;&lt;FONT color=#990000&gt;IOrderDao&lt;/FONT&gt;&lt;/CODE&gt; dependency before the method &lt;CODE __designer:dtid="5348024557502495"&gt;&lt;FONT color=#990000&gt;GetOrdersPlacedOn&lt;/FONT&gt;&lt;/CODE&gt; is called. With Constructor Injection, an exception was thrown if the dependency was not set immediately; i.e. upon creation. With Setter Injection, an exception isn't thrown until a method actually attempts to use the dependency. Make note of the fact that &lt;CODE __designer:dtid="5348024557502496"&gt;&lt;FONT color=#990000&gt;GetOrdersPlacedOn&lt;/FONT&gt;&lt;/CODE&gt; uses the public &lt;CODE __designer:dtid="5348024557502497"&gt;&lt;FONT color=#990000&gt;OrderDao&lt;/FONT&gt;&lt;/CODE&gt; property; it &lt;I __designer:dtid="5348024557502498"&gt;does not&lt;/I&gt; call the private &lt;CODE __designer:dtid="5348024557502499"&gt;&lt;FONT color=#990000&gt;orderDao&lt;/FONT&gt;&lt;/CODE&gt; directly. This is so that the getter method has an opportunity to validate if the dependency has yet been initialized. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502500"&gt;Setter Injection should be used sparingly in place of Constructor Injection because it 1) does not make it clear to the developer which dependencies are needed when, at least until a "has not been initialized" exception is thrown, and 2) makes it a bit more difficult to track down where the exception came from and why it got thrown. With this said, Setter Injection can save on modifying a lot of legacy code when introducing new methods and can provide a performance boost if the dependency is expensive or not easily accessible. &lt;/P&gt;
&lt;H2 __designer:dtid="5348024557502501"&gt;The Injectors&lt;/H2&gt;
&lt;P __designer:dtid="5348024557502502"&gt;The next logical question is, what actually creates the dependencies that are to be injected into "injectees"? There are two appropriate places for adding creation logic: controllers and containers. &lt;/P&gt;
&lt;H3 __designer:dtid="5348024557502503"&gt;DI Controllers&lt;/H3&gt;
&lt;P __designer:dtid="5348024557502504"&gt;The "DI controller" approach is the simpler to understand and implement. In a properly tiered architecture, an application has distinct layers for handling logic. The simplest layering usually consists of a data-layer for talking to the database, a presentation-layer for displaying the UI, a domain-logic layer for performing business logic. A "controller" layer always exists, even if not well defined, for coordinating UI events to the domain and data layers and vice versa. For example, in ASP.NET, the code-behind page acts as a rudimentary controller layer. More formalized controller-layer approaches exist: Struts and Spring for Java; Front Controller and Spring .NET for .NET. All of these approaches follow some form of variant of the Model-View-Controller pattern. Regardless of what you use as your controller, the controller is an appropriate location for performing Dependency Injection "wiring." This is where concrete objects are created and injected as dependencies. What follows are two examples of DI performed by a controller. The first is an illustrative example of "production code" - code that you'd end up deploying. The second is an example of "test code" - code that's used to test the application but is not deployed and does not have need to have a live database. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502505"&gt;Controller code performing the dependency injection (e.g. from an ASP.NET code behind page):&lt;/P&gt;&lt;PRE __designer:dtid="5348024557502506"&gt;... code performed when the controller is loaded ...

IOrderDao orderDao = new OrderDao();
// Using Setter Injection on a pre-existing customer
someCustomer.OrderDao = orderDao;
IList ordersPlacedToday = someCustomer.GetOrdersPlacedOn(DateTime.Now);

...
&lt;/PRE&gt;
&lt;P __designer:dtid="5348024557502507"&gt;Unit-test code performing the dependency injection:&lt;/P&gt;&lt;PRE __designer:dtid="5348024557502508"&gt;IOrderDao orderDao = new MockOrderDao();
// Using Setter Injection on a pre-existing customer
someCustomer.OrderDao = orderDao;
IList ordersPlacedToday = someCustomer.GetOrdersPlacedOn(DateTime.Now);
&lt;/PRE&gt;
&lt;P __designer:dtid="5348024557502509"&gt;One of the major benefits of using a DI-controller to inject dependencies is that it's straight forward and easy to point to where the creation is occurring. The drawback to using DI-controllers is that the dependencies are still hard-coded somewhere; albeit, they're hard-coded in a location that is often subject to frequent change anyway. Another drawback is that now the DI-controllers themselves can't be easily unit-tested with mock objects. (Granted, a powerful tool such as &lt;A href="http://www.typemock.com/" target=_blank __designer:dtid="5348024557502510"&gt;TypeMock&lt;/A&gt; can do just about anything when it comes to injecting mock objects.) &lt;/P&gt;
&lt;P __designer:dtid="5348024557502511"&gt;In ASP.NET, I prefer to use the Model-View-Presenter (MVP) pattern and have the ASP.NET code-behind page create dependencies and inject them to the presenter via Construction Injection. Additionally, I use UserControls as the View part of the pattern so the ASP.NET code-behind acts purely as an MVP "dependency initializer" between the UserControls (view) and their presenters. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502512"&gt;Another option to implementing constructor or setter DI is the use of an application container... &lt;/P&gt;
&lt;H3 __designer:dtid="5348024557502513"&gt;DI Containers&lt;/H3&gt;
&lt;P __designer:dtid="5348024557502514"&gt;Inversion-of-Control/Dependency-Injection "containers" can be used to watch an application and inject dependencies whenever a particular event occurs. For example, whenever a &lt;CODE __designer:dtid="5348024557502515"&gt;&lt;FONT color=#990000&gt;Customer&lt;/FONT&gt;&lt;/CODE&gt; instance is created, it automatically gets injected with its needed dependencies. It's a strange concept at first, but can be useful for managing large applications with many service dependencies. Different container provides each have their own mechanism for managing dependency injection settings.&lt;/P&gt;
&lt;P __designer:dtid="5348024557502516"&gt;Spring .NET allows you to define dependency injections within an XML file. The following example Spring .NET XML uses Setter Injection to give an ASPX code-behind page its data-access object dependency: &lt;/P&gt;
&lt;P __designer:dtid="5348024557502516"&gt;&amp;lt;spring&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;context type="Spring.Context.Support.WebApplicationContext, Spring.Web"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;resource uri="config://spring/objects" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/context&amp;gt;&lt;/P&gt;
&lt;P __designer:dtid="5348024557502516"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;objects xmlns="&lt;A href="http://www.springframework.net/"&gt;http://www.springframework.net&lt;/A&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Data Access Object that will be injected into ASPX page --&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;object id="daoFactory" type="MyApp.Data.DaoFactory, MyApp.Data" /&amp;gt;&lt;/P&gt;
&lt;P __designer:dtid="5348024557502516"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;object type="ViewDetails.aspx"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="DaoFactory"&amp;nbsp; ref="daoFactory" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/object&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/objects&amp;gt;&lt;BR&gt;&amp;lt;/spring&amp;gt;&lt;/P&gt;
&lt;P __designer:dtid="5348024557502516"&gt;The ASPX code-behind simply exposes a public property called &lt;CODE __designer:dtid="5348024557502519"&gt;&lt;FONT color=#990000&gt;DaoFactory&lt;/FONT&gt;&lt;/CODE&gt; that "catches" the dependency whenever the page gets called. See &lt;A href="http://www.springframework.net/" target=_blank __designer:dtid="5348024557502520"&gt;Spring .NET's website&lt;/A&gt; for more details and more examples. For Java developers, be sure to check out &lt;A href="http://www.springframework.com/" target=_blank __designer:dtid="5348024557502521"&gt;Spring's website&lt;/A&gt;. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502522"&gt;Many other containers exist, some of which don't require much XML management at all (for those of you that cringe at the sight of a 500 line XML file). For Java developers, take a look at &lt;A href="http://www.picocontainer.org/4.1+Container+Comparison" target=_blank __designer:dtid="5348024557502523"&gt;http://www.picocontainer.org/4.1+Container+Comparison&lt;/A&gt; for a good comparison of options. For .NET developers, the decision is simpler as fewer options exist. (Is that a good thing?) See &lt;A href="http://csharp-source.net/open-source/containers" target=_blank __designer:dtid="5348024557502524"&gt;http://csharp-source.net/open-source/containers&lt;/A&gt; for some open-source options. &lt;/P&gt;
&lt;H2 __designer:dtid="5348024557502525"&gt;Unit Testing with Injected Mock Objects&lt;/H2&gt;
&lt;P __designer:dtid="5348024557502526"&gt;The greatest benefits that I've experienced using DI are cleaner unit testing and greater portability. Portability is a given as most of the dependencies are on interfaces. But let's look at how DI can benefit unit testing as well. It is often the case that developers write unit tests against a live database. This is all well and fine, but it quickly brings the speed of a suite of unit tests to a crawl. To keep unit testing from becoming a drag, it needs to be easy to turn off slow unit tests that actually hit the database while still testing the business logic that depends on data access. Mock objects are perfect for doing just this. A mock object simulates the responses of an actual object, acting as if it's using a real resource. They're great for mocking accessing to a database, mocking calls to IO, mocking calls to a web service, etc. &lt;/P&gt;
&lt;P __designer:dtid="5348024557502527"&gt;The below code shows a mock data-access implementation of the &lt;CODE __designer:dtid="5348024557502528"&gt;&lt;FONT color=#990000&gt;IOrderDao&lt;/FONT&gt;&lt;/CODE&gt; interface used throughout the article: &lt;/P&gt;&lt;PRE __designer:dtid="5348024557502529"&gt;public class MockOrderDao : IOrderDao {
    public Order GetOrderById(long orderId) {
        Order foundOrder = new Order();
        foundOrder.SaleDate = "1/1/06";
        foundOrder.ID = orderId;
        
        return foundOrder;
    }
}
&lt;/PRE&gt;
&lt;P __designer:dtid="5348024557502530"&gt;This trivial mock data-access object implements IOrderDao and can therefore be passed to any object that's dependent on &lt;CODE __designer:dtid="5348024557502531"&gt;&lt;FONT color=#990000&gt;IOrderDao&lt;/FONT&gt;&lt;/CODE&gt; via Constructor or Setter injection. Now all your business logic can be tested without actually hitting the database. In my own test suite, I usually have a section that contains "real" database tests and then pass mock database-access objects for testing my domain objects. &lt;/P&gt;
&lt;H2 __designer:dtid="5348024557502532"&gt;Additional References&lt;/H2&gt;
&lt;P __designer:dtid="5348024557502533"&gt;* &lt;A href="http://www.martinfowler.com/articles/injection.html" target=_blank __designer:dtid="5348024557502534"&gt;http://www.martinfowler.com/articles/injection.html&lt;/A&gt;&lt;BR __designer:dtid="5348024557502535"&gt;* &lt;A href="http://www-128.ibm.com/developerworks/library/j-mocktest.html" target=_blank __designer:dtid="5348024557502536"&gt;http://www-128.ibm.com/developerworks/library/j-mocktest.html&lt;/A&gt; &lt;/P&gt;&lt;!-------------------------------    That's it!   ---------------------------&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=75505"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=75505" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Billy/aggbug/75505.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Billy McCafferty</dc:creator>
            <guid>http://geekswithblogs.net/Billy/archive/2006/04/18/75505.aspx</guid>
            <pubDate>Tue, 18 Apr 2006 16:30:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Billy/comments/75505.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Billy/archive/2006/04/18/75505.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Billy/comments/commentRss/75505.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Billy/services/trackbacks/75505.aspx</trackback:ping>
        </item>
    </channel>
</rss>