<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Devlicio.us</title><link>http://devlicio.us/blogs/</link><description>Your Agile .NET Community</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Devlicious" type="application/rss+xml" /><item><title>Asynchronous Execution, Animation and more in MVVM with Caliburn</title><link>http://feedproxy.google.com/~r/Devlicious/~3/5IKq5EVEojA/asynchronous-execution-animation-and-more-in-mvvm-with-caliburn.aspx</link><pubDate>Fri, 10 Jul 2009 04:21:24 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49321</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;On the Silverlight Insiders mailing list there’s been a discussion about the difficulties of handling animations when trying to use an MVVM architecture.&amp;nbsp; I’m not going to go into the details here, as I am going to cover this more fully in a future blog post, but still, I could not resist showing off the elegant way that Caliburn solves this problem.&amp;nbsp; Here is some XAML:&lt;/p&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;TextBox x:Name=&amp;quot;username&amp;quot; /&amp;gt;
&amp;lt;PasswordBox x:Name=&amp;quot;password&amp;quot; /&amp;gt;

&amp;lt;Button Content=&amp;quot;Login&amp;quot;
        pf:Message.Attach=&amp;quot;Login(username.Text, password)&amp;quot; /&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;And here is the code from the ViewModel that Caliburn execute when the user clicks the button: &lt;pre&gt;&lt;/pre&gt;&lt;pre class="brush: xml;"&gt;public IEnumerable&amp;lt;IResult&amp;gt; Login(string username, string password)
{
    _credential.Username = username;
    _credential.Password = password;

    var result = new Result();
    var request = new GetUserSettings(username);

    yield return new ProcessQuery(request, result, &amp;quot;Logging In...&amp;quot;);

    if (result.HasErrors)
    {
        yield return new ShowMessageBox(&amp;quot;The username or password provided is incorrect.&amp;quot;, &amp;quot;Access Denied&amp;quot;);
        yield break;
    }

    var response = result.GetResponse(request);

    if(response.Permissions == null || response.Permissions.Count &amp;lt; 1)
    {
        yield return new ShowMessageBox(&amp;quot;You do not have permission to access the dashboard.&amp;quot;, &amp;quot;Access Denied&amp;quot;);
        yield break;
    }

    _context.Permissions = response.Permissions;

    yield return new OpenWith&amp;lt;IShell, IDashboard&amp;gt;();
}
&lt;/pre&gt;
&lt;p&gt;Please note that the 1st, 2nd and 3rd yield statements above are all *asynchronous*, but the code within this action is executed in sequential order.&amp;nbsp; The 1st yield also triggers an animation...I can also do things like this:&lt;/p&gt;&lt;pre class="brush: xml;"&gt;yield return new BeginAnimation(&amp;quot;MyCoolAnimation&amp;quot;);
yield return new BeginAnimation(&amp;quot;This animation is next&amp;quot;);
yield return new BeginAnimation(&amp;quot;This animation plays last&amp;quot;);
&lt;/pre&gt;
&lt;p&gt;This gives the View Model a declarative way to handle animations without a need to reference the view.&amp;nbsp; Also, it should be noted that the above action relies on several UI services, but I can unit test this action without needing to mock anything.&amp;nbsp; The declarative nature of the action allows me to iterate over the results and simply use normal Asserts on the values.&amp;nbsp; Async programming becomes synchronous and playing Animations is peachy ;)&lt;/p&gt;
&lt;p&gt;More on this later, but I just had to show some code because I’m not sure many people know you can do this with Caliburn.&amp;nbsp; On my current Silverlight project, we are making extensive use of this.&amp;nbsp; It makes calling web services a breeze.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;ul&gt;&lt;/ul&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49321" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/5IKq5EVEojA" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/07/10/asynchronous-execution-animation-and-more-in-mvvm-with-caliburn.aspx</feedburner:origLink></item><item><title>Querying on Child Count With NHibernate</title><link>http://feedproxy.google.com/~r/Devlicious/~3/661vGXaEzqE/querying-on-child-count-with-nhibernate.aspx</link><pubDate>Thu, 09 Jul 2009 23:23:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49317</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This is a recent question raised in &lt;a href="http://devlicio.us/controlpanel/blogs/posteditor.aspx/groups.google.com/group/nhusers" target="_blank"&gt;NHibernate Users Group&lt;/a&gt;. The user wanted to realize the following query with Criteria api.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;result = db.Person.Where(x =&amp;gt; x.Pets.Count &amp;gt; 0 &amp;amp;&amp;amp; x.Alive)&lt;br /&gt;                      .OrderBy(x =&amp;gt; x.Name);&lt;/pre&gt;
&lt;p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is not a simple query, but it has a solution&lt;/p&gt;
&lt;pre name="code" class="c-sharp"&gt;  
DetachedCriteria crit = DetachedCriteria.For(typeof (Person), &amp;quot;p2&amp;quot;)
    .CreateCriteria(&amp;quot;p2.Pets&amp;quot;,&amp;quot;Pets&amp;quot;)
    .Add(Restrictions.EqProperty(&amp;quot;p.Id&amp;quot;, &amp;quot;p2.Id&amp;quot;))
    .SetProjection(Projections.Count(&amp;quot;Pets.Id&amp;quot;));

ICriteria c = s.CreateCriteria(typeof (Person), &amp;quot;p&amp;quot;)
    .Add(Restrictions.Gt(Projections.SubQuery(crit), 0))
    .Add(Restrictions.Eq(&amp;quot;p.Alive&amp;quot;,true))
    .AddOrder(Order.Asc(&amp;quot;p.Name&amp;quot;));
&lt;/pre&gt;
&lt;p&gt;What we had to do is to create a DetachedCriteria and on that execute CreateCriteria so that we can do querying on our collection.&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49317" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/661vGXaEzqE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/nhibernate/default.aspx">nhibernate</category><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/07/10/querying-on-child-count-with-nhibernate.aspx</feedburner:origLink></item><item><title>Is that a Property or a Method?</title><link>http://feedproxy.google.com/~r/Devlicious/~3/zvSxsIg77_k/is-that-a-property-or-a-method.aspx</link><pubDate>Thu, 09 Jul 2009 14:28:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49299</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>12</slash:comments><description>&lt;p&gt;This is just a quick little rant on my part.&amp;nbsp; In my opinion a property should be used for simply getting/setting of a value.&amp;nbsp; You should NOT have any logic inside your getter/setter (ok, I will add a &amp;#39;caviot&amp;#39; to this rule and say that I am ok with doing string formatting on the getter).&amp;nbsp; If you need to have logic in either your setting or your getter I think it is about time to use a method, not a propery.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;WHY?&lt;br /&gt;Because, once you start adding behavior to the property you are masking this behavior and a method will better convey your intent.&lt;br /&gt;&lt;br /&gt;Again, this is just my thoughts/opinion, but I like to convey intent of methods/logic and wrapping logic inside a property does not convey intent.&lt;br /&gt;&lt;br /&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49299" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/zvSxsIg77_k" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Rant/default.aspx">Rant</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/09/is-that-a-property-or-a-method.aspx</feedburner:origLink></item><item><title>MVVM – Philosophy and Case Studies - Introduction</title><link>http://feedproxy.google.com/~r/Devlicious/~3/mvsBbO_fiT4/mvvm-philosophy-and-case-studies-introduction.aspx</link><pubDate>Wed, 08 Jul 2009 02:49:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49128</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>8</slash:comments><description>&lt;p&gt;There&amp;rsquo;s been a lot of talk lately about MVVM (Model-View-ViewModel) in the WPF and Silverlight space.&amp;nbsp; Recently, &lt;a href="http://neverindoubtnet.blogspot.com/2009/05/birth-and-death-of-m-v-vm-triads.html"&gt;Ward Bell had an interesting post on the subject&lt;/a&gt; where he digs into some of the patterns he is using to support his MVVM triads.&amp;nbsp; The WPF/Silverlight community is constantly droning MVVM, but almost no one goes beyond stating their use of the pattern or giving an overly general description of it. That&amp;rsquo;s why I enjoyed &lt;a href="http://neverindoubtnet.blogspot.com/2009/05/birth-and-death-of-m-v-vm-triads.html"&gt;Ward&amp;rsquo;s post&lt;/a&gt;.&amp;nbsp; He&amp;rsquo;s trying to get into the nitty-gritty of his UI architecture rather than just chanting &amp;ldquo;I&amp;#39;m using MVVM&amp;quot; and leaving it at that.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m pleased that the WPF/SL community is taking UI architecture seriously, but I think we have a long way to go.&amp;nbsp; We need to dig deeper into the &amp;ldquo;how&amp;rdquo; of the MVVM and realize that a solid implementation is more that just creating a model and binding it to a view, with a dash of the &lt;a href="http://www.dofactory.com/Patterns/PatternCommand.aspx"&gt;Command&lt;/a&gt; pattern thrown in for good measure.&amp;nbsp; In fact, saying you are using MVVM for WPF/Silverlight is sort of like saying you are using MVC for web development.&amp;nbsp; It more or less states the general design approach you are taking to the UI architecture, but doesn&amp;rsquo;t say much about how the pattern is implemented or how individual features are represented within the &lt;em&gt;context&lt;/em&gt; of that design.&amp;nbsp; If you&amp;rsquo;ve been following the blogs on ASP.NET MVC, you&amp;rsquo;ve probably discovered that there is a lot more to it than just having Models, Views and Controllers.&amp;nbsp; It is easy to use the MVC pattern very poorly and the same goes for MVVM.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Speaking of context&amp;hellip;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When I first read the GoF book, I was baffled by its insistence that patterns were not tied to implementation.&amp;nbsp;&amp;nbsp; Sure, I understood that the &lt;a href="http://www.dofactory.com/Patterns/PatternIterator.aspx"&gt;Iterator&lt;/a&gt; pattern would be implemented differently in C++ than in C#, but I didn&amp;rsquo;t understand that other context-specific factors had a massive affect on the details of its implementation.&amp;nbsp; This &amp;ldquo;phenomena&amp;rdquo; manifests itself in greater degrees with respect to how high-level the pattern is.&amp;nbsp; A high-level pattern like MVC is a fine example of this.&amp;nbsp; Consider how the implementations would differ between a WinForms and an ASP.NET implementation of this pattern.&amp;nbsp; They would not resemble each other much at all.&amp;nbsp; The WinForms version would likely look a lot like an &lt;a href="http://www.dofactory.com/Patterns/PatternObserver.aspx"&gt;Observer&lt;/a&gt; or &lt;a href="http://www.dofactory.com/Patterns/PatternMediator.aspx"&gt;Mediator&lt;/a&gt; while the ASP.NET version would be very similar to a &lt;a href="http://www.dofactory.com/Patterns/PatternStrategy.aspx"&gt;Strategy&lt;/a&gt;.&amp;nbsp; In fact the WinForms version would look so different, you might not even call it MVC anymore, though you started out with an MVC mindset.&amp;nbsp; You could force the WinForms and ASP.NET implementations to look alike, but you would be creating a leaky abstraction by forcing an &lt;em&gt;artificial context&lt;/em&gt; for your design to live in.&lt;/p&gt;
&lt;p&gt;In the next couple of posts I am hoping to examine MVVM within the context of WPF/SL.&amp;nbsp; What does the base form of it look like?&amp;nbsp; What do more complex forms look like?&amp;nbsp; Why is this pattern a good fit for WPF/SL?&amp;nbsp; How does this pattern relate to MVP and MVC?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MVVM &amp;ndash; A Simplistic View&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If we take MVVM as a high level pattern, like MVC, then it becomes our general approach to architecting user interfaces.&amp;nbsp; It means that we will have components in three of the following &lt;em&gt;broad&lt;/em&gt; roles:&lt;/p&gt;
&lt;p&gt;Models &amp;ndash; These are the business-oriented components that are intended to be displayed or manipulated by the application.&amp;nbsp; They might be traditional business objects rehydrated from the DB, messages from a web service or anything else that has business meaning independent of presentation.&lt;/p&gt;
&lt;p&gt;Views &amp;ndash; WPF/Silverlight is a view framework and is thus intended to provided these components.&amp;nbsp; Their role is to display something on the screen.&amp;nbsp; Nothing more, nothing less.&lt;/p&gt;
&lt;p&gt;View Models &amp;ndash; This is a special type of model, intended to be an abstraction of the UI.&amp;nbsp; You can think of it as a &lt;em&gt;logical representation&lt;/em&gt; of the UI.&amp;nbsp; It is &amp;ldquo;connected&amp;rdquo; to the view at runtime through databinding.&lt;/p&gt;
&lt;p&gt;My guess is that you probably feel pretty comfortable with the idea of a Model or a View.&amp;nbsp; You can picture them in your mind.&amp;nbsp; But when it comes to View Models, things get foggy.&amp;nbsp; It means that we need to have a lot more discussion around what our View Models look like.&amp;nbsp; But, we cannot just discuss them abstractly.&amp;nbsp; We must look at specific scenarios and see how ordinary design patterns interplay to create a meaningful model of the UI.&amp;nbsp; In a few words, here&amp;rsquo;s my general philosophy and what I hope will become clear as we proceed:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The same OOD techniques you use to build your backend systems are used to construct your View Models.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To that end, I am hoping to put together several posts on the subject.&amp;nbsp; I am planning to contact several of my previous clients with the intention of gaining permission to discuss small portions of their applications; or to discuss them at a very high level.&amp;nbsp; I want to show specific problems and demonstrate how we used common design patterns to build a rich View Model.&amp;nbsp; It is my hope that this will begin a richer discussion on the topic within our community.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49128" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/mvsBbO_fiT4" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.0/default.aspx">.NET 3.0</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/07/07/mvvm-philosophy-and-case-studies-introduction.aspx</feedburner:origLink></item><item><title>How to copy an entire folder tree with Nant</title><link>http://feedproxy.google.com/~r/Devlicious/~3/2rF4yKyEKHM/how-to-copy-an-entire-folder-tree-with-nant.aspx</link><pubDate>Tue, 07 Jul 2009 15:43:54 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49121</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Ok, so this sounds like it should be drop dead simple and it is, however it is not (at least to me) 100% intuitive how you could accomplish this.&lt;/p&gt;  &lt;p&gt;Here is what I wanted to do.&amp;#160; I wanted to be able to copy ALL of my compiled dlls from my build to a ‘staging’ location and I wanted to do this in a simple manor. The first thing I did of course was to jump out to the nant project page to refresh my memory on the &amp;lt;copy&amp;gt; feature.&amp;#160; Sadly after reading the doc, i did not find anything that stuck out and said ‘hey, if you need to copy an entire folder structure do this’.&lt;/p&gt;  &lt;p&gt;However, with a bit of googling I was able to figure out a simple way to do it.&lt;/p&gt;  &lt;pre class="xml" name="code"&gt;  &amp;lt;target name=&amp;quot;copy.nightlyBuild.to.staging.location&amp;quot;&amp;gt;
    &amp;lt;property name=&amp;quot;dir.nightlyBuild.destination&amp;quot; value=&amp;quot;C:\NightlyBuilds_Output\Build&amp;quot; /&amp;gt;
    &amp;lt;mkdir dir=&amp;quot;${dir.nightlyBuild.destination}&amp;quot; if=&amp;quot;${not(directory::exists(dir.nightlyBuild.destination))}&amp;quot; /&amp;gt;

    &amp;lt;copy todir=&amp;quot;${dir.nightlyBuild.destination}&amp;quot; includeemptydirs=&amp;quot;true&amp;quot; overwrite=&amp;quot;true&amp;quot; verbose=&amp;quot;true&amp;quot;&amp;gt;
      &amp;lt;fileset basedir=&amp;quot;.\SOME_FOLDER_TO_COPY_FROM&amp;quot;&amp;gt;
        &amp;lt;include name=&amp;quot;**/*.*&amp;quot; /&amp;gt;
      &amp;lt;/fileset&amp;gt;
    &amp;lt;/copy&amp;gt;
    
  &amp;lt;/target&amp;gt;&lt;/pre&gt;

&lt;p&gt;What makes this process work is the **\*.* in the include section.&amp;#160; the **\ tells nant to do a recursive copy.&lt;/p&gt;

&lt;p&gt;Hope this helps&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49121" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/2rF4yKyEKHM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development+Tools/default.aspx">Development Tools</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/07/how-to-copy-an-entire-folder-tree-with-nant.aspx</feedburner:origLink></item><item><title>Upcoming Local UG Meetings</title><link>http://feedproxy.google.com/~r/Devlicious/~3/esiI1DltefQ/upcoming-local-ug-meetings.aspx</link><pubDate>Mon, 06 Jul 2009 17:07:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49103</guid><dc:creator>sergiopereira</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Here are two user group events that are happening soon and that I&amp;#39;m directly involved.&lt;/p&gt;

&lt;h3&gt;July 8&lt;sup&gt;th&lt;/sup&gt;, Chicago ALT.NET&lt;/h3&gt;

&lt;p&gt;
	&lt;b&gt;0-60 With Fluent NHibernate&lt;/b&gt;&lt;br /&gt;
	See the &lt;a href="http://chicagoalt.net/event/July2009Meeting060withFluentNHibernate"&gt;full description&lt;/a&gt; 
	of the session over at the &lt;a href="http://chicagoalt.net/"&gt;Chicago ALT.NET&lt;/a&gt; home page.
	We will have &lt;a href="http://www.bestguesstheory.com/"&gt;Hudson Akridge&lt;/a&gt; tell us all about 
	&lt;a href="http://fluentnhibernate.org/"&gt;Fluent NHibernate&lt;/a&gt;, a project that has been instrumental in
	getting people on NHibernate by simplifying a lot of that ORM&amp;#39;s configuration chores.
&lt;/p&gt;
&lt;p&gt;
	The Chicago ALT.NET meetings start at 6PM in the Sears Tower. Check the website for complete location details.
&lt;/p&gt;


&lt;h3&gt;July 14&lt;sup&gt;th&lt;/sup&gt;, WI.NET&lt;/h3&gt;

&lt;p&gt;
	&lt;b&gt;JavaScript - Beyond the Curly Braces&lt;/b&gt;&lt;br /&gt;
	I&amp;#39;m taking &lt;a href="http://www.sergiopereira.com/presentations/js-beyond.html"&gt;my little JS presentation&lt;/a&gt; to 
	the &lt;a href="http://www.wi-ineta.org/"&gt;WI.NET&lt;/a&gt; UG in Milwaukee.
	The group&amp;#39;s website hasn&amp;#39;t been updated with the presentation details yet but it&amp;#39;s basically the same presentation 
	given at other local UGs.
&lt;/p&gt;
&lt;p&gt;
	The meeting starts at 7PM. Come ready to be surprised.
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49103" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/esiI1DltefQ" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/.NET/default.aspx">.NET</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/alt.net/default.aspx">alt.net</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Announcement/default.aspx">Announcement</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Community/default.aspx">Community</category><feedburner:origLink>http://devlicio.us/blogs/sergio_pereira/archive/2009/07/06/upcoming-local-ug-meetings.aspx</feedburner:origLink></item><item><title>What is a build script? Writing MsBuild Scripts - Part I</title><link>http://feedproxy.google.com/~r/Devlicious/~3/wq1TPsYccZI/what-is-a-build-script-writing-msbuild-scripts-part-i.aspx</link><pubDate>Sun, 05 Jul 2009 18:36:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49081</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>6</slash:comments><description>&lt;p&gt;I was thinking of writing post series on NAnt but then I decided to write some on MsBuild first. &lt;/p&gt;
&lt;p&gt;This post will briefly introduce you the basic concepts of automation of build, why we need build tools/scripts, and what alternatives we have. &lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s first start with the definition of build script/tool.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;What is a build script?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;A build script is all about automation. When we compile projects, we also want to perform some other steps such as running tests, compiling documentation, create an examples package, move some files from one location to another, and in the end zip them, or create an installer for the project. Doing them by hand is not really an option, and you may have thought of preparing a batch file/shell script before you learnt the build files.&lt;/p&gt;
&lt;p&gt;For me, Makefile was the first place that I heard about the term &amp;ldquo;build script&amp;rdquo;. It is mainly used in Linux to compile applications.&lt;/p&gt;
&lt;p&gt;When we take a look at a sample makefile&lt;/p&gt;
&lt;pre&gt;&lt;tt&gt;&lt;br /&gt;OBJS = main.obj io.obj&lt;br /&gt;CC = bcc&lt;br /&gt;MODEL = s&lt;br /&gt;CFLAGS = &amp;ndash;m$(MODEL) &lt;br /&gt;&lt;/tt&gt;&lt;tt&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;project.exe : $(OBJS)&lt;br /&gt;	tlink c0$(MODEL) $(OBJS), $(.TARGET),, c$(MODEL) /Lf:\bc\lib&lt;br /&gt;&lt;br /&gt;main.obj : main.c&lt;br /&gt;	$(CC) $(CFLAGS) &amp;ndash;c $(.SOURCE)&lt;br /&gt;&lt;br /&gt;io.obj : io.c&lt;br /&gt;	$(CC) $(CFLAGS) &amp;ndash;c $(.SOURCE)&lt;br /&gt;&lt;br /&gt;  	$(OBJS) : incl.h&lt;/tt&gt; &lt;/pre&gt;
&lt;p&gt;First we have several properties which we&amp;rsquo;ll use later, they are like variables. 
  &lt;br /&gt;Then we have some targets which has &amp;ldquo;:&amp;rdquo; on the right. On the right of &amp;ldquo;:&amp;rdquo;, we have their &amp;ldquo;dependencies&amp;rdquo;. A dependency is a unit that has to be run before the dependent, or a file that our file depends on. For example, main.obj depends on main.c and in case main.c is modified, we will run that target again. The lines after the target are the commands which will be run as part of the target.&lt;/p&gt;
&lt;p&gt;This dependency idea is key to every build system and main points in writing a build script is to find dependencies of your project. After you define them, the rest is a piece of chocolate cake!&lt;/p&gt;
&lt;p&gt;OK, i spoke too much Linux for a .net blog :) Let&amp;rsquo;s turn to our beautiful .net World.&lt;/p&gt;
&lt;p&gt;In .net world, there are 2(AFAIK, if not please comment) build tools written specifically for .NET. One is the famous NAnt, and the other is MsBuild. NAnt is usually used in OpenSource project. MsBuild is being used since VS 2005, and it is part of the framework. Your csproj files are actually MsBuild files.&lt;/p&gt;
&lt;p&gt;Most people say that that nant is more flexible and mature, but they also say that the nativeness of MsBuild into visual studio is a plus. Some they say that they delegate the build to MsBuild while using Nant for other stuff.&lt;/p&gt;
&lt;p&gt;In the next post, we&amp;rsquo;ll write(and use .csproj) a basic MsBuild script. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you like the post, please kick it and shout it.&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdevlicio.us%2fblogs%2ftuna_toksoz%2farchive%2f2009%2f07%2f05%2fwhat-is-a-build-script-writing-msbuild-scripts-part-i.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdevlicio.us%2fblogs%2ftuna_toksoz%2farchive%2f2009%2f07%2f05%2fwhat-is-a-build-script-writing-msbuild-scripts-part-i.aspx&amp;amp;bgcolor=3333FF" alt="kick it on DotNetKicks.com" border="0" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;a rev="vote-for" href="http://dotnetshoutout.com/What-is-a-build-script-Writing-MsBuild-Scripts-Part-I-Tuna-Toksoz-Devlicious"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fdevlicio.us%2Fblogs%2Ftuna_toksoz%2Farchive%2F2009%2F07%2F05%2Fwhat-is-a-build-script-writing-msbuild-scripts-part-i.aspx&amp;amp;textBackColor=3333FF&amp;amp;countBackColor=D4E1ED&amp;amp;countForeColor=000000" style="border:0px;" width="103" height="22" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49081" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/wq1TPsYccZI" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/msbuild/default.aspx">msbuild</category><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/07/05/what-is-a-build-script-writing-msbuild-scripts-part-i.aspx</feedburner:origLink></item><item><title>TeamCity Remote Runs / Personal Builds</title><link>http://feedproxy.google.com/~r/Devlicious/~3/q4pDaMKkfLI/teamcity-remote-runs-personal-builds.aspx</link><pubDate>Fri, 03 Jul 2009 12:44:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49038</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This is a killer feature of TeamCity against other CI servers, I believe. &lt;/p&gt;
&lt;p&gt;TC allows you to test your changes before committing them to the Source Control Repository, which means that you don&amp;rsquo;t have to worry about breaking the build, because you won&amp;rsquo;t :)&lt;/p&gt;
&lt;p&gt;I needed this in order to try a fix that I had for an issue in NH, it worked on my machine but&amp;nbsp; not sure if it works on another one.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://kozmic.pl"&gt;Krzysztof Kozmic&lt;/a&gt; told me in the same evening that he&amp;rsquo;s going to try a fix against DP with personal build, and I thought it was a great idea!&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tuna_5F00_toksoz/image_5F00_thumb_5F00_0474E0A7.png" border="0" height="451" width="496" /&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then it runs your changes on one of the build agents.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tuna_5F00_toksoz/image_5F00_thumb_5F00_621C8986.png" border="0" height="69" width="521" /&gt; &lt;/p&gt;
&lt;p&gt;There we go! Patch didn&amp;rsquo;t break anything (even though it may not be how it should be)&lt;/p&gt;
&lt;p&gt;Keep up the good work, JetBrains!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49038" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/q4pDaMKkfLI" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/teamcity/default.aspx">teamcity</category><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/07/03/teamcity-remote-runs-personal-builds.aspx</feedburner:origLink></item><item><title>Ignoring files/folders when committing to SVN repository</title><link>http://feedproxy.google.com/~r/Devlicious/~3/t0Y3Pe5BSdM/ignoring-files-folders-when-committing-to-svn-repository.aspx</link><pubDate>Fri, 03 Jul 2009 12:43:36 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49037</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;This feature of SVN is very handy. After you build your projects, there will be dlls in bin folders etc which you don’t want to commit.&lt;/p&gt;  &lt;p&gt;Using svn:ignore property of SVN, you can eliminate the possibility of committing those files!&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tuna_5F00_toksoz/image_5F00_thumb_5F00_19025823.png" width="479" height="240" /&gt;&lt;/p&gt;  &lt;p&gt;As many other things, I learnt this from NH :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49037" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/t0Y3Pe5BSdM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/SVN/default.aspx">SVN</category><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/source+control/default.aspx">source control</category><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/Tips-and-Tricks/default.aspx">Tips-and-Tricks</category><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/Development/default.aspx">Development</category><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/07/03/ignoring-files-folders-when-committing-to-svn-repository.aspx</feedburner:origLink></item><item><title>Code Contracts Primer – Part 5: Utilizing Object Invariants</title><link>http://feedproxy.google.com/~r/Devlicious/~3/BqfgRpmLeaQ/code-contracts-primer-part-5-utilizing-object-invariants.aspx</link><pubDate>Wed, 01 Jul 2009 10:03:13 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48884</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you are not familiar with the &lt;a href="http://research.microsoft.com/en-us/projects/contracts/"&gt;Code Contracts&lt;/a&gt; library which is coming out of Microsoft R&amp;amp;D labs, you need to check this pretty cool little library out.&amp;#160; As of Vs2010/.Net 4.0 this library will be making the jump out of the R&amp;amp;D labs.&amp;#160; &lt;/p&gt;  &lt;p&gt;Over the next few blog posts we will be taking a look at the topics below.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/08/code-contracts-primer-part-1-introduction.aspx"&gt;Downloading and setting up the contracts library&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/09/code-contracts-primer-part-2-handling-legacy-code.aspx"&gt;Handling Legacy Code&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/13/code-contracts-primer-part-3-providing-support-for-unit-tests.aspx"&gt;Providing Support for Unit Tests&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/15/code-contracts-primer-part-4-utilizing-pre-amp-post-conditions.aspx"&gt;Utilizing Pre &amp;amp; Post Conditions &lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Utilizing Object Invariants (this post)&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Performing checking in base classes/abstract classes &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In this post we are going to take a look at what I think is one of the coolest features of the Contracts Library.&amp;#160; The concept of Object Invariants.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What is Object Invariant validation?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This part of the library ensures that when the state of an object is changed that the object remains in valid state.&amp;#160; If the state of the object is to become invalid then your contract would fail and this would be an issue.&lt;/p&gt;  &lt;p&gt;Imagine you have a class called ReportCard, this class is used by a timekeeping system and is used to store instances of daily report cards (a daily report card holds the time/hours worked for that employee).&amp;#160; We want to setup a rule which says that depending on the employee type they are not allowed to work &amp;gt; 40 hours (the actual number is not important).&amp;#160; We also want to setup the ability to ensure they do not work &amp;lt; 0 hours.&lt;/p&gt;  &lt;p&gt;Prior to code contracts you would need to create your state checking method and then place calls to the validator at location where the state changes.&amp;#160; This is both tedious and error prone because as your add more code (hopefully you follow the Open/Close principle and extend the class not keep piling on new code, but that is a different post) you have to remember to add the state checking logic.&amp;#160; With invariants you do not need to do that.&amp;#160; All you need to do is below.&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;[ContractInvariantMethod]
public void EnsureReportHoursIsInValidRange()
{
    Contract.Invariant( EmployeeID &amp;gt; 0 );

    var totalHours = TotalHours(); // Calcs total hours

    Contract.Invariant(totalHours &amp;gt;= 0);
    Contract.Invariant(totalHours &amp;lt;= 40);
}&lt;/pre&gt;

&lt;p&gt;Taking a look at this code there are a few things you should know&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The [ContractInvariantMethod] is what makes this method the invariant checking method &lt;/li&gt;

  &lt;li&gt;You MUST use Contract.Invariant to do your assertions &lt;/li&gt;

  &lt;li&gt;You can only have 1 method in your class which has the [ContractInvariantMethod]&amp;#160; attribute (which just makes sense, but thought I would mention it) &lt;/li&gt;

  &lt;li&gt;The code weaver will add calls to your invariant logic ANY place the state changes in the object. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the same code above, but this time POST code weaving.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public void AddDailyReport(DailyCards dailyCards)
{
	this.DailyReportCards.Add(dailyCards);
        this.EnsureReportHoursIsInValidRange();
}

[ContractInvariantMethod]
public void EnsureReportHoursIsInValidRange()
{
	if (!this.$evaluatingInvariant$)
        {
            this.$evaluatingInvariant$ = true;
            try
            {
                __ContractsRuntime.Invariant(this.EmployeeID &amp;gt; 0, null, &amp;quot;EmployeeID &amp;gt; 0&amp;quot;);
                double num = this.TotalHours();
                __ContractsRuntime.Invariant(num &amp;gt;= 0.0, null, &amp;quot;&amp;quot;);
                __ContractsRuntime.Invariant(num &amp;lt;= 40.0, null, &amp;quot;totalHours &amp;lt;= 40&amp;quot;);
            }
            finally
            {
                this.$evaluatingInvariant$ = false;
            }
        }
}&lt;/pre&gt;

&lt;p&gt;The key thing to notice when looking at the reflected code is how the weaver added the call this.EnsureReportHoursIsInValidRange(); in the AddDailyReport() method.&amp;#160; &lt;/p&gt;

&lt;p&gt;2 Things to watch out for when utilizing the Object Invariant &lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Remember to make sure that your state validation logic is light and runs quickly.&amp;#160; Because the validation logic will be called EVERY TIME the state changes this logic could be called often.&amp;#160; If your validation does things like reach out to the DB or any other dependency your experience with this will suffer and your performance will also suffer. &lt;/li&gt;

  &lt;li&gt;When debugging your invariant logic your ‘debug experience’ will not be the same as normal.&amp;#160; When I first started to use this I was confused by the fact that when i would run the code in real time it all worked.&amp;#160; However when I stepped into the code it did not appear to be working correctly.&amp;#160; I have never figured out the EXACT reason for this, but I am 99% sure it has to do with the way the weaver alters the code. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48884" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/BqfgRpmLeaQ" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Code+Contracts/default.aspx">Code Contracts</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/07/01/code-contracts-primer-part-5-utilizing-object-invariants.aspx</feedburner:origLink></item><item><title>Hangin the with guys from Thirsty Developer</title><link>http://feedproxy.google.com/~r/Devlicious/~3/9UJv1HJQndM/hanging-the-with-guys-from-thirsty-developer.aspx</link><pubDate>Wed, 01 Jul 2009 00:22:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48861</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;A few weeks back I sat down with &lt;a href="http://eraserandcrowbar.com/"&gt;Larry Clarkin&lt;/a&gt; to record an episode of the &lt;a href="http://thirstydeveloper.com/"&gt;Thirsty Developer&lt;/a&gt; (a podcast that he and &lt;a href="http://www.davebost.com/blog/"&gt;Dave Bost&lt;/a&gt; put out) prior to my doing my SOLID session with the &lt;a href="http://wi-ineta.org/"&gt;WI-Ineta&lt;/a&gt; group.&amp;nbsp; Larry and I sat down at a local starbucks to chat about the session as well as just talk shop (Dave was off on assignment some place, but was there in spirit).&lt;/p&gt;
&lt;p&gt;Well, Larry went off and actually released the episode (hey, when you chat with me the quality mileage may vary :) ) back a week or so ago while I was on a 2 week hiatus from the net (1 week vacation and 1 week of client visits for work) so I am a little behind in making the announcement about this.&lt;/p&gt;
&lt;p&gt;Anyway, if you want to listen to our conversation you can check out &lt;a href="http://thirstydeveloper.com/2009/06/17/65SOLIDAsARock.aspx"&gt;here&lt;/a&gt;.&amp;nbsp; I hope you like it and I am looking forward to sitting down with them in the future to chat again.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;
&lt;p&gt;Also, if you do not currently subscribe to their RSS feed I would strongly suggest you give them a listen, they are great guys and a ton of fun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48861" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/9UJv1HJQndM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Announcement/default.aspx">Announcement</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Craftsmanship/default.aspx">Craftsmanship</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/06/30/hanging-the-with-guys-from-thirsty-developer.aspx</feedburner:origLink></item><item><title>The "Risk" of Open Source Software Support</title><link>http://feedproxy.google.com/~r/Devlicious/~3/Zloa1KX2m0Y/the-quot-risk-quot-of-open-source-software-support.aspx</link><pubDate>Tue, 30 Jun 2009 03:18:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48827</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>13</slash:comments><description>&lt;p&gt;Quite often there is a fear that surrounds open source tools and frameworks.&amp;nbsp; For most shops the deciding factor against open source software is the apparent &amp;quot;risk&amp;quot; that is associated with a framework/tool that is not attached to any business entity.&lt;/p&gt;
&lt;p&gt;In this post I want to share an interaction that occurred this last weekend to show you that the open source ecosystem is alive and very healthy.&amp;nbsp; And while I won&amp;#39;t go so far as to say the &amp;quot;risk&amp;quot; doesn&amp;#39;t exist (you have to come to that conclusion on your time when your own fears are allayed) I do hope that this post puts some of those fears to rest.&lt;/p&gt;
&lt;p&gt;Saturday morning before I went off to work there was a question posted to the &lt;a href="http://groups.google.com/group/RhinoMocks/"&gt;RhinoMocks mailing list&lt;/a&gt; (for those who don&amp;#39;t know &lt;a href="http://ayende.com/projects/rhino-mocks.aspx"&gt;RhinoMocks&lt;/a&gt; is an open source mocking framework).&amp;nbsp; Before the end of the day the problem was resolved to a satisfactory conclusion.&amp;nbsp; The &amp;quot;solution&amp;quot; (I put in quotes because there appears to be a bug but at least now we know there is a bug...hence &amp;quot;solution&amp;quot;).&amp;nbsp; The result is not as important as the events that transpired to reach that conclusion below is the timeline.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;12:22 AM - Kenneth posts the problem he is encountering&lt;/p&gt;
&lt;p&gt;6:53 AM - I respond on the mailing list back to Kenneth with my findings and let him know that I will get some experts in DynamicProxy involved&lt;/p&gt;
&lt;p&gt;6:56 AM - &lt;a href="http://twitter.com/TimBarcz/status/2358015264"&gt;I enlisted the help of Krzysztof Kozmic on twitter&lt;/a&gt; (&lt;a href="http://kozmic.pl/"&gt;Krzysztof&lt;/a&gt; is a committer on &lt;a href="http://www.castleproject.org/dynamicproxy/index.html"&gt;DynamicProxy by Castle&lt;/a&gt; as has a &lt;a href="http://kozmic.pl/archive/2009/04/27/castle-dynamic-proxy-tutorial.aspx"&gt;great tutorial series on Dynamic Proxy&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;8:38 AM - Fellow &lt;a href="http://devlicio.us/blogs/tuna_toksoz/"&gt;Devlicious blogger Tuna Toksoz&lt;/a&gt; (also a committer on the Castle project) hopped on the case and reported his findings&lt;/p&gt;
&lt;p&gt;9:22 AM - Krzysztof responds to Tuna&amp;#39;s findings reporting back on the root cause&lt;/p&gt;
&lt;p&gt;10:23 AM - Kenneth reported back with feedback of Tuna&amp;#39;s fix&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ultimately, as I mentioned earlier the fix was that it was found that RhinoMocks &amp;quot;relies on the buggy behavior, hence the error&amp;quot; (Krzysztof&amp;#39;s words).&amp;nbsp; Again the result here isn&amp;#39;t what is important but rather the journey.&amp;nbsp; Often people fear the support ecosystem around open source software but the exchange above and the players involved should give you some bit of confidence in the support of open source.&amp;nbsp; It is worth pointing out that all of this happened on a Saturday, something you&amp;#39;d pay a premium for in a closed source model.&lt;/p&gt;
&lt;p&gt;Whatever your roll in the software world is, one aspect you have to consider when choosing any solution is risk.&amp;nbsp; The traditional thought has been that with commercial software the support would be better when backed by a reputable name.&amp;nbsp; I think the exchange showcased above demonstrates that support for open source software can compete (and potentially surpass) support that any commercial piece of software could offer.&amp;nbsp; Keep that in mind the next time you are evaluating commercial software versus open source software.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48827" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/Zloa1KX2m0Y" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Open+Source+Software/default.aspx">Open Source Software</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Project+Management/default.aspx">Project Management</category><feedburner:origLink>http://devlicio.us/blogs/tim_barcz/archive/2009/06/29/the-quot-risk-quot-of-open-source-software-support.aspx</feedburner:origLink></item><item><title>A Craftsman sometimes has to create his own tool</title><link>http://feedproxy.google.com/~r/Devlicious/~3/RjUxBTLAArE/a-craftsman-sometimes-has-to-create-his-own-tool.aspx</link><pubDate>Sun, 28 Jun 2009 15:15:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48803</guid><dc:creator>sergiopereira</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;
	Today I was reading &lt;a href="http://codebetter.com/blogs/patricksmacchia/archive/2009/06/28/fighting-fabricated-complexity.aspx" title="Fighting Fabricated Complexity - Patrick Smacchia [MVP C#] - CodeBetter.Com - Stuff you need to Code Better!"&gt;the latest one&lt;/a&gt; of the many excellent blog posts &lt;a href="http://codebetter.com/blogs/patricksmacchia/default.aspx" title="Patrick Smacchia [MVP C#] - CodeBetter.Com - Stuff you need to Code Better!"&gt;Patrick Smacchia&lt;/a&gt; has
	put out on the topic of code metrics and caring for your code&amp;#39;s quality. 
&lt;/p&gt;
&lt;p&gt;
	The passion this guy has for that topic is such that he has created &lt;b&gt;the&lt;/b&gt; best
	&lt;a href="http://www.ndepend.com/"&gt;tool for analyzing your code&lt;/a&gt;. But he doesn&amp;#39;t stop there. He wants to
	make sure we understand what is going on behind the seemingly magic CQL queries that
	ship with NDepend. He wants you to understand your code&amp;#39;s DNA; with the added bonus
	that you can actually improve that DNA.  
&lt;/p&gt;
&lt;p&gt;
	That&amp;#39;s Science with capital S. 
&lt;/p&gt;
&lt;ol&gt;	
	&lt;li&gt;First you understand the problem that you are trying 
	to fight (code complexity/unmaintainable software,) &lt;/li&gt;
	&lt;li&gt;you research ways to quantify it (the metrics,)&lt;/li&gt; 
	&lt;li&gt;you create some tool or device to extract that information from your subject,&lt;/li&gt;
	&lt;li&gt;you extract the metrics from a familiar subject,&lt;/li&gt;
	&lt;li&gt;you apply your knowledge of how #2 relates to #1 and improve the subject under analysis,&lt;/li&gt; 
	&lt;li&gt;you use the tool to verify the metrics have improved,&lt;/li&gt;
	&lt;li&gt;time shows you that the changes you made indeed reduced the problem at #1&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	I simply hate when someone criticizes Patrick&amp;#39;s posts as being just marketing material
	for his product. Let me tell you this. If I had that much dedication for software 
	quality, to the point that I had created a great product to empower everyone,
	I&amp;#39;d also be trying to explain the problem to you using the tool I wrote. Heck, I&amp;#39;m
	pretty sure if someone else had written NDepend Patrick would still be writing about
	these things and using the tool in the process.
&lt;/p&gt;
&lt;p&gt;
	I like code metrics and static analysis a lot as well, not nearly as much as Mr Smacchia though.
	I&amp;#39;m very excited that very soon I&amp;#39;ll get to use it in our code base, in our CI server.  I can&amp;#39;t
	wait to learn more about this science and inflict positive changes in our code. Like 
	everybody else, we know there&amp;#39;s dirt and bad smells in our code and it&amp;#39;s just awesome that
	there&amp;#39;s a tool that can help us clearly identify, mitigate, and track it.
&lt;/p&gt;
&lt;p&gt;
	My hope is that I&amp;#39;ll be able to come back here and share what I&amp;#39;ve learned about my
	code and how the process we went through to improve it.
&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48803" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/RjUxBTLAArE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/.NET/default.aspx">.NET</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Development/default.aspx">Development</category><feedburner:origLink>http://devlicio.us/blogs/sergio_pereira/archive/2009/06/28/a-craftsman-sometimes-has-to-create-his-own-tool.aspx</feedburner:origLink></item><item><title>Grooving with my new toy</title><link>http://feedproxy.google.com/~r/Devlicious/~3/qFr5u2SMGKk/grooving-with-my-new-to.aspx</link><pubDate>Sat, 27 Jun 2009 18:55:37 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48785</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;Ok, so it is official I have jumped on the ‘gotta have a mac bandwagon’.&amp;#160; The week prior to father’s day my lovely wife decided that I could get a new MacBook Pro (well, Dimecasts was going to pay 75% of the cost and she would pay the other 25%).&amp;#160; I decided that I was not going to make this new machine my primary box, so I went small and picked up the 13.3 model.&lt;/p&gt;  &lt;p&gt;So, why did I get one?&amp;#160; Because I could silly :).&amp;#160; No, mostly to learn and play. I want to learn how to code in a different environment and with different languages.&amp;#160; On my list is Ruby (of course), Objective-C and maybe some playing with Java.&amp;#160; I do plan on building a iPhone app for Dimecasts (just need to find the time now).&lt;/p&gt;  &lt;p&gt;With about 2 weeks of using/playing under my belt and I have to admit the transition has been pretty easy.&amp;#160; About the only real annoyance is the fact that they keyboard is a bit different than a PC, but over time.&lt;/p&gt;  &lt;p&gt;Anyway, thought I would share with the world that I got a new toy.&amp;#160; BTW, Windows 7 runs SUPER fast under VM on this box.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48785" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/qFr5u2SMGKk" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development+Tools/default.aspx">Development Tools</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/06/27/grooving-with-my-new-to.aspx</feedburner:origLink></item><item><title>Fluent Interface for NH Facility – Take 1</title><link>http://feedproxy.google.com/~r/Devlicious/~3/N2jUk8si7Nc/fluent-interface-for-nh-facility-take-1.aspx</link><pubDate>Sat, 27 Jun 2009 11:39:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48777</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;We&amp;rsquo;ve been getting many requests on having fluent configuration for NHibernate Integration Facility, and as I like programmatic configuration more than XML configuration (did I mention that I hate XML?), I decided to work on it. After 2-3 hours, I got the below more or less working&lt;/p&gt;
&lt;pre class="code"&gt;container.Register(&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;Fluently&lt;/span&gt;.ConfigureFacility()&lt;br /&gt;    .Id(&lt;span style="color:#a31515;"&gt;&amp;quot;nhibernateFacility&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;i&gt;    .DefaultConfigurationBuilder&amp;lt;&lt;span style="color:#2b91af;"&gt;DefaultConfigurationBuilder&lt;/span&gt;&amp;gt;()&lt;br /&gt;    .DefaultConfigurationPersister&amp;lt;&lt;span style="color:#2b91af;"&gt;DefaultConfigurationPersister&lt;/span&gt;&amp;gt;()&lt;/i&gt;&lt;br /&gt;    .AddFactory(&lt;br /&gt;                    &lt;span style="color:#2b91af;"&gt;Fluently&lt;/span&gt;.ConfigureFactory()&lt;br /&gt;                        .Alias(&lt;span style="color:#a31515;"&gt;&amp;quot;myAlias&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .Id(&lt;span style="color:#a31515;"&gt;&amp;quot;myId&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .UsingConfiguration(&lt;br /&gt;                        &lt;span style="color:#2b91af;"&gt;FactoryConfigurator&lt;/span&gt;.DefaultBuilder()&lt;br /&gt;                            &lt;i&gt;.ConnectionProvider(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;/i&gt;&lt;br /&gt;                            &lt;i&gt;.ConnectionDriver(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;/i&gt;&lt;br /&gt;                            .ConnectionString(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                            &lt;i&gt;.Dialect(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;/i&gt;&lt;br /&gt;                            &lt;i&gt;.ProxyFactory(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;/i&gt;&lt;br /&gt;                            .Assemblies(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)))&lt;br /&gt;    .AddFactory(&lt;br /&gt;                    &lt;span style="color:#2b91af;"&gt;Fluently&lt;/span&gt;.ConfigureFactory()&lt;br /&gt;                        .Alias(&lt;span style="color:#a31515;"&gt;&amp;quot;myAlias&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .Id(&lt;span style="color:#a31515;"&gt;&amp;quot;myId&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .UsingConfiguration(&lt;br /&gt;                        &lt;span style="color:#2b91af;"&gt;FactoryConfigurator&lt;/span&gt;.XmlBuilder().File(&lt;span style="color:#a31515;"&gt;&amp;quot;myFile.xml&amp;quot;&lt;/span&gt;))));&lt;/pre&gt;
&lt;p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The pieces in Italic are not necessary to write as they have their defaults, also we have some generic overloads for things like Dialect, ProxyFactory and ConnectionProvider.&lt;/p&gt;
&lt;p&gt;What the above interface does is that it actually converts all the above configuration to IConfiguration and add them to the container as Facility Configuration, this is actually what is done behind the scenes when you use XML configuration. &lt;/p&gt;
&lt;p&gt;I asked for a review over the syntax from several tweeps (&lt;a href="http://twitter.com/kkozmic"&gt;@kkozmic&lt;/a&gt;, &lt;a href="http://twitter.com/dagda1"&gt;@dagda1&lt;/a&gt;, &lt;a href="http://twitter.com/mikehadlow"&gt;@mikehadlow&lt;/a&gt;, &lt;a href="http://twitter.com/chriscanal"&gt;@chriscanal&lt;/a&gt;) and from one other NH Facility user, German Schuager, and got great feedback.&lt;/p&gt;
&lt;p&gt;One of the issues that they pointed out with the above interface is that it is less discoverable. You have to find Fluently class, and then FactoryConfigurator class. Another issue is that it feels less natural to configure the facility like this. Instead, they prefer the configuration take place right on the facility.&lt;/p&gt;
&lt;p&gt;This one is what &lt;a href="http://blog.schuager.com"&gt;German Schuager&lt;/a&gt; has suggested&lt;/p&gt;
&lt;pre class="code"&gt;container.AddFacility&amp;lt;&lt;span style="color:#2b91af;"&gt;NHibernateFacility&lt;/span&gt;&amp;gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;nhibernateFacility&amp;quot;&lt;/span&gt;, cfg =&amp;gt; cfg&lt;br /&gt;        .DefaultConfigurationBuilder&amp;lt;&lt;span style="color:#2b91af;"&gt;DefaultConfigurationBuilder&lt;/span&gt;&amp;gt;()&lt;br /&gt;        .DefaultConfigurationPersister&amp;lt;&lt;span style="color:#2b91af;"&gt;DefaultConfigurationPersister&lt;/span&gt;&amp;gt;()&lt;br /&gt;        .AddFactory(&lt;span style="color:#a31515;"&gt;&amp;quot;id1&amp;quot;&lt;/span&gt;, f =&amp;gt; f&lt;br /&gt;                .Alias(&lt;span style="color:#a31515;"&gt;&amp;quot;myAlias&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .UsingConfiguration&amp;lt;DefaultBuilder&amp;gt;(c =&amp;gt; c&lt;br /&gt;                        .ConnectionProvider(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .ConnectionDriver(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .ConnectionString(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .Dialect(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .ProxyFactory(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                        .Assemblies(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;hellip;&amp;hellip;&amp;hellip;&amp;quot;&lt;/span&gt;)&lt;br /&gt;                ))&lt;br /&gt;        .AddFactory(&lt;span style="color:#a31515;"&gt;&amp;quot;id2&amp;quot;&lt;/span&gt;, f =&amp;gt; f&lt;br /&gt;                .Alias(&lt;span style="color:#a31515;"&gt;&amp;quot;alias&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .UsingConfiguration&amp;lt;XmlBuilder&amp;gt;(c =&amp;gt; c&lt;br /&gt;                        .ReadFrom(&lt;span style="color:#a31515;"&gt;&amp;quot;myfile.xml&amp;quot;&lt;/span&gt;)&lt;br /&gt;                ))&lt;br /&gt; });&lt;/pre&gt;
&lt;p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and similar one from &lt;a href="http://kozmic.pl"&gt;Krzysztof Kozmic&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Looks like i was the only one that is fan of Castle Microkernel style Fluent Interface. &lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see what I&amp;rsquo;ll come up for the second take, If I ever do it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48777" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/N2jUk8si7Nc" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/nhibernate/default.aspx">nhibernate</category><category domain="http://devlicio.us/blogs/tuna_toksoz/archive/tags/castle/default.aspx">castle</category><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/06/27/fluent-interface-for-nh-facility-take-1.aspx</feedburner:origLink></item><item><title>Two VANs on Castle Project</title><link>http://feedproxy.google.com/~r/Devlicious/~3/bdT8rRE7gv8/two-vans-on-castle-project.aspx</link><pubDate>Sat, 27 Jun 2009 09:25:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48776</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;I like VAN meetings, and I believe I am gaining a lot from them. Due to some time zone problem, I remember waiting 1 hour in front of the PC :) I had even plans for presenting something on those VANs but nah things don&amp;rsquo;t go like the way I want. Zachariah Young informed me that there are 2 VANs in the following two weeks that cover some topic on Castle. I believe it would be a good idea to join to those meetings, even if you&amp;rsquo;re using some other framework or don&amp;rsquo;t use anything at all. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ryan will be doing a two part series on the Castle Project.&amp;nbsp; Mark your calendar for some Castle Project fun.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;A little information on Ryan Svihla&lt;/b&gt;     &lt;br /&gt;&lt;i&gt;Ryan Svihla has been working as a C# developer Farm Bureau Bank in San Antonio since September 2007. Before that he worked as&amp;nbsp; a Consultant in Lincoln, NE for 3 years, where he had working experience with Php, some Perl, Python and of course C#.&amp;nbsp; Attemping Agile since early 2008 as an eager student with a focus on making programming more useful and relevant for the end user.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt; &lt;i&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;   &lt;br /&gt;&lt;b&gt;IoC and Dip through Castle Windsor      &lt;br /&gt;&lt;/b&gt;I assume readers have some familiarity with IoC and DI, so I skip description     &lt;br /&gt;Central Daylight Time     &lt;br /&gt;&lt;b&gt;Start Time:&lt;/b&gt; Web, July 1, 2009 8:00 PM UTC/GMT -5 hours     &lt;br /&gt;&lt;b&gt;End Time:&lt;/b&gt; Web, July 1, 2009 10:00 PM UTC/GMT -5 hours     &lt;br /&gt;&lt;b&gt;Attendee URL:&lt;/b&gt; &lt;a href="http://snipr.com/virtualaltnet"&gt;http://snipr.com/virtualaltnet&lt;/a&gt; (Live Meeting) &lt;/p&gt;
&lt;p&gt;   &lt;br /&gt;&lt;b&gt;Web Development with Castle Monorail, Active Record and Brail view engine&lt;/b&gt;     &lt;br /&gt;Have a look at the first popular MVC&amp;nbsp; .Net based web framework. Also will be covering persistance with ActiveRecord, and view templates using Brail.&amp;nbsp; Bonus, will demo a plugin framework for building CMS like applications.     &lt;br /&gt;Central Daylight Time     &lt;br /&gt;&lt;b&gt;Start Time:&lt;/b&gt; Web, July 8, 2009 8:00 PM UTC/GMT -5 hours     &lt;br /&gt;&lt;b&gt;End Time:&lt;/b&gt; Web, July 8, 2009 10:00 PM UTC/GMT -5 hours     &lt;br /&gt;&lt;b&gt;Attendee URL: &lt;/b&gt;&lt;a href="http://snipr.com/virtualaltnet"&gt;http://snipr.com/virtualaltnet&lt;/a&gt; (Live Meeting) &lt;/p&gt;
&lt;p&gt;   &lt;br /&gt;For more info on VAN go to &lt;a href="http://www.virtualaltnet.com"&gt;www.virtualaltnet.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll try to join those, see you there!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48776" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/bdT8rRE7gv8" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/06/27/two-vans-on-castle-project.aspx</feedburner:origLink></item><item><title>Just Be Honest and Tell the Truth</title><link>http://feedproxy.google.com/~r/Devlicious/~3/R3VkBZ7vN1w/just-be-honest-and-tell-the-truth.aspx</link><pubDate>Thu, 25 Jun 2009 00:27:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48722</guid><dc:creator>Jeff Perrin</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I just read Ron Jefferies latest post entitled &lt;a href="http://xprogramming.com/blog/needles/my-named-cloud-is-better-than-your-named-cloud.htm"&gt;My Named Cloud is Better Than Your Named Cloud&lt;/a&gt; and it got me riled up enough to post something I&amp;#39;ve been meaning to write about for at least a couple of years. His post touches on the point I&amp;#39;d wanted to make, but doesn&amp;#39;t quite say it as simply as I think it can be said. Here&amp;#39;s what I&amp;#39;m thinking:
&lt;/p&gt;
&lt;blockquote&gt;If we could just always be honest with ourselves, as people, team members and organizations, software development wouldn&amp;#39;t be that hard.&lt;/blockquote&gt;
&lt;p&gt;
There. Simple. Think about it for a second. All this stuff that we label and group together under &lt;em&gt;methodologies&lt;/em&gt; and &lt;em&gt;processes&lt;/em&gt; is really there so that we can do &lt;em&gt;One Thing.&lt;/em&gt; This one thing, I&amp;#39;m assuming, is usually to create software that fulfills a need.
Let&amp;#39;s pretend that a software team has been assembled to create an application that fulfills such a need. They&amp;#39;ve chosen to use the XP methodology while writing this application. I&amp;#39;ll go through some of the tenets of XP and run them through my &lt;em&gt;honesty filter&lt;/em&gt;:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pair programming: The team realizes that people will come and go on a project for good (quit, fired, etc), or for short periods of time (maternity leave, vacation, illness, etc). They want to minimize the risk, so they make sure everyone is familiar with every piece of the code base. They also realize that sometimes even the best developers do stupid shit for no good reason, and believe that having two sets of eyes on the screen at all times will lessen the likely hood of this happening.&lt;/li&gt;
&lt;li&gt;TDD: The team realizes that writing software is &lt;em&gt;hard&lt;/em&gt;, and that stuff that worked last week will have to be changed this week. Since they want to ensure that stuff they worked on earlier still works when they make these changes, they write tests, and ensure that no code gets checked in unless all the tests are passing. They also hope that these tests provide some form of documentation to any developers (and perhaps users/clients) that may come later or who never worked on the feature originally.&lt;/li&gt;
&lt;li&gt;Incremental design: The team realizes that there are unforeseen forces that may threaten a project at any given time. A big project entails a large amount of risk for both clients and developers. If features can be developed in incremental fashion, hopefully in an order representing the importance of each feature, then risks can be mitigated. The team is always working with a &lt;em&gt;usable application&lt;/em&gt;, so that if something comes up that stops the project, at least the client will have &lt;em&gt;something&lt;/em&gt; to work with.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Now obviously there is more to XP than what I&amp;#39;ve listed. The point is that those three things exist to handle a need that most teams, if they are really &lt;em&gt;honest with themselves&lt;/em&gt; have:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Knowledge transfer. Nobody wants to have to rely on one person to get something done. Sooner or later, this always bites us in the ass. Pairing is &lt;em&gt;one way&lt;/em&gt; to handle this.
&lt;/li&gt;
&lt;li&gt;Developed features continue working. Nothing is more frustrating (to users and developers) than having something that used to work perfectly stop working. Testing is &lt;em&gt;one way&lt;/em&gt; to handle this.&lt;/li&gt;
&lt;li&gt;The need to guarantee that &lt;em&gt;something&lt;/em&gt; will come out of all the money we&amp;#39;re spending. What happens if the development shop you&amp;#39;ve contracted goes bankrupt before they&amp;#39;ve finished your application? Incremental design is &lt;em&gt;one way&lt;/em&gt; to handle this.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Listen. We have methodologies and processes for a reason (I hope). Some of these processes may work for you. However, maybe only some parts of a process work for you. The point is, it&amp;#39;s not about the process. If you can understand why you&amp;#39;re using a particular piece of a process, you can assess whether it&amp;#39;s useful for your team. Who cares whether you&amp;#39;re doing XP, Scrum, Lean, Kanban, Waterfall, or Hack &amp;#39;n&amp;#39; Slash. Those are just names. Identify your pain points, problems, worries, etc, and &lt;em&gt;try to fix them&lt;/em&gt;. Honestly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48722" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/R3VkBZ7vN1w" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/jeff_perrin/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/jeff_perrin/archive/tags/rant/default.aspx">rant</category><category domain="http://devlicio.us/blogs/jeff_perrin/archive/tags/process/default.aspx">process</category><feedburner:origLink>http://devlicio.us/blogs/jeff_perrin/archive/2009/06/24/just-be-honest-and-tell-the-truth.aspx</feedburner:origLink></item><item><title>We Are Not Doing DDD – Part Two - CQS</title><link>http://feedproxy.google.com/~r/Devlicious/~3/5al8V4ardJU/we-are-not-doing-ddd-part-two-cqs.aspx</link><pubDate>Mon, 22 Jun 2009 16:32:58 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:48438</guid><dc:creator>Jak Charlton</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;From the beginning of my current project we have been working under some horrible constraints, many imposed by legacy systems, many by late decisions that would have speeded things immensely if made earlier, and many imposed by decisions that are outside of my control.&lt;/p&gt;  &lt;p&gt;This lead us early on to make decisions on architecture that eliminated any possibility of using DDD heavily, and as I mentioned in my original post about this project it is also essentially a glorified CRUD system - we read data from databases, we modify it a bit, and we put it back again.&lt;/p&gt;  &lt;h3&gt;What We Are Doing – Command Query Separation&lt;/h3&gt;  &lt;p&gt;The first architectural choice that I made, and in hindsight got accepted with relative ease, was to employ &lt;a href="http://dddstepbystep.com/wikis/ddd/blogged-command-query-separation-as-an-architectural-concept.aspx" target="_blank"&gt;CQS&lt;/a&gt; to simplify the system.&lt;/p&gt;  &lt;p&gt;Earlier projects had suffered quite badly from being abstractions of legacy systems with new functionality bolted on. As &lt;/p&gt;  &lt;p&gt;far as possible I wanted to eliminate this problem from our project, as I was all too aware that this was an easy trap for the team to fall into, and would burn a lot of development time very fast.&lt;/p&gt;  &lt;p&gt;To make the system simpler I chose to separate our query mechanisms from the &amp;quot;domain&amp;quot; type stuff, our commands and data writing/updating code.&lt;/p&gt;  &lt;p&gt;CQS is a pretty simple concept. One path through your system is responsible for querying of anything much more than &amp;quot;Get By ID&amp;quot; type calls. This side of our system is responsible for reading data from legacy systems, reading data from legacy web services, and for reading data from our application database.&lt;/p&gt;  &lt;h4&gt;Querying&lt;/h4&gt;  &lt;p&gt;The Query side deals largely in DataTables, DataSets and a very very limited number of DTOs. This data is largely and essentially used for display purposes, it is the contents of search results, the results of postcode lookups, the information to populate dropdown lists and tables. &lt;/p&gt;  &lt;p&gt;The Query side of CQS does not need strongly typed entities, nor does it require strongly typed DTOs - as it is largely ad-hoc data maintaining these entities and DTOs would consume a disproportionate amount of development time for something a DataTable can deal with more than adequately.&lt;/p&gt;  &lt;p&gt;Our Query side actually uses the Query Object pattern, most of which encapsulate a call to an Oracle DB, some of which wrap simple NHibernate criteria and a few of which sit around web services. These are fronted by a WCF facade, which allows us to put these queries out of process, and to cache them aggressively should be need.&lt;/p&gt;  &lt;p&gt;What we do not have in the system anywhere, and especially in the Query side, is any big entity model – we have two very small entity models (5 entities in total) used for very specific functions within our application.&lt;/p&gt;  &lt;h4&gt;Command&lt;/h4&gt;  &lt;p&gt;The Command side of the CQS equation is a little different. Firstly, it deals with anything that is essentially a request to &amp;quot;go do something&amp;quot;. In our case these are commands like &amp;quot;SaveDraft&amp;quot; and &amp;quot;CancelPolicy&amp;quot; &lt;/p&gt;  &lt;p&gt;The Command side can write data to the databases, the Query side is not allowed to.&lt;/p&gt;  &lt;p&gt;If we were doing DDD, this is where our Domain would sit - and in fact we have been referring to this as &amp;quot;the domain&amp;quot; for most of this project. But, we aren’t using DDD and we don&amp;#39;t really have a Domain Model. It is however where most stuff we could describe as &amp;quot;logic&amp;quot; lives. This is primarily a bunch of application services, most of which operate in response to messages fired over MSMQ using NServiceBus.&lt;/p&gt;  &lt;p&gt;This side of the architecture has a number of listeners that are responsible for pulling messages from various MSMQs and for dealing with the specific requests, for example pushing data back to our legacy systems, for logging, and eventually for notifications.&lt;/p&gt;  &lt;h4&gt;Benefits&lt;/h4&gt;  &lt;p&gt;Early on, the use of CQS paid for itself easily. By removing the complications of maintaining read and write models together, we quickly managed to get working prototype up and running, with no need for a &amp;quot;domain&amp;quot; or entity model up front.&lt;/p&gt;  &lt;p&gt;As the project has progressed, this decision has helped simplify decisions that otherwise would have involved structural or fundamental changes to the architecture – but more importantly, it has helped all of the developers think in terms of a command driven system, rather than viewing the system as CRUD over a database.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=48438" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/5al8V4ardJU" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/casey/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://devlicio.us/blogs/casey/archive/tags/DDD/default.aspx">DDD</category><category domain="http://devlicio.us/blogs/casey/archive/tags/CQS/default.aspx">CQS</category><feedburner:origLink>http://devlicio.us/blogs/casey/archive/2009/06/22/we-are-not-doing-ddd-part-two-cqs.aspx</feedburner:origLink></item><item><title>One day with Balsamiq Mockups: a review</title><link>http://feedproxy.google.com/~r/Devlicious/~3/_rjOeLWs370/one-day-with-balsamiq-mockups-a-review.aspx</link><pubDate>Fri, 19 Jun 2009 04:03:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47989</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>6</slash:comments><description>&lt;p&gt;We’ve just started a new Silverlight project and since &lt;strike&gt;our&lt;/strike&gt; &lt;em&gt;the&lt;/em&gt; &lt;a title="if you don&amp;#39;t believe, just ask him!" href="http://ayende.com/about-me.aspx"&gt;UI guy&lt;/a&gt; is not on site with us, I ended up with the task of producing screen mockups. Some interest was expressed in using &lt;a href="http://www.balsamiq.com/"&gt;Balsamiq Mockups&lt;/a&gt;, and this seemed like a good time to really take it for a&amp;#160; test drive.&lt;/p&gt;  &lt;h3&gt;What does it do?&lt;/h3&gt;  &lt;p&gt;Balsamiq is a tool for quickly authoring mockups of applications and websites. My favorite tool for doing mockups is pencil and paper (turns out that it’s really, really good). However, we needed something that we could readily show during a review meeting and my sketches don’t photocopy well.&lt;/p&gt;  &lt;p&gt;Nevertheless, I did my brainstorming on paper and I used it for my first round of reviews with the team. This left me with about a dozen pages storyboarding the core of our application. &lt;/p&gt;  &lt;p&gt;After the first review, I began recreate it with Balsamiq.&lt;/p&gt;  &lt;p&gt;In Balsamiq you start with a blank, gridded canvas and drag various UI elements from a library onto the canvas. It reminds me of Visio a bit, but without so much pain. All of the elements are styled to look like hand-drawn. This is important because it prevents anyone from assuming that the application is “done” when you’re just presenting mockups.&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="making a web page with Balsamiq" border="0" alt="making a web page with Balsamiq" src="http://devlicious.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/christopher_5F00_bennage/Untitled1_5F00_016725E9.jpg" width="646" height="667" /&gt; &lt;/p&gt;  &lt;p&gt;The elements in Balsamiq are impressively intelligent. Most elements allow you to type in some content and they react intuitively to that content. I was amazed a couple of time at how smartly they responded. Balsamiq ships with about 75 elements in its library and there are more &lt;a href="http://www.mockupstogo.net/"&gt;being posted&lt;/a&gt; all the time. You cannot really extend the library yourself however, though you can incorporate your own images.&lt;/p&gt;  &lt;p&gt;Each mockup screen is a single file. They are XML so it’s source control friendly. If you are mocking up an entire application (like I was) you can link the files together. Many of the elements have a link property that you can point to any other Balsamiq files in the same directory. Once you’ve linked up some files, you can “run” your mockups in presentation mode. This allows you to navigate around the application and toggle annotations (like the sticky note in my screen shot). The presentation mode is really cool.&lt;/p&gt;  &lt;h3&gt;Should you buy it?&lt;/h3&gt;  &lt;p&gt;I think that mocking up the UI is a very useful exercise. It helps to expose the behavior of the application that you are going to build and surfaces many insights into what it &lt;em&gt;really&lt;/em&gt; needs to do. I still prefer to use paper and pencil for the initial pass. However, I found that following this up with Balsamiq forced me to think through the entire flow of my appplication. My paper storyboards had holes in them that I did not realize until I attempted to express them in Balsamiq.&lt;/p&gt;  &lt;p&gt;The reviewers were really excited to see the Balsamiq mockups and being able to walk them through the application was a definite plus for them. The tool is easy to use. I would say that any &lt;strike&gt;designer&lt;/strike&gt; developer doing UI work should be using a tool like Balsamiq.&lt;/p&gt;  &lt;p&gt;What it offers for $79 is really hard to beat. Admittedly, I don’t know what other tools are out there and how they compare. By itself, I think it definitely worth it for anyone doing UI work.&lt;/p&gt;  &lt;p&gt;Of course, there is SketchFlow. It is coming. I think that SketchFlow looks very promising, especially for us XAML guys, but it’s not available yet. I’ll let you know what I think about the overlap once I get a change to actually use SketchFlow.&lt;/p&gt;  &lt;h3&gt;Little Things&lt;/h3&gt;  &lt;p&gt;I had a couple of annoyances that are worth pointing out. &lt;/p&gt;  &lt;p&gt;First, you cannot create reusable components. For example, I had certain elements of the application that appeared in several places. I had to clone these elements, but when I needed to change them, I had to make the change in each element. (Another reason to start with pencil).&lt;/p&gt;  &lt;p&gt;I think that it would also be nice if there was a “back button” in presentation mode. Within my mockup I had a few screens that you could get too in multiple ways, however I did not have an easy way of returning the the previous screen.&lt;/p&gt;  &lt;p&gt;I also get the impression that the community around Balsamiq likes to poke fun at us PC guys. I smile politely.&lt;/p&gt;  &lt;p&gt;Finally, Balsamiq likes to keep all of the linked files open. You’ll notice an excessive number of tabs on the bottom of the screen shot. Those are all the screens within the application I was mocking. It became a little difficult to find that right one.&lt;/p&gt;  &lt;p&gt;On the whole, Balsamiq is a smart application and I expect to see great things as it matures. Many of its features are intuitive and “just work”, and that’s how I like my software to roll.&lt;/p&gt;  &lt;pre&gt;:-P&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47989" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/_rjOeLWs370" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/development+tools/default.aspx">development tools</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UI/default.aspx">UI</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/UX/default.aspx">UX</category><feedburner:origLink>http://devlicio.us/blogs/christopher_bennage/archive/2009/06/19/one-day-with-balsamiq-mockups-a-review.aspx</feedburner:origLink></item><item><title>VS Addin: Fast Add Reference Dialog - No more Coffee Break!</title><link>http://feedproxy.google.com/~r/Devlicious/~3/dS5lHdTDh94/vs-addin-fast-add-reference-dialog-no-more-coffee-break.aspx</link><pubDate>Thu, 18 Jun 2009 20:28:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47982</guid><dc:creator>Tuna Toksoz</dc:creator><slash:comments>35</slash:comments><description>&lt;p&gt;&lt;b&gt;UPDATE 2: Now solution folders and some other stuff are done, thanks to Huseyin Tufekcilerli&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;UPDATE: I updated the dlls and the source in the link, now it doesn&amp;#39;t crash VS. Hopefully the only problem left is that solutions with multiple solution folders won&amp;#39;t be reflected in Projects tab. &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I have spent a couple of days on implementing a fast add reference dialog box for Visual Studio (&lt;a href="http://www.stevenrockarts.com/Blog/2008/07/21/QuickReference.aspx"&gt;with some help from an existing addin&lt;/a&gt;). The time of adding a reference has been a great time to have some coffee, to have lunch, or even a way to save economy (remember, developer time costs money!). If you don&amp;rsquo;t believe me, &lt;a href="http://twitter.com/#search?q=%22add%20reference%22"&gt;take a look at what tweeps say&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is actually easy once you find some of the extension points of Visual Studio. &lt;/p&gt;
&lt;p&gt;In my case, I had to implement &lt;a href="http://msdn.microsoft.com/en-us/library/extensibility.idtextensibility2(VS.80).aspx"&gt;IDTExtensibility2&lt;/a&gt; which contains method signatures to be called when a plugin is loaded, unloaded etc. &lt;/p&gt;
&lt;p&gt;As first step, I had added &amp;ldquo;Add Quick Reference&amp;rdquo; item to the context menu when a project is right clicked. This is the most tricky part as there is almost no documentation on that.&lt;/p&gt;
&lt;p&gt;The method that we should implement for this is:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public void &lt;/span&gt;OnConnection(&lt;span style="color:blue;"&gt;object &lt;/span&gt;application, &lt;span style="color:#2b91af;"&gt;ext_ConnectMode &lt;/span&gt;connectMode, &lt;br /&gt;                         &lt;span style="color:blue;"&gt;object &lt;/span&gt;addInInst, &lt;span style="color:blue;"&gt;ref &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Array &lt;/span&gt;custom)&lt;/pre&gt;
&lt;p&gt;The type of the application parameter implements DTE2 interface and the addInInst parameter implements AddIn interface, which has all we need.&lt;/p&gt;
&lt;p&gt;The DTE2 interface has CommandBars property which gives us access to various VS stuff. The matter is to find the right one. After for-looping all CommandBar item, i found that the place I should add my custom item is &amp;ldquo;Context Menus&amp;rdquo;-&amp;gt;&amp;rdquo;Project and Solution Context Menus&amp;rdquo;-&amp;gt;&amp;rdquo;Reference Root&amp;rdquo;. Man this is hard to locate! Looking forward to MEF in 2010!&lt;/p&gt;
&lt;pre class="code"&gt;applicationObject = (&lt;span style="color:#2b91af;"&gt;DTE2&lt;/span&gt;)application;&lt;br /&gt;addInInstance = (&lt;span style="color:#2b91af;"&gt;AddIn&lt;/span&gt;)addInInst;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;CommandBars &lt;/span&gt;cb = applicationObject.CommandBars &lt;span style="color:blue;"&gt;as &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CommandBars&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;CommandBar &lt;/span&gt;bar = cb[&lt;span style="color:#a31515;"&gt;&amp;quot;Context Menus&amp;quot;&lt;/span&gt;];&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;CommandBarPopup &lt;/span&gt;cbarControl = bar.Controls[&lt;span style="color:#a31515;"&gt;&amp;quot;Project and Solution Context Menus&amp;quot;&lt;/span&gt;] &lt;br /&gt;                              &lt;span style="color:blue;"&gt;as &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CommandBarPopup&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;commandBarControls = cbarControl.Controls;&lt;br /&gt;&lt;span style="color:blue;"&gt;this&lt;/span&gt;.referenceRoots = commandBarControls[&lt;span style="color:#a31515;"&gt;&amp;quot;Reference Root&amp;quot;&lt;/span&gt;] &lt;span style="color:blue;"&gt;as &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CommandBarPopup&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;button = &lt;span style="color:blue;"&gt;this&lt;/span&gt;.referenceRoots.Controls.Add(&lt;span style="color:#2b91af;"&gt;MsoControlType&lt;/span&gt;.msoControlButton,&lt;br /&gt;                           System.Reflection.&lt;span style="color:#2b91af;"&gt;Missing&lt;/span&gt;.Value,&lt;br /&gt;                           System.Reflection.&lt;span style="color:#2b91af;"&gt;Missing&lt;/span&gt;.Value, 1, &lt;span style="color:blue;"&gt;true&lt;/span&gt;) &lt;br /&gt;                            &lt;span style="color:blue;"&gt;as &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CommandBarButton&lt;/span&gt;;&lt;br /&gt;button.Caption = &lt;span style="color:#a31515;"&gt;&amp;quot;Add Quick Reference&amp;quot;&lt;/span&gt;;&lt;br /&gt;button.Click += oControl_Click;&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is one thing to be careful about: If you want to handle events of a button, for example, you should hold a reference in your class. Local method variables wouldn&amp;rsquo;t work. This situation &lt;a href="http://blogs.msdn.com/bowerm/archive/2004/06/22/162304.aspx"&gt;is better told here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, I am done. I should now design the dialog itself that looks very similar to the original one. There is another problem: There is no &amp;quot;Windows Explorer Like&amp;rdquo; control for Windows Forms. There is OpenFileDialog but it is a dialog, not a control. I found the most similar one at &lt;a href="http://gong-shell.sourceforge.net/"&gt;GongShell Project&lt;/a&gt; which is licensed under GPL.&lt;/p&gt;
&lt;p&gt;My current screen looks like the one below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tuna_5F00_toksoz/image_5F00_4E2DC044.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/tuna_5F00_toksoz/image_5F00_thumb_5F00_619AD44B.png" border="0" width="551" height="330" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Very similar, even if I say so myself.&lt;/p&gt;
&lt;p&gt;One thing to notice here is that the first tab is browse(.NET in original dialog), second is .net (Browse in original dialog) and third one is Projects. I haven&amp;rsquo;t written &amp;ldquo;Recent&amp;rdquo; part as I don&amp;rsquo;t want to deal with I/O really.&lt;/p&gt;
&lt;p&gt;I believe that Browse window is more frequently used than .NET tab. There can be more improvements on that screen, such as having &amp;ldquo;common&amp;rdquo; tab which does the copying of commonly used references to a new project but hey this is a demonstration only ! :)&lt;/p&gt;
&lt;p&gt;The items in the .NET tab are loaded in the background, and once it is loaded, it will be cached during the lifetime of the application.&lt;/p&gt;
&lt;p&gt;I won&amp;rsquo;t comment more on the code, go grab it and try it. I wont continue developing this little addin, so you are free to do it on your own. Just drop me an email when you do it, though.&lt;/p&gt;
&lt;p&gt;I just warn you: Com stuff is like walking on a mine field, and I am not taking any responsibility in case you loose data.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://tunatoksoz.com/files/addreference-addin.rar"&gt;Download the code and the binaries here&lt;/a&gt; and put the binaries into Documents\Visual Studio 2008\Addins folder. Have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you like the post and the tool, please Kick! and Shout! it below!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdevlicio.us%2fblogs%2ftuna_toksoz%2farchive%2f2009%2f06%2f18%2fvs-addin-fast-add-reference-dialog-no-more-coffee-break.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdevlicio.us%2fblogs%2ftuna_toksoz%2farchive%2f2009%2f06%2f18%2fvs-addin-fast-add-reference-dialog-no-more-coffee-break.aspx&amp;amp;bgcolor=3333FF" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dotnetshoutout.com/Fast-Add-Reference-Dialog-No-more-Coffee-Break-Tuna-Toksoz-Devlicious" rev="vote-for"&gt;&lt;img style="border-right-width:0px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fdevlicio.us%2Fblogs%2Ftuna_toksoz%2Farchive%2F2009%2F06%2F18%2Fvs-addin-fast-add-reference-dialog-no-more-coffee-break.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47982" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/dS5lHdTDh94" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/tuna_toksoz/archive/2009/06/18/vs-addin-fast-add-reference-dialog-no-more-coffee-break.aspx</feedburner:origLink></item><item><title>Code Contracts Primer – Part 4: Utilizing Pre &amp; Post Conditions</title><link>http://feedproxy.google.com/~r/Devlicious/~3/rnnp4qujfKM/code-contracts-primer-part-4-utilizing-pre-amp-post-conditions.aspx</link><pubDate>Mon, 15 Jun 2009 19:29:55 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47937</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;If you are not familiar with the &lt;a href="http://research.microsoft.com/en-us/projects/contracts/"&gt;Code Contracts&lt;/a&gt; library which is coming out of Microsoft R&amp;amp;D labs, you need to check this pretty cool little library out.&amp;#160; As of Vs2010/.Net 4.0 this library will be making the jump out of the R&amp;amp;D labs.&amp;#160; &lt;/p&gt;  &lt;p&gt;Over the next few blog posts we will be taking a look at the topics below.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/08/code-contracts-primer-part-1-introduction.aspx"&gt;Downloading and setting up the contracts library&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/09/code-contracts-primer-part-2-handling-legacy-code.aspx"&gt;Handling Legacy Code&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/13/code-contracts-primer-part-3-providing-support-for-unit-tests.aspx"&gt;Providing Support for Unit Tests&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;i&gt;Utilizing Pre &amp;amp; Post Conditions (this post)&lt;/i&gt; &lt;/li&gt;    &lt;li&gt;Utilizing Object Invariants &lt;/li&gt;    &lt;li&gt;Performing checking in base classes/abstract classes &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In this post we are going to take a look at what might be considered the most basic usage scenario for the contracts library, Pre and Post condition validation.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;What is a pre-condition validation?&lt;/b&gt;     &lt;br /&gt;This is when we want to validate the state of the world (parameters or other state holding values) is valid prior to running a method.&amp;#160; Pre-condition validation is done by utilizing the Contract.Requires(…) or Contract.Requires&amp;lt;CustomExceptionHere&amp;gt;(…) method. &lt;/p&gt;  &lt;p&gt;The code below is what your pre-condition code could look like the code below:&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;public ReportCard GetDailyReportCard(Int32 employeeId, DateTime dateForReportCard)
{
	Contract.Requires(employeeId &amp;gt; 0);
	Contract.Requires&amp;lt;ArgumentOutOfRangeException&amp;gt;(dateForReportCard.Date == DateTime.Now.Date);&lt;br /&gt;

	// do something meaning
	var reportCard = new ReportCard(employeeId);

	return reportCard;
}&lt;/pre&gt;

&lt;p&gt;The code above shows 2 different ways you can use the contracts libray.&amp;#160; The first simply uses the standard .Requires() logic and is meant to ensure that the employeeId is always &amp;gt; 0.&amp;#160; The second uses the overload of .Requires&amp;lt;&amp;gt;() and will provide the exception type which should be thrown if a contract is violated. As we have mentioned before, the contracts library uses Code Weaving to do its magic.&amp;#160; Lets take a look at how it re-wrote the .Requires() for us on the back end (via reflector).&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;
public ReportCard GetDailyReportCard(int employeeId, DateTime dateForReportCard)
{
	if (__ContractsRuntime.insideContractEvaluation &amp;lt;= 4)
	{
		try
		{
			__ContractsRuntime.insideContractEvaluation++;
			__ContractsRuntime.Requires(employeeId &amp;gt; 0, null, &amp;quot;employeeId &amp;gt; 0&amp;quot;);
			__ContractsRuntime.Requires(dateForReportCard.Date == DateTime.Now.Date, null, &amp;quot;dateForReportCard.Date == DateTime.Now.Date&amp;quot;);
		}
		finally
		{	
			__ContractsRuntime.insideContractEvaluation--;
		}
	}
	
	return new ReportCard(employeeId);
}&lt;/pre&gt;

&lt;p&gt;As you can see the code has changed, but not too much. &lt;/p&gt;

&lt;p&gt;Now that we have mastered pre-conditions it is time to take a look at post-conditions&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What is a post-condition validation?&lt;/b&gt; 

  &lt;br /&gt;This is when you want to validate the state of a method when that method terminates.&amp;#160; With post conditions you can assert that the return value so the caller can be assured the values will always be within range when returned.&amp;#160; Post-Condition checks can be done with the Contract.Ensures() method and can take a special command which is Contract.Result&amp;lt;&amp;gt; which allows you to specify the result type and its condition.&lt;/p&gt;

&lt;p&gt;The code below is an simple example of how you can create your post-condition check.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public ReportCard GetWeeklyReportCard( Int32 employeeId )
{
	Contract.Ensures( Contract.Result&amp;lt;ReportCard&amp;gt;() != null );
	
	var reportCard = new ReportCard( employeeId );
	
	return reportCard;           
}&lt;/pre&gt;

&lt;p&gt;In the check above we are simply trying to ensure that the return value from this method will never be null.&amp;#160; Of course this is just a simple example and you could validate over types of items as well.&lt;/p&gt;

&lt;p&gt;As we did in the pre-condition, lets take a look at the code as it exists after code weaving:&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;
public ReportCard GetWeeklyReportCard(int employeeId)
{
	ReportCard reportCard = new ReportCard(employeeId);
	ReportCard CS$1$0000 = reportCard;
	ReportCard Contract.Result() = CS$1$0000;
	if (__ContractsRuntime.insideContractEvaluation &amp;lt;= 4)
	{	
		try
		{
			__ContractsRuntime.insideContractEvaluation++;
			__ContractsRuntime.Ensures(Contract.Result() != null, null, &amp;quot;Contract.Result() != null&amp;quot;);
		}
		finally
		{
			__ContractsRuntime.insideContractEvaluation--;
		}
	}

	return Contract.Result();
}
&lt;/pre&gt;

&lt;p&gt;Again you can see that the weaver did its magic, but this time it did a bit more work.&amp;#160; The good news for us is that the code still works as intended so there is nothing too much to worry about.&lt;/p&gt;

&lt;p&gt;Now that we have taking a look at both pre-conditions and post-condition checking with the contracts library you are more than on your way to utilizing this library in your code.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47937" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/rnnp4qujfKM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Code+Contracts/default.aspx">Code Contracts</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/06/15/code-contracts-primer-part-4-utilizing-pre-amp-post-conditions.aspx</feedburner:origLink></item><item><title>Spotlight on JavaScript at the CNUG</title><link>http://feedproxy.google.com/~r/Devlicious/~3/vSZ-8fLgfuY/spotlight-on-javascript-at-the-cnug.aspx</link><pubDate>Mon, 15 Jun 2009 18:09:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47936</guid><dc:creator>sergiopereira</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;This Wednesday, June 17&lt;sup&gt;th&lt;/sup&gt;, the Chicago .NET Users Group, &lt;a href="http://cnug.org/"&gt;CNUG&lt;/a&gt;, has invited me to 
	bring my JavaScript presentation to their monthly meeting.&lt;/p&gt;

&lt;p&gt;Despite of what the event description might lead you to believe, the
	talk is hardcore JavaScript, not much specific to Ajax at all, although
	I believe the material will greatly help you with the Ajax work as well.&lt;/p&gt;
	
&lt;p&gt;You can read the &lt;a href="http://www.sergiopereira.com/presentations/js-beyond.html"&gt;&lt;b&gt;complete talk description&lt;/b&gt;&lt;/a&gt; 
	and &lt;a href="https://www.clicktoattend.com/invitation.aspx?code=139086"&gt;&lt;b&gt;register for the event&lt;/b&gt;&lt;/a&gt;. 
	Hope to see you there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47936" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/vSZ-8fLgfuY" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Announcement/default.aspx">Announcement</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Community/default.aspx">Community</category><feedburner:origLink>http://devlicio.us/blogs/sergio_pereira/archive/2009/06/15/spotlight-on-javascript-at-the-cnug.aspx</feedburner:origLink></item><item><title>Joining NHibernate Transaction with ADO SqlTransaction</title><link>http://feedproxy.google.com/~r/Devlicious/~3/g-hcQqcpHm8/joining-nhibernate-transaction-with-ado-sqltransaction.aspx</link><pubDate>Mon, 15 Jun 2009 16:35:54 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47935</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;Recently (ok, today) I needed to drop down into ADO to call a procedure in our code.&amp;#160; I was not too happy with it, but either my lack of knowledge or lack of will to figure it out mandated it.&amp;#160; What I needed to do was create a build-insert process and using NHibernate was not the right solution for performance reasons.&lt;/p&gt;  &lt;p&gt;When I first created my code, seen below my tests worked fine.&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;public void AssignNewDestinationToPatients( Destination destination )
{
    var connection = (SqlConnection) Session.Connection;
    
    var sqlCommand = new SqlCommand
                         {
                             CommandType = CommandType.StoredProcedure,
                             CommandText = StoredProcedures.DO_SOMETHING,
                             Connection = connection,                                     
                         };

    sqlCommand.Parameters.Add( new SqlParameter( &amp;quot;DestinationID&amp;quot;, destination.DestinationID ) );

    sqlCommand.ExecuteNonQuery()    ;
}&lt;/pre&gt;

&lt;p&gt;However, once this call was wrapped around an NH transaction i would receive the following error:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;{&amp;quot;ExecuteNonQuery requires the command to have a transaction when the connection assigned to the command is in a pending local transaction.&amp;#160; The Transaction property of the command has not been initialized.&amp;quot;}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Of course the first I tried to do was cast the NH transaction to a sql transaction and provide that to the command object.&amp;#160; However, that is NOT possible.&amp;#160; The great news for me was the NH has the capacity to enlist a sql commmand and add it to its transaction.&amp;#160; The code below shows how to do this.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public void AssignNewDestinationToPatients( Destination destination )
{
    var connection = (SqlConnection) Session.Connection;
    
    var sqlCommand = new SqlCommand
                         {
                             CommandType = CommandType.StoredProcedure,
                             CommandText = StoredProcedures.DO_SOMETHING,
                             Connection = connection,                                     
                         };

    // this is the magic code
    if ( Session.Transaction != null &amp;amp;&amp;amp; Session.Transaction.IsActive )
    {
        Session.Transaction.Enlist( sqlCommand );
    }

    sqlCommand.Parameters.Add( new SqlParameter( &amp;quot;DestinationID&amp;quot;, destination.DestinationID ) );

    sqlCommand.ExecuteNonQuery()    ;
}&lt;/pre&gt;

&lt;p&gt;So, if you need to drop down to ADO from NHibernate and you need to use transactions, this solution should work out well for you.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;

&lt;p&gt;P.S. If there is a better, simpler way please let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47935" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/g-hcQqcpHm8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/06/15/joining-nhibernate-transaction-with-ado-sqltransaction.aspx</feedburner:origLink></item><item><title>Code Contracts Primer – Part 3: Providing Support for Unit Tests</title><link>http://feedproxy.google.com/~r/Devlicious/~3/NDP6pFHEicw/code-contracts-primer-part-3-providing-support-for-unit-tests.aspx</link><pubDate>Sat, 13 Jun 2009 14:46:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47911</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;If you are not familiar with the &lt;a href="http://research.microsoft.com/en-us/projects/contracts/"&gt;Code Contracts&lt;/a&gt; library which is coming out of Microsoft R&amp;amp;D labs, you need to check this pretty cool little library out.&amp;nbsp; As of Vs2010/.Net 4.0 this library will be making the jump out of the R&amp;amp;D labs.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Over the next few blog posts we will be taking a look at the topics below.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/08/code-contracts-primer-part-1-introduction.aspx"&gt;Downloading and setting up the contracts library&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2009/06/09/code-contracts-primer-part-2-handling-legacy-code.aspx"&gt;Handling Legacy Code&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;i&gt;Providing Support for Unit Tests (this post)&lt;/i&gt; &lt;/li&gt;
&lt;li&gt;Utilizing Pre &amp;amp; Post Conditions &lt;/li&gt;
&lt;li&gt;Utilizing Object Invariants &lt;/li&gt;
&lt;li&gt;Performing checking in base classes/abstract classes &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this post we are going to take a look at how you can setup your unit tests to handle violations from your contracts.&amp;nbsp; If you do not provide any &lt;i&gt;additional &lt;/i&gt;support in your code and you violate a contract at test time you will see a dialog like the one below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_0D8EEC57.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_68617C1D.png" border="0" height="298" width="454" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The problem with having a dialog like this appear during your test runs should be apparent.&amp;nbsp; Any type of dialog will cause any automated build/test system to pause and wait until there is some user interaction, this is BAD.&lt;/p&gt;
&lt;p&gt;The good news is that resolving this issue is actually simple and can be done with a few lines of code.&amp;nbsp; All we need to do is hookup the event listener which the contracts library provides and trap for the violation.&amp;nbsp; The code below shows us how to do this.&lt;/p&gt;
&lt;pre class="c-sharp" name="code"&gt;private bool _contractViolationHandled;

[SetUp]
public void Setup()
{
    Contract.ContractFailed += (sender, o) =&amp;gt;
                                   {
                                       o.SetHandled();
                                       _contractViolationHandled = true;
                                   };
}

[TearDown]
public void TearDown()
{
    _contractViolationHandled = false;
}&lt;/pre&gt;
&lt;p&gt;As you can see from the code above, wiring to handle the violations is simple.&amp;nbsp; But we should point out a few lines to pay attention to.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;o.SetHandled(); &amp;ndash; If you do not set this you will still be able to handle the error, but it will continue to bubble up and you will still get the dialog&lt;/li&gt;
&lt;li&gt;[TearDown] &amp;ndash; because we are setting a global variable in the setup, we MUST rest that value other wise you may get false errors in future test runs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There you go, if you need to trap hand handle contract violations in your unit tests, you can utilize the technique above to avoid getting the violations dialog.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47911" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/NDP6pFHEicw" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Code+Contracts/default.aspx">Code Contracts</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/06/13/code-contracts-primer-part-3-providing-support-for-unit-tests.aspx</feedburner:origLink></item><item><title>Caliburn v1 Release Candidate</title><link>http://feedproxy.google.com/~r/Devlicious/~3/_rSDH-VgZdw/caliburn-v1-release-candidate.aspx</link><pubDate>Sat, 13 Jun 2009 04:19:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:47896</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;On Friday I published the Release Candidate for Caliburn.&amp;nbsp; You can get it &lt;a target="_blank" href="http://caliburn.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28706"&gt;here&lt;/a&gt;.&amp;nbsp; I&amp;rsquo;m hoping to only do bug fixes and a few minor changes between now and release.&amp;nbsp; There have been quite a few important changes since the Beta:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Refactored assemblies for greater ease of use. &lt;/li&gt;
&lt;li&gt;Implemented an Application base class that supports model-first development. &lt;/li&gt;
&lt;li&gt;Introduced IViewStrategy and the View.Model attached property. &lt;/li&gt;
&lt;li&gt;Added CommandSource triggers &lt;/li&gt;
&lt;li&gt;Tweaked the implementation of Actions/Commands so that it performs better and is more intelligent &lt;/li&gt;
&lt;li&gt;Updated dependencies on other OSS projects&lt;/li&gt;
&lt;li&gt;Added a WPF version of the LOB Sample &lt;/li&gt;
&lt;li&gt;Factored out mini-frameworks for the both the WPF and Silverlight LOB samples. &lt;/li&gt;
&lt;li&gt;Implemented binding validation of hierarchical path notation. &lt;/li&gt;
&lt;li&gt;Fixed many bugs throughout the framework.&lt;/li&gt;
&lt;li&gt;Lots of other random features and improvements&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope that if you are building WPF or Silverlight applications you will take some time to evaluate &lt;a target="_blank" href="http://caliburn.codeplex.com/"&gt;Caliburn&lt;/a&gt; and give me some feedback.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=47896" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/_rSDH-VgZdw" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/06/13/caliburn-v1-release-candidate.aspx</feedburner:origLink></item></channel></rss>
