<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:idx="urn:atom-extension:indexing" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:media="http://search.yahoo.com/mrss/" idx:index="no"><!--
Content-type: Preventing XSRF in IE.

--><generator uri="http://www.google.com/reader">Google Reader</generator><id>tag:google.com,2005:reader/user/09605430823642270891/label/Blogs</id><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><title>"Blogs" via Headspring in Google Reader</title><gr:continuation>CKeU_YmesJ0C</gr:continuation><author><name>Headspring</name></author><updated>2009-11-09T21:32:13Z</updated><link rel="self" href="http://feeds.feedburner.com/blogspring" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gr:crawl-timestamp-msec="1257802333126"><id gr:original-id="http://jeffreypalermo.com/blog/party-with-palermo-pdc-lsquo-09-edition-ndash-6-days-and-counting/">tag:google.com,2005:reader/item/1cc4f2f8cf71f294</id><category term="Blog" scheme="http://jeffreypalermo.com/blog/" /><title type="html">Party with Palermo: PDC ‘09 edition – 6 days and counting</title><published>2009-11-09T20:55:55Z</published><updated>2009-11-09T20:55:55Z</updated><link rel="alternate" href="http://jeffreypalermo.com/blog/party-with-palermo-pdc-lsquo-09-edition-ndash-6-days-and-counting/" type="text/html" /><summary xml:base="http://jeffreypalermo.com/" type="html">&lt;p&gt;&lt;a href="http://jeffreypalermo.com/files/media/image/WindowsLiveWriter/PartywithPalermoPDC09edition6daysandcoun_D207/image_6.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 10px 0px 0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" align="left" src="http://jeffreypalermo.com/files/media/image/WindowsLiveWriter/PartywithPalermoPDC09edition6daysandcoun_D207/image_thumb_2.png" width="129" height="129"&gt;&lt;/a&gt; That’s right, folks!  For those of your coming to &lt;a href="http://microsoftpdc.com/"&gt;Microsoft’s Professional Developers’ Conference (PDC)&lt;/a&gt;, &lt;a href="http://partywithpalermo.com"&gt;Party with Palermo&lt;/a&gt; is going to kick the week off right.  The conference starts on Tuesday, so Monday night, we are going to get down and party to the turntables of &lt;a href="http://djcraig.com/"&gt;DJ Craig&lt;/a&gt;.  If you were at the Party with Palermo at Tech Ed,  you remember this DJ and how he had the uncanny ability to get folks like &lt;a href="http://blogs.tedneward.com/"&gt;Ted Neward&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/saraford/"&gt;Sara Ford&lt;/a&gt; dancing like it was 199. . . 2009!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://jeffreypalermo.com/files/media/image/WindowsLiveWriter/PartywithPalermoPDC09edition6daysandcoun_D207/image_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://jeffreypalermo.com/files/media/image/WindowsLiveWriter/PartywithPalermoPDC09edition6daysandcoun_D207/image_thumb.png" width="244" height="184"&gt;&lt;/a&gt; &lt;a href="http://jeffreypalermo.com/files/media/image/WindowsLiveWriter/PartywithPalermoPDC09edition6daysandcoun_D207/image_4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://jeffreypalermo.com/files/media/image/WindowsLiveWriter/PartywithPalermoPDC09edition6daysandcoun_D207/image_thumb_1.png" width="244" height="184"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here is the skinny:  Monday night – 7pm-10pm before PDC.  Come to The Mayan, 6 blocks from the convention center in downtown L.A.  Party with Palermo.  &lt;a href="http://pdc09.partywithpalermo.com/"&gt;&lt;strong&gt;RSVP now&lt;/strong&gt;&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;November 16, 2009 - Los Angeles, CA - 7:00PM - 10:00PM&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The Mayan (&lt;a href="http://bit.ly/themayan"&gt;map&lt;/a&gt;, &lt;a href="http://clubmayan.com"&gt;website&lt;/a&gt;)    &lt;br&gt;1038 South Hill St., Los Angeles, CA 90015    &lt;br&gt;Ph: (213) 746-4287 - (six blocks from the convention center)    &lt;br&gt;Cover charge is 1 business card.  This will get you in the door and register you for the grand prize drawings.&lt;/p&gt;  &lt;p&gt;Entertainment provided by: &lt;/p&gt;  &lt;h4&gt;&lt;a href="http://www.djcraig.net/"&gt;DJ Craig&lt;/a&gt;&lt;/h4&gt;  &lt;ul&gt;   &lt;li&gt;Free to attend &lt;/li&gt;    &lt;li&gt;Free drinks &lt;/li&gt;    &lt;li&gt;Free swag &lt;/li&gt;    &lt;li&gt;Eat before you come&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Sponsors: (&lt;a href="http://pdc09.partywithpalermo.com/main/requestforsponsors"&gt;find out how to become a sponsor&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.headspringsystems.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/headspring300.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.jetbrains.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/JetBrains300.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.preemptive.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/PreEmptive300.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.xceed.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/Xceed300.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.devexpress.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/Devexpress300.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.devmavens.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/DevMavens.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.infragistics.com/"&gt;&lt;img alt="" src="http://pdc09.partywithpalermo.com/images/infragistics300.jpg"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;KEEP TABS ON HTTP://www.PartyWithPalermo.com --- THIS IS WHERE THE INFORMATION WILL BE POSTED.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://visitor.constantcontact.com/email.jsp?m=1102390194591&amp;amp;p=oi"&gt;Subscribe to the Party with Palermo newsletter&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Feel free to blog and link back to this site. &lt;/em&gt;&lt;/p&gt;</summary><author><name>Jeffrey Palermo</name></author><source gr:stream-id="feed/http://jeffreypalermo.com/feed/"><id>tag:google.com,2005:reader/feed/http://jeffreypalermo.com/feed/</id><title type="html">Jeffrey Palermo (.com)</title><link rel="alternate" href="http://jeffreypalermo.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257784753242"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:30181">tag:google.com,2005:reader/item/d546fe9a068be432</id><category term="C#" /><title type="html">Fields and virtual members</title><published>2009-11-09T14:40:25Z</published><updated>2009-11-09T14:40:25Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/xiYwfDocNI0/fields-and-virtual-members.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;It seems like the sillier the bug, the more time you’ll spend debugging it, simply because it’s in functionality you just &lt;em&gt;knew&lt;/em&gt; that worked correctly (and had the tests to back it up).  One problem we hit recently was code that used fields to back virtual properties:&lt;/p&gt;  &lt;pre&gt;&lt;span style="color:blue"&gt;public abstract class &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Enumeration &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IComparable
&lt;/span&gt;{
    &lt;span style="color:blue"&gt;private readonly int &lt;/span&gt;_value;

    &lt;span style="color:blue"&gt;protected &lt;/span&gt;Enumeration() { }

    &lt;span style="color:blue"&gt;protected &lt;/span&gt;Enumeration(&lt;span style="color:blue"&gt;int &lt;/span&gt;value)
    {
        _value = value;
    }

    &lt;span style="color:blue"&gt;public virtual int &lt;/span&gt;Value
    {
        &lt;span style="color:blue"&gt;get &lt;/span&gt;{ &lt;span style="color:blue"&gt;return &lt;/span&gt;_value; }
    }

    &lt;span style="color:blue"&gt;public virtual int &lt;/span&gt;CompareTo(&lt;span style="color:blue"&gt;object &lt;/span&gt;other)
    {
        &lt;span style="color:blue"&gt;return &lt;/span&gt;_value.CompareTo(((&lt;span style="color:#2b91af"&gt;Enumeration&lt;/span&gt;)other).Value);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;This isn’t a problem in and of itself, except in the behavior of that last method.  Notice its logic uses the &lt;em&gt;field&lt;/em&gt; and not the &lt;em&gt;property&lt;/em&gt;.  I can then define a derived type:&lt;/p&gt;

&lt;pre&gt;&lt;span style="color:blue"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af"&gt;PercentDiscount &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;Enumeration
&lt;/span&gt;{
    &lt;span style="color:blue"&gt;public override int &lt;/span&gt;Value
    {
        &lt;span style="color:blue"&gt;get &lt;/span&gt;{ &lt;span style="color:blue"&gt;return &lt;/span&gt;5; }
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;But now my CompareTo method breaks because it isn’t using the correct value.  It uses the uninitialized field, causing all sorts of bizarre behavior.  When you have logic errors in places like GetHashCode, Equals or CompareTo, I can guarantee your application will break in the most hair-pulling ways imaginable.&lt;/p&gt;

&lt;h3&gt;Let’s fix it&lt;/h3&gt;

&lt;p&gt;So what’s a better option?  We could just “make sure” that we don’t use the private field, and only use the virtual property.  But I hate conventions that rely on my memory to not make a mistake, I want to fall into the &lt;a href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx"&gt;pit of success&lt;/a&gt;.  One way to do so is to use automatic properties:&lt;/p&gt;

&lt;pre&gt;&lt;span style="color:blue"&gt;public abstract class &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Enumeration &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IComparable
&lt;/span&gt;{
    &lt;span style="color:blue"&gt;protected &lt;/span&gt;Enumeration() { }

    &lt;span style="color:blue"&gt;protected &lt;/span&gt;Enumeration(&lt;span style="color:blue"&gt;int &lt;/span&gt;value)
    {
        Value = value;
    }

    &lt;span style="color:blue"&gt;public virtual int &lt;/span&gt;Value
    { 
        &lt;span style="color:blue"&gt;get&lt;/span&gt;;
        &lt;span style="color:blue"&gt;private set&lt;/span&gt;;
    }

    &lt;span style="color:blue"&gt;public virtual int &lt;/span&gt;CompareTo(&lt;span style="color:blue"&gt;object &lt;/span&gt;other)
    {
        &lt;span style="color:blue"&gt;return &lt;/span&gt;Value.CompareTo(((&lt;span style="color:#2b91af"&gt;Enumeration&lt;/span&gt;)other).Value);
    }
}&lt;/pre&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;Instead of a backing field, we’ll use an automatic property, making it impossible to use a non-virtual backing field.  We still get the same access modifiers (a virtual, overridable getter, a private setter), plus the benefits of automatic properties.  So now I’m curious: &lt;strong&gt;are there any valid reasons to keep using fields for holding state&lt;/strong&gt;?&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Fields+and+virtual+members&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f09%2ffields-and-virtual-members.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f09%2ffields-and-virtual-members.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30181" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=xiYwfDocNI0:WggNhI-E1uU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=xiYwfDocNI0:WggNhI-E1uU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=xiYwfDocNI0:WggNhI-E1uU:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=xiYwfDocNI0:WggNhI-E1uU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=xiYwfDocNI0:WggNhI-E1uU:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/xiYwfDocNI0" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><gr:likingUser>06910811198236229876</gr:likingUser><gr:likingUser>00054107962405495615</gr:likingUser><gr:likingUser>01696337302850717225</gr:likingUser><gr:likingUser>15140239910597479409</gr:likingUser><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257739580857"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:29898">tag:google.com,2005:reader/item/79b50d67d5bb501c</id><category term="Asp.Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx" /><category term="Asp.Net MVC" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx" /><category term="Portable Area" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Portable+Area/default.aspx" /><title type="html">ASP.Net MVC Portable Area – Part 4 IoC framework support.</title><published>2009-11-04T05:00:00Z</published><updated>2009-11-04T05:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/PKYYqEQSLMY/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;Part 1 – Introduction&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/02/asp-net-mvc-portable-areas-part-2.aspx"&gt;Part 2 – Sample Portable Area&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/03/asp-net-mvc-portable-areas-part-3.aspx"&gt;Part 3 – Using of a Portable Area&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Part 4 – Using an Inversion of Control Framework.  (this post) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Using an Inversion of Control Container is a common scenario that would be needed by a Message Handler.  The Bus has an extensibility point to create the handlers. The model for this should feel similar to the ControllerFactory extension point in the ASP.Net MVC framework.  The sample below shows how to create a Message Handler factory for the StructureMap framework.  &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_600BF09E.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" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2CCFB735.png" width="644" height="179"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The SetMessageHandlerFactory method should be called once at application startup.   Other than that … this is a pretty simple way to add a Dependency Injection Framework support to the Portable Area infrastructure.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;This makes it pretty simple for your message handlers to use constructor injection to manage their dependencies.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Area+%e2%80%93+Part+4+IoC+framework+support.&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fasp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fasp-net-mvc-portable-area-part-4-ioc-framework-support.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29898" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/PKYYqEQSLMY" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257530414418"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:29992">tag:google.com,2005:reader/item/ce2d1e2cea3088a6</id><category term="Asp.Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx" /><category term="CC.Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/CC.Net/default.aspx" /><category term="continous integration" scheme="http://www.lostechies.com/blogs/hex/archive/tags/continous+integration/default.aspx" /><category term="Tools" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Tools/default.aspx" /><category term="Open Source Software" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Open+Source+Software/default.aspx" /><category term="MSDeploy" scheme="http://www.lostechies.com/blogs/hex/archive/tags/MSDeploy/default.aspx" /><category term="Deployment" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Deployment/default.aspx" /><title type="html">Using MSDeploy to automate your Enterprise Application remote deployments.</title><published>2009-11-06T17:00:00Z</published><updated>2009-11-06T17:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/_nfNP-Tnt7k/using-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;MsDeploy is a newish technology that is a bit schizophrenic.  What I mean is that it is a tool that is useful to both Developers and Administrators but it is not clear from the documentation how to best use the technology and how to approach it. I believe it stated as a Server Administrator tool and the team was able to work in an integration with Visual Studio which made it into a more robust framework, but at the same time left is command line interface with so many options that it is challenging to get a grasp on.  To top that off the Web Platform Installer uses the MsDeploy packages as a way to distribute packages through that tool.  After working through some various ways to use the technology I have settled into some commands that work well for our projects. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Let me set the context of how we are using the tool and what we already had in place so that you can better understand if my use of MsDeploy will work for you. At &lt;a href="http://www.headspringsystems.com/"&gt;Headspring&lt;/a&gt; we use Continuous Integration on all of our projects and as a result, once our software is built by our build server the next logical step is to deploy our software to a server and than run User Interface tests against the application. Most of our projects are web applications running on ASP.Net MVC using Sql Server as the back end.  We install our software using a lightweight zipfile that contains the web application files, database migration scripts and a deployment script which can poke config files and execute our database migration tool.  We already have all the pieces in place to deploy our application on a local machine.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Up until know we have used two methods to deploy instances to remote machines.  The first methods was to install Cruise Control.Net on the server and have it monitor our source control repository for a new installation package being committed to the repository. Once it sees a new package CCNet will pull down the package, install it locally and go on its merry way.  The second method, is to kick off the deployment from the build server and connect over the network to the target database to run upgrades and then xcopy the files to a unc share.  Both of these methods require setting up some configuration on our target servers. My goal with our deployments is to reduce the amount of per server configuration we do on each server and use some conventions to make each server look similar to one from a different project.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Using MSDeploy allows us to do the following.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1. Remove the need to install cruise control on the target server and update the configuration for cruise control on each target server.  We do have to install MSDeploy on each server but we do not have to mess with any configuration after that.&lt;/p&gt;    &lt;p&gt;2. We do not have to mess with setting up unc shares and deal with the mess.  It sounds like a silly thing but by getting away from the unc share we can also test our deployments from any machine and msdeploy is actually firewall friendly.  xcopy to a unc share is not firewall friendly which means that we cannot use it for all of our clients which means variations between our projects.  &lt;/p&gt;    &lt;p&gt;3. We use msdeploy as a mechanism to distribute our deployment packages and then remotely execute the packages.  This means I can have a single instance of our Continuous Integration server which reduces the number of places to maintain configuration.  That is a big win.  This also means the log files for all of the deployments can be tracked in a single place.&lt;/p&gt;    &lt;p&gt;4. Another benefit of using msdeploy to push our deployments means that I can easily setup new instances of a test configuration and push it to multiple servers without having to log into each machine.. This is good for efficiency.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt; Our use of MSDeploy now boils down to two steps.  Distribute and Execute.  We have some of our scripts in NAnt and we are in the process of migrating to PowerShell now that version 2.0 is available from the older operating systems.  Below is a sample of executing msdeploy from a NAnt script.&lt;/p&gt;  &lt;p&gt;Calling MsDeploy from Nant&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4912CCA3.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" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_19E0E10C.png" width="1028" height="249"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;dirPath&lt;/strong&gt;  command tells MSDeploy to synchronize a directory from the source computer a target computer. This is a pretty easy command to understand.&lt;/p&gt;  &lt;p&gt;The second command is the &lt;strong&gt;runCommand&lt;/strong&gt; this command was added between the RC and 1.0 release of MSDeploy and I am so happy they added it. The run command is told to execute a command on the remote machine.  Since we are running installation scripts, they do not execute instantly and as a result the waitInterval and waitAttempts need to be specified so that the command does not timeout before it has completed running. other than that the output of the console application is piped back to the source computer.  The one caveat about the run command is that when it starts it runs from the C:\windows\system32 directory.  In order to work around this issue I have found that passing the directory of the command into the batch file that I run allows my batch files to first cd to that directory as its first step.  This is a pretty harmless thing to do and works pretty well.&lt;/p&gt;  &lt;p&gt;This is what a sample deployment batch files looks like.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;cd %1     &lt;br&gt;rd ..\codeToDeploy\ /s /q      &lt;br&gt;applicationNamePackage.exe -o..\CodeToDeploy\ -y      &lt;br&gt;cd ..\CodeToDeploy\      &lt;br&gt;cmd /c %systemroot%\system32\inetsrv\appcmd stop site applicationName_dev      &lt;br&gt;iisreset      &lt;br&gt;call dev.bat      &lt;br&gt;cmd /c %systemroot%\system32\inetsrv\appcmd start site applicationName_dev&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is pretty basic and does some IIS commands as well.  &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I am sure I left some information out, but I wanted to get a brain dump of our use of MSDeploy.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Long term I would like to see the use of PowerShell driving msdeploy and adding some configuration around each Server Role in an application and tie it to the servers needed for each environment.  I have started a project to put this together called psTrami but I have not put any of the code together yet, just some small spikes to prove it out.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;More to come sometime soon…..&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Using+MSDeploy+to+automate+your+Enterprise+Application+remote+deployments.&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f06%2fusing-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f06%2fusing-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29992" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/_nfNP-Tnt7k" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257392710302"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:30035">tag:google.com,2005:reader/item/5cf45f03cde50755</id><category term="c#" scheme="http://www.lostechies.com/blogs/hex/archive/tags/c_2300_/default.aspx" /><category term=".Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx" /><category term="Open Source Software" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Open+Source+Software/default.aspx" /><category term="AutoMapper" scheme="http://www.lostechies.com/blogs/hex/archive/tags/AutoMapper/default.aspx" /><title type="html">Automapper Auto Profile Registration.</title><published>2009-11-05T03:24:15Z</published><updated>2009-11-05T03:24:15Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/yBJxCxOGC8Q/automapper-auto-profile-registration.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;On some of our projects we have been experimenting with smaller AutoMapper profiles.  The idea is that it is easier to digest a smaller profile. We have gone so far as creating a profile for each Domain object and handle all of the mappings to and from the domain object.  We are also trying out a Profile per scenario.  While these smaller profiles are easier to dig in and understand, the registration of them are a little painful.  So I put together a quick way to auto register all the profiles for automapper.  Below is the code to discover all the profiles in an assembly than register them with AutoMapper.  There is nothing fancy here and I could certainly spend more time making it better performing, but realistically this is startup code that runs once at application start up.  That being said I would rather focus performance optimization efforts on places that actually make a difference to the End User Experience. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here is the sample.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_1C949FF2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_344BD758.png" width="1028" height="337"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It is important to know that we have full code coverage over our application including integration tests, so that if something were to break as a result of loading this in a non deterministic order, we would know before we commit our changes to source control. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here is the code for the ForEach extension method, since I breezed over it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_322ED88F.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_3875AF1D.png" width="1028" height="169"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is a smaller post than I normally put together.. is this small of a post useful? &lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Automapper+Auto+Profile+Registration.&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fautomapper-auto-profile-registration.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fautomapper-auto-profile-registration.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30035" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/yBJxCxOGC8Q" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257273418498"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:29897">tag:google.com,2005:reader/item/eefe6be9362cd071</id><category term="Asp.Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx" /><category term=".Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx" /><category term="Asp.Net MVC" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx" /><category term="Portable Area" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Portable+Area/default.aspx" /><title type="html">ASP.Net MVC Portable Areas – Part 3</title><published>2009-11-03T17:00:00Z</published><updated>2009-11-03T17:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/AzYKPWLtz68/asp-net-mvc-portable-areas-part-3.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;h1&gt;Using a Portable Area&lt;/h1&gt;
&lt;p&gt;This is the third part in a series about using a Portable Area (PA) using MvcContrib.  This sample walks through the Host Application side of consuming the Login Portable area.  This example demonstrates how a portable area such as a login can send messages and recieve responses from the host application.  This allows the host application to control the core of the application and lets the Portable Area solve the User Interface portion of the Login.  While this is a pretty simple example it is important to look at the concept of what a Portable Area could solve.  A portable Area could just handling wiring up multiple user interface screens and deal with simple form validation while leaving a lot of from for the host application to control the parts that are important to the application.  Or a Portable Area could provide an entire self contained piece of functionality like a Blog engine, or mulit-instance forum.  There is a large spectrum for how much the Portable Area could provide.  This example focuses on an example where the Portable Area provides the UI and lets the host application own the domain logic.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;Part 1 – Introduction&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/02/asp-net-mvc-portable-areas-part-2.aspx"&gt;Part 2 – Sample Portable Area&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Part 3 – Using of a Portable Area  (this post) &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/04/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;Part 4 – Using an Inversion of Control Framework.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In order to use a Portable Area (PA), the following references need to be added to your MVC project: &lt;a href="http://www.mvccontrib.org"&gt;MvcContrib&lt;/a&gt; &amp;amp; the assembly of the Portable Area.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_77F3C39A.png"&gt;&lt;img height="218" width="244" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_3E70B3A3.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Wiring up the Portable Area to the application is done at startup.  Portable Areas use the message bus as a way to communicate between the PA and the application. The main method for integrating with a portable area is to register a Message Handler. The sample below demonstrates wiring up a LogAllMessagesObserver, LoginHandler, and a ForgotPassword Handler for the Login Portable Area.  &lt;/p&gt;
&lt;p&gt;The call to the InputBuilder.Bootstrap() is required to initialize the Embedded Resource view engine used by this Portable Area infrastructure.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_1D7D40FC.png"&gt;&lt;img height="289" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_14AD38B0.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Here is an example of an Observer message handler.  This handler simply logs the message to the debugger. This could be used to collect metrics about the system, or log messages to a loggin framework.  The idea of an observer is that it is looking at the base message and not modifying the state of the message.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_52C65361.png"&gt;&lt;img height="198" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2AB3A442.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The Login Message Handler receives the login request and than sets the result object which is part of the contract that is specified by the LoginPortableArea from Part 2.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_02A0F523.png"&gt;&lt;img height="290" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_210B360C.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this example the main logic for login is still in a authentication service.  The handler is just used to wire up the message and response of the portable area to the host applications domain services.  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Whats Next?&lt;/h2&gt;
&lt;p&gt;The constructor of the LoginHandler takes an IAuthenticationService as a dependency and my next post will walk through how an Inversion of Control container can be connected to the Bus to allow the framework of your choice to put your pieces together.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Areas+%e2%80%93+Part+3&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f03%2fasp-net-mvc-portable-areas-part-3.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f03%2fasp-net-mvc-portable-areas-part-3.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29897" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/AzYKPWLtz68" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257188015782"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:29877">tag:google.com,2005:reader/item/13744171c7ac60d0</id><category term="mvc" scheme="http://www.lostechies.com/blogs/hex/archive/tags/mvc/default.aspx" /><category term="mvccontrib" scheme="http://www.lostechies.com/blogs/hex/archive/tags/mvccontrib/default.aspx" /><category term="Asp.Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx" /><category term=".Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx" /><category term="Asp.Net MVC" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx" /><category term="Portable Area" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Portable+Area/default.aspx" /><title type="html">ASP.Net MVC Portable Areas – Part 2</title><published>2009-11-02T17:00:00Z</published><updated>2009-11-02T17:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/MPRIpzOSGRY/asp-net-mvc-portable-areas-part-2.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;h1&gt;Sample Portable Area&lt;/h1&gt;
&lt;p&gt;This is the second part in a series about creating a Portable Area (PA) using MvcContrib&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;Part 1 – Introduction&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Part 2 – Sample Portable Area (this post)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/03/asp-net-mvc-portable-areas-part-3.aspx"&gt;Part 3 – Usage of a Portable Area&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/04/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;Part 4 - IoC Framework Support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;To create a Portable Area, the first step is to create a separate class library project for the Portable Area.  The output assembly is the single file needed to add this functionality to applications which wish to consumer it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;The minimal references required for the Portable Area are shown below: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_39B36C13.png"&gt;&lt;img height="393" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_7C43078B.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;While DataAnnotations is not required to build a PA, using DataAnnotations for Model validation makes distribution of the PA very easy, since the MVC2 DefaultModelBinder supports the DataAnnotations validation out of the box. &lt;span&gt; &lt;/span&gt;If you choose a different validation framework than you would need to distribute those assemblies or possible IL Merge them into your PA.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt; &lt;/span&gt;&lt;span style="font-size:10.5pt"&gt;The sample PA in the MvcContrib project is a Login Portable Area, this is a pretty simple example, but demonstrates how a PA and application can integrate.&lt;span&gt;  &lt;/span&gt;This is also a piece of functionality that most applications need.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;&lt;span&gt; &lt;/span&gt;Below is the code listing and structure for the project.  It looks identical to a mulit-project ASP.Net MVC Area.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_27A72886.png"&gt;&lt;img height="385" width="318" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_0000AC5C.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;The first difference between creating a Portable Area and a standard area from the files perspective is how the Views are registered with the project. The views Build Action should be changed from content to an &lt;a href="http://msdn.microsoft.com/en-us/library/0c6xyb66.aspx"&gt;&lt;span style="color:#669966"&gt;Embedded Resource&lt;/span&gt;&lt;/a&gt;. This allows the views to be embedded into the output assembly so that they view folders and files to not have to be manually copied into each application that uses it.&lt;span&gt;  &lt;/span&gt;Instead a special view engine will pull these views out of the assembly at run time and render them the same way that a physical view would be rendered.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_585A3031.png"&gt;&lt;img height="365" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_7E4FE087.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;The second item that is needed to create a Portable Area is a specialized registration class for the that inherits from PortableAreaRegistration. This class provides an extended RegisterArea method that sends in the MVC AreaRegistrationContext and a IApplicationBus object to the method.  The IApplicationBus &lt;span&gt; &lt;/span&gt;is the mechanism&lt;span&gt;  &lt;/span&gt;that a Portable Area uses to send messages to the hosting application during. &lt;span&gt; &lt;/span&gt;The use of the bus during registration is not required, but it is available in case and specific start up logic is needed to correctly configure the Portable Area.  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;The last line of the method show how the Portable Area registers the embedded views with the view engine, using the call to the RegisterTheViewsInTheEmmeddedViewEngine method.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;An important caveat around the setup of the Registration class is to make sure that the Registration class is sitting in the same Namespace as the controllers and views.&lt;span&gt;  &lt;/span&gt;If the Namespaces do not match the views will not be able to be located. &lt;span&gt; &lt;/span&gt;Since the namespace for the Embedded Resource views cannot be specified declaratively they are created using the Assemblies Default Namespace and the folder structure that they are stored in.  So keeping all of these properties consistent will make everything work.  If you change the default namespace of the project, you will need to update the namespace of your registration and controller classes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_0998F4C5.png"&gt;&lt;img height="398" width="1028" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_68394F28.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;The first call in this registration method sends a message to the hosting application.  This is a contrived example but it demonstrates sending a tracing message that can be used by an observer message handler to log the registration activity.  This tracing can be useful since the Portable Areas use the built in MVC registration mechanism for auto discovery and there is not a lot of visibility into the built in registration process. This example shows how a message can be sent between the PA and the hosting application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_10F4B472.png"&gt;&lt;img height="335" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2C2D0D73.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;The LoginController demonstrates the functionality needed to handle displaying the login form and then handling the form post. There are two Actions in the controller, one to render a Login View and a second Action to process the form post and redirect the user on success or , in the case of a login failure, display the login error messages to the user.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_35A5CBE9.png"&gt;&lt;img height="428" width="1028" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2937A8C0.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;The message bus is the main mechanism for communicating between a portable area and the hosting application. &lt;span&gt;  &lt;/span&gt;This is a very simplistic mechanism that allows the Portable Areas to communicate with the hosting application in a synchronous manner. &lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;For some scenarios, like when the area should not implement its own database, the host application can own how the domain model is persisted in data storage and the Portable Area can worry about handling the multi-page user interface and other user interface concerns like validating simple data types.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;The messages that are passed to the Bus are shown below.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_38F73DC4.png"&gt;&lt;img height="172" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_29E05EEA.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;The LoginInput represents the data that is collected from the Login screen. It is using the built in &lt;span&gt; &lt;/span&gt;DataAnnotations attributes to handle the simple validation rules.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_7DC361F8.png"&gt;&lt;img height="220" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_484A9FD3.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:10.5pt"&gt;The result object is used to determine if the credentials were valid for the host application and are then used to either display the error message or redirect to a protected page. Since the LoginInputMessage is passed to the bus with a reference, the handlers in the host application can change the Result object&amp;#39;s state and the portable area can than access the Result and determine the correct logic to perform given that result.  The implementation for the handlers will be in the next post in this series.&lt;br&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_7C129624.png"&gt;&lt;img height="253" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_22747970.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.5pt"&gt;The Index view for the login uses the MvcContrib Input Builders to render a standard form to the page.  The use of the Input Builder allows an host application to override any of the html mark up using the Input Builder partials.  This means that the Portable Area and Input Builders play very nicely with each other.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4C0844A3.png"&gt;&lt;img height="203" width="1028" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_51E2E83C.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This is what the view looks like in a browser.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4912DFF0.png"&gt;&lt;img height="772" width="899" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_072BFAA2.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This is the validation errors that are handled by the Portable Area, using the MVC 2 default model binder.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_0A7D6C7D.png"&gt;&lt;img height="772" width="899" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_1D51F027.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This shows an error message that is passed back from the resulting application. Other rules could be applied as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_2B60B957.png"&gt;&lt;img height="772" width="899" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_57310D46.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This is the approach for creating a Portable Area (PA) using the MvcContrib Portable Area feature.  Let me know what you think about this approach, we tried to stay with the simplest approach that could possible work, and focused on making it easy to both develop and consume the Portable Areas.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Please leave your comments on what you think of the approach.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Areas+%e2%80%93+Part+2&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f02%2fasp-net-mvc-portable-areas-part-2.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f02%2fasp-net-mvc-portable-areas-part-2.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29877" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/MPRIpzOSGRY" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1257106796232"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:29649">tag:google.com,2005:reader/item/314cf2e57884daae</id><category term="mvc" scheme="http://www.lostechies.com/blogs/hex/archive/tags/mvc/default.aspx" /><category term="mvccontrib" scheme="http://www.lostechies.com/blogs/hex/archive/tags/mvccontrib/default.aspx" /><category term=".Net" scheme="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx" /><category term="Asp.Net MVC" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx" /><category term="OSS" scheme="http://www.lostechies.com/blogs/hex/archive/tags/OSS/default.aspx" /><category term="Open Source Software" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Open+Source+Software/default.aspx" /><title type="html">ASP.Net MVC Portable Areas via MvcContrib</title><published>2009-11-01T18:00:00Z</published><updated>2009-11-01T18:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/dvbhb7aVIhM/asp-net-mvc-portable-areas-via-mvccontrib.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;p&gt;This is a multi post series on ASP.Net MVC Portable Areas&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Part 1 – Introduction &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/02/asp-net-mvc-portable-areas-part-2.aspx"&gt;Part 2 – Sample Portable Area&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/03/asp-net-mvc-portable-areas-part-3.aspx"&gt;Part 3 – Usage of a Portable Area&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/04/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;Part 4 - IoC framework support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt; &lt;/h2&gt;
&lt;h2&gt;What is a Portable Area?&lt;/h2&gt;
&lt;p&gt;A Portable Area is a set of reusable multi page functionality can be dropped into an application to provide rich functionality without having to custom build functionality that is literally the same in every application. This could be considered a plug-in or add-in type of functionality.  The &lt;strong&gt;portable &lt;/strong&gt;portion of this approach is that the area can be distributed as a single assembly rather than an assembly and a host of other files, like views or other html assets that need to be managed and maintained over time.  By making a portable area totally self contained in a single assembly, this should allow for easier reuse and upgrades to the area.  The challenge for doing something like this has been how do you allow enough control over the User Interface by the application yet still allow the actual views to be packaged with the logic.&lt;/p&gt;
&lt;h2&gt;Why Now?&lt;/h2&gt;
&lt;p&gt;There has been some discussion in the past on the MvcContrib mailing list about creating an plug-in framework and plugins but I do not think we had enough of the pieces in place to do this properly.   I believe that with MVC 2 we have those missing pieces figured out.  The first enabler is the inclusion of Areas into the MVC 2 feature set. This includes having the Area and Controller namespace become part of the route data which is used both for Controller/Action selection but this also flows down to the selection of a view. The second enabler is some of the work that came out of MvcContrib and the Input Builders.  While implementing that feature we came up with a way to pull views from an assembly as an embedded resource.  This with the ability to override the default view engine in a way that allows an application developer to place their own version of a view in a folder so that they have the option to change the view to their needs was huge.  The last enabler really comes from what we have learned from all of the SOA greats and see how frameworks like nServiceBus and MassTransit have demonstrated that a messaging approach for integration can keep our concerns separated.&lt;/p&gt;
&lt;p&gt;The other why now is that my company, &lt;a href="http://www.headspring.com"&gt;Headspring&lt;/a&gt;, has found that in order to make our practice more successful, we need the ability to drop in some of the essentials for an application, we would prefer to do this in a binary form that is easy to upgrade and does not leave us with copy and pasted code between our various projects.  We would like to see that if we learn something from one project that we have the potential to apply those learning&amp;#39;s to projects that are still in flight. We all prefer that rather than waiting for the next project to start so that we can apply what we have learned to the new project.  This approach will be much better for us as developers and our client will benefit as well.  We could take the approach of working on this in a bubble but by putting this out for the community we can learn from every else and potentially help others in the process and raise the collective bar for the industry, in our own little way.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Logical View of a Portable Area&lt;/h2&gt;
&lt;p&gt;Below is a logic view of a Portable Area.  It shows how the &lt;span style="color:#80ff00"&gt;Green block&lt;/span&gt; is an application.  Inside the application the blocks in &lt;span style="color:#004080"&gt;dark blue&lt;/span&gt; are framework components in ASP.Net MVC 2 and MvcContrib.  These blocks provide some minimal framework support for registration view resolution and communication between the application and the portable area.  The light blue blocks represent code the developer create.  The code in the Portable Area is created by the Portable Area developer. The code in the application block is coded by… you guessed it. The application developer.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_176A60E0.png"&gt;&lt;img height="480" width="614" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_35686ED4.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Thanks for the Pictures but where is the code?&lt;/h2&gt;
&lt;p&gt;The code is currently available in the MvcContrib MVC 2 Branch.  You can get the latest binary from our (TeamCity/CodeBetter) build server here:  &lt;a href="http://teamcity.codebetter.com/guestAuth/repository/download/bt83/.lastSuccessful/MVCContrib.release.zip" title="http://teamcity.codebetter.com/guestAuth/repository/download/bt81/.lastPinned/MVCContrib.release.zip"&gt;http://teamcity.codebetter.com/guestAuth/repository/download/bt83/.lastSuccessful/MVCContrib.release.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is a sample application you can download here: &lt;a href="http://teamcity.codebetter.com/guestAuth/repository/download/bt83/.lastSuccessful/MVCContrib.Extras.release.zip" title="http://teamcity.codebetter.com/guestAuth/repository/download/bt83/.lastSuccessful/MVCContrib.Extras.release.zip"&gt;http://teamcity.codebetter.com/guestAuth/repository/download/bt83/.lastSuccessful/MVCContrib.Extras.release.zip&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;or from the code repository on GitHub:  &lt;a href="http://github.com/mvccontrib/MvcContrib/zipball/mvc2"&gt;Download the source as a zip&lt;/a&gt;.  or &lt;a href="http://github.com/mvccontrib/MvcContrib/tree/mvc2"&gt;Fork it on GitHub&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Areas+via+MvcContrib&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f01%2fasp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f01%2fasp-net-mvc-portable-areas-via-mvccontrib.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29649" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/dvbhb7aVIhM" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1256880245973"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:29468">tag:google.com,2005:reader/item/d4bef15eaa8e6834</id><category term="Community" scheme="http://www.lostechies.com/blogs/hex/archive/tags/Community/default.aspx" /><title type="html">What I have been up to.</title><published>2009-10-30T03:36:02Z</published><updated>2009-10-30T03:36:02Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/EricHexter/~3/SNQkchDyEOQ/what-i-have-been-up-to.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/hex/default.aspx" type="html">&lt;p&gt;I have been pretty busy over the last few weeks. I just wanted to document what I have been doing.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_6BC1E25E.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 10px 0px 0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" align="left" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_04517FAF.png" width="244" height="66"&gt;&lt;/a&gt; I co-presented a free Advanced ASP.Net MVC half day with Jeffrey Palermo in Austin.  We had a good group of people show up to the Austin Microsoft office.  As I was preparing and presenting the session, it has become very obvious how much &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4ED8BD89.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 10px 0px 0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" align="left" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_1555AD92.png" width="244" height="123"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I co-presented with &lt;a href="http://twitter.com/jacksonh"&gt;Jackson Harper&lt;/a&gt; from the Mono team at &lt;a href="http://monospace.us/"&gt;Monospace&lt;/a&gt; on Mono and the Web ASP .NET MVC, WebForms, Tools, and Servers.  In preparation for this session I took the code camp server, codebase and got it running with Mono on openSuse… yeah that Linux, That means that ASP.Net MVC, StructureMap, NHibernate, Automapper, Castle Validators, and MvcContrib all work on mono and are &lt;strong&gt;binary compatible&lt;/strong&gt;!  I was able to compile the application in Visual Studio and using the MonoVS plugin deploy a vm.  We also demonstrated ftping the bits to a Linode and Jackson showed how to get is all setup.  He even made a Virtual Appliance that when you start it up in vmware it will be running the application on the web server..  You can get the slides, link to the mono version of the source code, download the virtual appliance from the mini site that was setup for the talk. &lt;a href="http://MonoOnTheWeb.info"&gt;http://MonoOnTheWeb.info&lt;/a&gt; .  I thought it was pretty cool seeing all of this stuff work.  It was a great way to prove out that the application stack that Headspring uses can be deployed on a wide range of platforms which ultimately opens up our potential customer base.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_1B9C8420.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:0px 5px 0px 0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" align="left" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_141114B3.png" width="244" height="143"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;I had the chance to present &lt;strong&gt;Database Change Management&lt;/strong&gt; as the InnoTech conference.  It was pretty good to get out and see a group of people that I have not seen before.  I sometimes feel like I am in the Austin .Net bubble so while I presented some code samples in .Net using SQL server I really tried to present the information as being agnositc of you database platform.  Good development techniques can transcend technology and platforms.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=What+I+have+been+up+to.&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f10%2f29%2fwhat-i-have-been-up-to.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f10%2f29%2fwhat-i-have-been-up-to.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29468" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/EricHexter/~4/SNQkchDyEOQ" height="1" width="1"&gt;</summary><author><name>erichexter</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/erichexter"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/erichexter</id><title type="html">Eric Hexter</title><link rel="alternate" href="http://www.lostechies.com/blogs/hex/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1256737796660"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:28845">tag:google.com,2005:reader/item/13a8a8f609b87834</id><category term="ASP.NET MVC" /><title type="html">MVC Best Practices</title><published>2009-10-28T12:45:26Z</published><updated>2009-10-28T12:45:26Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/2TW4o4UVPoM/mvc-best-practices.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;Simone has a great post (as usual) on &lt;a href="http://codeclimber.net.nz/archive/2009/10/27/12-asp.net-mvc-best-practices.aspx"&gt;12 ASP.NET MVC Best Practices&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Controller:&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;1 - Delete the AccountController&lt;/p&gt;    &lt;p&gt;2 - Isolate controllers from the outside world&lt;/p&gt;    &lt;p&gt;3 - Use an IoC Container&lt;/p&gt;    &lt;p&gt;4 - So NO to “magic strings”&lt;/p&gt;    &lt;p&gt;5 - Build your own personal conventions&lt;/p&gt;    &lt;p&gt;6 - Pay attention to the verbs&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;7 – Domain Model != ViewModel&lt;/p&gt;    &lt;p&gt;8 – Use ActionFilters for “shared” data&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;View:&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;9 – NEVER use code-behind&lt;/p&gt;    &lt;p&gt;10 – Write HTML each time you can&lt;/p&gt;    &lt;p&gt;11 – If there is an if, write an HtmlHelper extension&lt;/p&gt;    &lt;p&gt;12 – Choose your ViewEngine carefully&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is a fantastic list, and of course I have my own additions/suggestions :)  First, I’m not a fan of action filters for shared data.  If we’re doing strongly-typed views, using action filters for shared data puts us back into the magic string land, where we have to either use inheritance in our ViewModels, or the dictionary part of ViewData.  I don’t like either approach, I’d &lt;a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/06/18/the-filter-viewdata-anti-pattern.aspx"&gt;rather go with something like RenderAction&lt;/a&gt; to truly enforce SRP in my ViewModels.  Not everyone appreciates the elegance of this approach, but I’m sure they’ll agree eventually.&lt;/p&gt;  &lt;p&gt;I also don’t like writing an HtmlHelper extension just because I have logic in the view.  For a half-decent view engine, it shouldn’t be that problematic to have view logic in the view.  HtmlHelper extensions enforce the Helper object anti-pattern – a bunch of procedural logic hanging off one static class.  Instead, we went the route of building intelligent input builders for input elements, and only really using HtmlHelper when we want to eliminate duplication between multiple views.  I see these constructs:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;HtmlHelper&lt;/li&gt;    &lt;li&gt;Partials&lt;/li&gt;    &lt;li&gt;Master Pages&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;All as means of eliminating duplication in our views, but not much more.  If there’s logic in a view, that’s fine by me as long as it’s not duplicated.  It’s not my fault that C# looks downright bizarre mixed in with HTML markup, but that’s what &lt;a href="http://sparkviewengine.com/"&gt;other view engines are for&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Finally, if there was an award for How Not to Design a Controller, the AccountController would be the runaway champ.  I still can’t imagine why it’s necessary, and the idea of &lt;a href="http://jeffreypalermo.com/blog/mvccontrib-working-on-portable-areas/"&gt;portable areas&lt;/a&gt; would be a better fit for its functionality than the Thing We Always Delete with Extreme Prejudice.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=MVC+Best+Practices&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f28%2fmvc-best-practices.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f28%2fmvc-best-practices.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=28845" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=2TW4o4UVPoM:G1F0GlxOeFw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=2TW4o4UVPoM:G1F0GlxOeFw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=2TW4o4UVPoM:G1F0GlxOeFw:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=2TW4o4UVPoM:G1F0GlxOeFw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=2TW4o4UVPoM:G1F0GlxOeFw:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/2TW4o4UVPoM" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><gr:likingUser>10858532925818297666</gr:likingUser><gr:likingUser>08832026451033386875</gr:likingUser><gr:likingUser>05262175539166201312</gr:likingUser><gr:likingUser>09390155518485026608</gr:likingUser><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1256701461194"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:28642">tag:google.com,2005:reader/item/63cfa6d4f802f744</id><category term="ASP.NET MVC" /><title type="html">MVC Web Testing Strategies – verifying content</title><published>2009-10-28T01:51:46Z</published><updated>2009-10-28T01:51:46Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/5zjJp2b46W8/mvc-web-testing-strategies-verifying-content.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;Some of the questions during the C4MVC presentation concerned how I liked to locate data displayed in the rendered HTML for validation purposes.  You have quite a few options for doing so, such as:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Traverse HTML directly through the DOM &lt;/li&gt;    &lt;li&gt;Using existing semantic HTML information &lt;/li&gt;    &lt;li&gt;Adding semantic HTML information &lt;/li&gt;    &lt;li&gt;Wrapping data with specific HTML &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’ll dismiss the first option immediately, it’s quite brittle to traverse only the DOM to locate data on a screen.  If I have to have intimate knowledge of the entire HTML document rendered, the test will become far too dependent on the layout on the screen.  If I decide to move information out of a table and into a definition list, my test will likely break.&lt;/p&gt;  &lt;p&gt;From there, I’m left with basically two options – semantic HTML, whether it’s existing or added, or wrapping each data piece with custom HTML.  In the presentation, two questions came up:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;When locating a piece of information in a row in a table, why not use something more meaningful, such as the underlying entity’s ID to tag the data? &lt;/li&gt;    &lt;li&gt;Again in the table, why not use semantic information on the row, instead of adding meaningless HTML? &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Before we look at the different ways to verify content, let’s first look at what we want to verify.&lt;/p&gt;  &lt;h3&gt;The original content&lt;/h3&gt;  &lt;p&gt;In the scenario I highlighted in the screencast, I walk though editing some information, then verifying that data was changed correctly.  I still have tests for controllers, repositories and so on, but I want a high level scenario-based test to make sure the entire pipeline is working as expected.  We try and pull the information out of the HTML content rendered, using some sort of UI testing tool.  Without modifying the content, here’s what we have to work with: &lt;/p&gt;  &lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;div &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;main&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;h2&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Products&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;h2&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;table&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;thead&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Details&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Name&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Manufacturer&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Price&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;thead&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;a &lt;/span&gt;&lt;span style="color:red"&gt;href&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;/Product/Edit/1&amp;quot;&amp;gt;&lt;/span&gt;Edit&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;a&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Insignia® - 26&amp;quot; Class / 720p / 60Hz / LCD HDTV DVD Combo&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Insignia&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;359.99&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;a &lt;/span&gt;&lt;span style="color:red"&gt;href&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;/Product/Edit/2&amp;quot;&amp;gt;&lt;/span&gt;Edit&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;a&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Insignia® - 19&amp;quot; Class / 720p / 60Hz / LCD HDTV&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Insignia&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;189.99&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;a &lt;/span&gt;&lt;span style="color:red"&gt;href&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;/Product/Edit/3&amp;quot;&amp;gt;&lt;/span&gt;Edit&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;a&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Dynex® - 15&amp;quot; Class / 720p / 60Hz / LCD HDTV&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Dynex&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;159.99&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;table&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;There’s more rendered than just this HTML, but this is the piece that really matters.  We have some semantic CSS information, the DIV with an ID of “main”, but that’s about it.  In our CSS, we style our tables based on an ID-Element selector, but we could have just have easily used a class name on the table.  I’d like to verify that the price on the first product was changed correctly, but how do I verify this?  How do I make sure that the value in that one cell is the new price?&lt;/p&gt;

&lt;h3&gt;Choosing a strategy&lt;/h3&gt;

&lt;p&gt;I don’t want false positives or false negatives.  I don’t want to look for just any table or any table cell in the markup, I want really the piece just around “359.99”.  A few options to do so include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Locating the outer DIV, finding the table, the first row, last cell, etc. &lt;/li&gt;

  &lt;li&gt;Apply a special class to the TD just where that price is shown &lt;/li&gt;

  &lt;li&gt;Add markup only around data-bound elements &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I first started doing UI testing, I assumed that I wanted to be as semantic and pure as possible, and not try to change my markup just for tests.  That idea lasted about an hour, and reality set in that in general, things not designed with testing in mind will be hard to test.  Hard to write tests, hard to maintain tests.&lt;/p&gt;

&lt;p&gt;My next idea was to add information as needed, perhaps a class name to an existing surrounding element that might double for styling.  But I’ve moved completely away from that strategy as well, as &lt;strong&gt;styling and UI testing are two different concerns that should not mix&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Why keep these concerns separate?  Frankly, because both concerns have two completely different reasons to change.  Styling and behavior (such as IDs added for jQuery) are about design and interaction.  UI testing is about verifying site behavior.  Mixing the two concerns means my tests are more likely to break because I’ve changed the design.  But design can change without behavior changing, so I don’t want to couple my tests to the visual design.  Coupling UI tests to the site design is like unit testing using only the reflection API.&lt;/p&gt;

&lt;p&gt;Instead, I’d rather couple my tests to something that better represents the view – and that would be the ViewModel.&lt;/p&gt;

&lt;h3&gt;Strongly-typed views, strongly-typed tests&lt;/h3&gt;

&lt;p&gt;We use strongly-typed views because using a dictionary just leads to brittleness and fear of change.  Strongly-typed views, along with the concept of the &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/10/23/our-opinions-on-the-asp-net-mvc-introducing-the-thunderdome-principle.aspx"&gt;Thunderdome Principle&lt;/a&gt;, let us move past the issues of broken views and broken model binding.  Instead of writing black-box tests against our UI, we can take advantage of the strongly-typed views, and modify our HTML rendered to get access to the rendered ViewModel.  If you look at views from the point of view of “how to render a ViewModel”, then your UI tests can now talk in the language of the ViewModel.&lt;/p&gt;

&lt;p&gt;But to help our UI tests out, we need to be able to locate information rendered from a ViewModel.  Looking at our original HTML, the most fool-proof, straightforward way to do this would be to add HTML as close to the rendered ViewModel as possible.  Let’s look at our view to see where this might be:&lt;/p&gt;

&lt;pre&gt;    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;h2&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Products&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;h2&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:blue"&gt;var &lt;/span&gt;products = Model; &lt;span style="background:#ffee62"&gt;%&amp;gt;
&lt;/span&gt;    
    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;table&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;thead&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Details&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Name&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Manufacturer&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Price&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;thead&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:blue"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue"&gt;var &lt;/span&gt;product &lt;span style="color:blue"&gt;in &lt;/span&gt;products) { &lt;span style="background:#ffee62"&gt;%&amp;gt;
&lt;/span&gt;            &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;Html.ActionLink(&lt;span style="color:#a31515"&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt;, &lt;span style="color:blue"&gt;new &lt;/span&gt;{ id = product.Id }) &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;product.Name &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;product.ManufacturerName &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;product.Price &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt; } &lt;span style="background:#ffee62"&gt;%&amp;gt;
&lt;/span&gt;        &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;table&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;So what’s the ideal spot here?  On the table?  The table body?  Row?  Cell?  These are all possible…and all coupled to the design of the UI, rather than the shape of the ViewModel.  Instead of coupling to the design of the HTML, we can instead change every spot where we render the ViewModel directly to have extra HTML used only for UI tests.  In the presentation, I move towards this model:&lt;/p&gt;

&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:blue"&gt;var &lt;/span&gt;i = 0; &lt;span style="background:#ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt; &lt;span style="color:blue"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue"&gt;var &lt;/span&gt;product &lt;span style="color:blue"&gt;in &lt;/span&gt;products) { &lt;span style="background:#ffee62"&gt;%&amp;gt;
&lt;/span&gt;    &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;Html.ActionLink(&lt;span style="color:#a31515"&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt;, &lt;span style="color:blue"&gt;new &lt;/span&gt;{ id = product.Id }) &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;Html.Span(m =&amp;gt; m.Name) &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;Html.Span(m =&amp;gt; m.ManufacturerName) &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;= &lt;/span&gt;Html.Span(m =&amp;gt; m.Price) &lt;span style="background:#ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="background:#ffee62"&gt;&amp;lt;%
&lt;/span&gt;    i++;
} &lt;span style="background:#ffee62"&gt;%&amp;gt;
&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;In practice, I’ll use a similar concept to the &lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/06/09/opinionated-input-builders-for-asp-net-mvc-using-partials-part-i.aspx"&gt;Opinionated Input Builders Eric highlighted a while back&lt;/a&gt;.  Instead of input elements, I’ll solely render at the core, span tags.  Here is the rendered HTML:&lt;/p&gt;

&lt;pre&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;div &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;main&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;h2&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Products&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;h2&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;table&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;thead&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Details&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Name&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Manufacturer&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Price&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;

            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;thead&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;a &lt;/span&gt;&lt;span style="color:red"&gt;href&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;/Product/Edit/1&amp;quot;&amp;gt;&lt;/span&gt;Edit&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;a&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_0__Name&amp;#39;&amp;gt;&lt;/span&gt;Insignia® - 26&amp;quot; Class / 720p / 60Hz / LCD HDTV DVD Combo&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_0__ManufacturerName&amp;#39;&amp;gt;&lt;/span&gt;Insignia&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_0__Price&amp;#39;&amp;gt;&lt;/span&gt;359.99&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;a &lt;/span&gt;&lt;span style="color:red"&gt;href&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;/Product/Edit/2&amp;quot;&amp;gt;&lt;/span&gt;Edit&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;a&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_1__Name&amp;#39;&amp;gt;&lt;/span&gt;Insignia® - 19&amp;quot; Class / 720p / 60Hz / LCD HDTV&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_1__ManufacturerName&amp;#39;&amp;gt;&lt;/span&gt;Insignia&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_1__Price&amp;#39;&amp;gt;&lt;/span&gt;189.99&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;a &lt;/span&gt;&lt;span style="color:red"&gt;href&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;quot;/Product/Edit/3&amp;quot;&amp;gt;&lt;/span&gt;Edit&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;a&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_2__Name&amp;#39;&amp;gt;&lt;/span&gt;Dynex® - 15&amp;quot; Class / 720p / 60Hz / LCD HDTV&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_2__ManufacturerName&amp;#39;&amp;gt;&lt;/span&gt;Dynex&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;span &lt;/span&gt;&lt;span style="color:red"&gt;id&lt;/span&gt;&lt;span style="color:blue"&gt;=&amp;#39;_2__Price&amp;#39;&amp;gt;&lt;/span&gt;159.99&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;span&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tbody&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;table&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Notice that each data-bound output is wrapped with a span tag – and a special span tag at that.  The span tag has a unique ID that represents the expression used to render that piece of data.  The first product name shown comes from the expression “m =&amp;gt; m[0].Name”.  Because I know the ViewModel used to render this view, I can use an expression combined with a UI testing tool to locate the rendering of any piece of information on the screen.&lt;/p&gt;

&lt;p&gt;The downside of this strategy is the amount of HTML added to the final document render.  But since we’ve separated HTML used for styling and behavior, and HTML rendered strictly for testing, we can put a switch in our application so that for environments not doing UI testing, the span tag isn’t ever rendered!  We can then get the best of both worlds – non-obtrusive JavaScript on top of semantic HTML, and flip a switch to be able to get to any piece of information on the rendered HTML.&lt;/p&gt;

&lt;p&gt;Because our UI tests also use the ViewModel types and expressions to locate the same rendered ViewModels that the views used to render, we no longer run into the issue where our UI tests become disconnected from the views rendered.  If we delete a property on our ViewModel, guess what, the UI test no longer compiles!&lt;/p&gt;

&lt;h3&gt;Wrapping it up&lt;/h3&gt;

&lt;p&gt;Developing a UI testing strategy isn’t the easiest thing in the world.  In our current project, I think we had three or four evolutions before we finally settled on a UI testing strategy we like.  And it’s still not perfect – we’re still looking at ways to make UI testing easy, expressive, and more valuable.  But gone are the days where a styling change broke our tests.  When our UI tests fail now, it’s more along the lines of a new required field, changing business rules and so on.&lt;/p&gt;

&lt;p&gt;I don’t like mixing styling and behavior with locating data-bound UI elements, simply because both have very different reasons for change.  But by taking advantage of our strongly-typed views in our UI tests, we can render the ViewModel in such a way that makes it dirt-simple to locate individual pieces of our ViewModel on the final rendered page.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=MVC+Web+Testing+Strategies+%e2%80%93+verifying+content&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f27%2fmvc-web-testing-strategies-verifying-content.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f27%2fmvc-web-testing-strategies-verifying-content.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=28642" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=5zjJp2b46W8:q1pOP63aXS8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=5zjJp2b46W8:q1pOP63aXS8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=5zjJp2b46W8:q1pOP63aXS8:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=5zjJp2b46W8:q1pOP63aXS8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=5zjJp2b46W8:q1pOP63aXS8:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/5zjJp2b46W8" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1256264818936"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:27601">tag:google.com,2005:reader/item/df936946a0f7d171</id><category term="ASP.NET MVC" /><title type="html">C4MVC UI Testing screencast posted</title><published>2009-10-23T01:37:41Z</published><updated>2009-10-23T01:37:41Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/h89Ok1SXwPc/c4mvc-ui-testing-screencast-posted.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;Yesterday the &lt;a href="http://www.c4mvc.net/"&gt;C4MVC&lt;/a&gt; guys hosted a screencast with me on UI testing ASP.NET MVC.  It was a lot of fun, but I actually forgot I was being videotaped (webcam’d?), so all those times I turned off my mic to catch a drink of water or cough uncontrollably are caught in glorious 370i.  Anyway, check out the video here:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px"&gt;&lt;div&gt;&lt;embed src="http://www.viddler.com/player/a4c23795//" width="437" height="370" allowScriptAccess="never" allowFullScreen="true" name="viddler_a4c23795/" wmode="transparent" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Unfortunately, I didn’t leave enough time for questions at the end, and I had some good ones from the audience.  You can also find the &lt;a href="http://grabbagoftimg.s3.amazonaws.com/uitesting-trunk.zip"&gt;complete code and slides here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Thanks again to the C4MVC guys for hosting me!  Since I didn’t have time to answer too many questions, feel free to ask them in the comments, or you can always use the Contact Me link.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=C4MVC+UI+Testing+screencast+posted&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f22%2fc4mvc-ui-testing-screencast-posted.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f22%2fc4mvc-ui-testing-screencast-posted.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=27601" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=h89Ok1SXwPc:BEv0cv5CO_I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=h89Ok1SXwPc:BEv0cv5CO_I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=h89Ok1SXwPc:BEv0cv5CO_I:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=h89Ok1SXwPc:BEv0cv5CO_I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=h89Ok1SXwPc:BEv0cv5CO_I:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/h89Ok1SXwPc" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><gr:likingUser>16935322041668034773</gr:likingUser><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1256136293140"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:27314">tag:google.com,2005:reader/item/5557b5fe004ce72c</id><category term="ASP.NET MVC" /><title type="html">C4MVC meeting on UI testing</title><published>2009-10-21T13:38:41Z</published><updated>2009-10-21T13:38:41Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/f_o-pmIlQnU/c4mvc-meeting-on-ui-testing.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;Today I’m showing giving a talk on UI testing MVC applications for the &lt;a href="http://www.c4mvc.net/"&gt;Community for MVC.Net folks&lt;/a&gt;.  Those that went to my presentations in Arkansas and Houston have seen this talk already, so they’re off the hook on this one.  I’ll be covering ways to create UI tests that don’t break when a butterfly flaps its wings in Japan, and how we can design our MVC applications for UI testability.&lt;/p&gt;  &lt;p&gt;The presentation is done via LiveMeeting, (&lt;a href="http://Meeting.c4mvc.net"&gt;http://Meeting.c4mvc.net&lt;/a&gt;), so make sure you’ve hit that link before the start time, which is 12:00 PM CST today.  For more details, check out the C4MVC site:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.c4mvc.net/" href="http://www.c4mvc.net/"&gt;http://www.c4mvc.net/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the WebForms world, it was quite difficult to create maintainable UI tests.  But in ASP.NET MVC, we have far more control over the HTML generated, allowing us to design our UI for testability.  It should be a good discussion, I’m looking forward to seeing everyone there!&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=C4MVC+meeting+on+UI+testing&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f21%2fc4mvc-meeting-on-ui-testing.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f21%2fc4mvc-meeting-on-ui-testing.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=27314" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=f_o-pmIlQnU:YKjZob_mMl4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=f_o-pmIlQnU:YKjZob_mMl4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=f_o-pmIlQnU:YKjZob_mMl4:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=f_o-pmIlQnU:YKjZob_mMl4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=f_o-pmIlQnU:YKjZob_mMl4:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/f_o-pmIlQnU" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><gr:likingUser>16935322041668034773</gr:likingUser><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1256100656366"><id gr:original-id="tag:blogger.com,1999:blog-362044577872949917.post-7806686725116252505">tag:google.com,2005:reader/item/886c3990b05fef81</id><category term="strategy" scheme="http://www.blogger.com/atom/ns#" /><category term="planning" scheme="http://www.blogger.com/atom/ns#" /><category term="innovation" scheme="http://www.blogger.com/atom/ns#" /><title type="html">Wharton on Dynamic Competitive Strategy</title><published>2009-10-21T01:51:00Z</published><updated>2009-10-21T01:51:00Z</updated><link rel="alternate" href="http://dustinwells.blogspot.com/2009/10/wharton-on-dynamic-competitive-strategy.html" type="text/html" /><summary xml:base="http://dustinwells.blogspot.com/" type="html">  &lt;p&gt;I just began reading a new book, “Wharton on Dynamic Competitive Strategy” by George S. Day and David J. Reibstein. I can appreciate different points of view and approaches because I use what I consider to be the best from each school of thought in order to form “right fit” approach for me. In this case, I have a strong opposition with strategic development methodologies presented in this book. While I am sure I will get value from these concepts, I have a strong bias against approaches that seem to be hyper-focused on competitors – what they are doing, anticipating their reactions, their next moves, etc. versus internal innovation and value innovation for clients.&lt;/p&gt;  &lt;p&gt;This book outlines 7 core areas of developing a “dynamic competitive strategy.” &lt;span&gt; &lt;/span&gt;Of the 7 core areas, 1 is focused on actual custom feedback and interaction – which could be considered one of the most important, 3 are focus on competitors and what they are doing or might do, 1 is focused on how public policy might impact your strategy, and 2 are focused on the actual company’s strategy and alternatives.&lt;/p&gt;  &lt;p&gt;I am a firm believer in being proactive in an approach to find and keep ones competitive advantage. To me this means paying less attention to what a competitor is doing or might do and focusing more on a client’s needs or unmet desires along with ways to create more value – or “value innovation”.&lt;/p&gt;  &lt;p&gt;While I will continue to explore this view point on creating a dynamic strategy because I believe there will be value that will help me shape my own approach, I am hesitant based on the initial experience with this book. It is possible that this approach to strategic planning does not apply to me, with a business in our current revenue range or vertical market. It seems like this might apply better to a commoditized industry.&lt;/p&gt;  &lt;p&gt;&lt;span&gt; &lt;/span&gt;I would like to believe that there is a common, core approach to strategic planning and value innovation that is agnostic to a company’s “age” in their lifecycle.&lt;/p&gt;  &lt;div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/362044577872949917-7806686725116252505?l=dustinwells.blogspot.com"&gt;&lt;/div&gt;</summary><author><name>noreply@blogger.com (Dustin Wells)</name></author><source gr:stream-id="feed/http://dustinwells.blogspot.com/feeds/posts/default?alt=rss"><id>tag:google.com,2005:reader/feed/http://dustinwells.blogspot.com/feeds/posts/default?alt=rss</id><title type="html">Dustin Wells</title><link rel="alternate" href="http://dustinwells.blogspot.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1255979419040"><id gr:original-id="http://jeffreypalermo.com/blog/free-asp-net-mvc-workshop-tomorrow/">tag:google.com,2005:reader/item/21bcf93ccf70c0c3</id><category term="Blog" scheme="http://jeffreypalermo.com/blog/" /><title type="html">Free ASP.NET MVC workshop tomorrow</title><published>2009-10-19T18:47:42Z</published><updated>2009-10-19T18:47:42Z</updated><link rel="alternate" href="http://jeffreypalermo.com/blog/free-asp-net-mvc-workshop-tomorrow/" type="text/html" /><summary xml:base="http://jeffreypalermo.com/" type="html">&lt;h4&gt;10/20/2009 - Advanced ASP.NET MVC for Enterprise Applications&lt;/h4&gt;  &lt;p&gt;Jeffrey Palermo and Eric Hexter are the instructors for an advanced MVC training at the Microsoft Technology Center. &lt;a href="http://www.headspringsystems.com/services/agile-training/workshop/"&gt;more&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;RSVP here: &lt;a href="http://www.headspringsystems.com/community/presentations/"&gt;http://www.headspringsystems.com/community/presentations/&lt;/a&gt;&lt;/p&gt;</summary><author><name>Jeffrey Palermo</name></author><source gr:stream-id="feed/http://jeffreypalermo.com/feed/"><id>tag:google.com,2005:reader/feed/http://jeffreypalermo.com/feed/</id><title type="html">Jeffrey Palermo (.com)</title><link rel="alternate" href="http://jeffreypalermo.com/" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1255968772113"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:26956">tag:google.com,2005:reader/item/c0c9923dbe6790d8</id><category term="TDD" /><title type="html">How not to implement a failing test</title><published>2009-10-19T13:45:30Z</published><updated>2009-10-19T13:45:30Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/Vq_MxSbNoJc/how-not-to-implement-a-failing-test.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;One of the first things I change in ReSharper, along with one of my biggest pet peeves is a failing test that fails because of something like this:&lt;/p&gt;  &lt;pre&gt;&lt;span style="color:blue"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af"&gt;CombinedStreetAddressResolver 
    &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;NullSafeValueResolver&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Address&lt;/span&gt;, &lt;span style="color:blue"&gt;string&lt;/span&gt;&amp;gt;
{
    &lt;span style="color:blue"&gt;protected override string &lt;/span&gt;ResolveCore(&lt;span style="color:#2b91af"&gt;Address &lt;/span&gt;model)
    {
        &lt;span style="color:blue"&gt;throw new &lt;/span&gt;&lt;span style="color:#2b91af"&gt;NotImplementedException&lt;/span&gt;();
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;In the Red-Green-Refactor progression, the Red of a failing test should come from an &lt;em&gt;assertion failure&lt;/em&gt; not a “my code is stupid” failure.  The Red part is intended to triangulate and calibrate your test, to make sure that your test can fail correctly.  A NotImplementedException won’t cause a meaningful failure, and only serves the purpose of getting your code to compile.&lt;/p&gt;

&lt;p&gt;Throwing exceptions means your assertions never get executed in RGR until you attempt to make a passing test, in which case you still haven’t proven your test to be correct.  If you don’t know that your test is correct, you have two points of failure: your test, and code under test.&lt;/p&gt;

&lt;p&gt;That’s why I’ve set ReSharper to return default values instead of throw exceptions.  I want meaningful failures from a valid test, otherwise I’m better off skipping the Red step altogether.&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=How+not+to+implement+a+failing+test&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f19%2fhow-not-to-implement-a-failing-test.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f19%2fhow-not-to-implement-a-failing-test.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=26956" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=Vq_MxSbNoJc:zhA98OqIv7I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=Vq_MxSbNoJc:zhA98OqIv7I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=Vq_MxSbNoJc:zhA98OqIv7I:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=Vq_MxSbNoJc:zhA98OqIv7I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=Vq_MxSbNoJc:zhA98OqIv7I:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/Vq_MxSbNoJc" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><gr:likingUser>06910811198236229876</gr:likingUser><gr:likingUser>00054107962405495615</gr:likingUser><gr:likingUser>05262175539166201312</gr:likingUser><gr:likingUser>14767510987917783559</gr:likingUser><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1255665856154"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:26581">tag:google.com,2005:reader/item/0cec023e6b092efb</id><category term="LINQ" /><title type="html">More missing LINQ operators</title><published>2009-10-16T03:19:55Z</published><updated>2009-10-16T03:19:55Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/RQGPoK31Bus/more-missing-linq-operators.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;Continuing an &lt;a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/06/07/some-improved-linq-operators.aspx"&gt;old post on missing LINQ operators&lt;/a&gt;, the wonders of extension methods allow us as developers to fill potential holes in LINQ operators.  Whether it’s a Zip method (now included in .NET 4.0), or better methods for IComparer-based operators, I find myself adding more and more helpful LINQ operators, I wish were already in the framework.&lt;/p&gt;  &lt;h3&gt;Alternate&lt;/h3&gt;  &lt;p&gt;Do you ever want to weave two collections together, like shuffling a deck of cards?  Well I know I do!  Suppose we have this collection:&lt;/p&gt;  &lt;p&gt;[1, 3, 5]&lt;/p&gt;  &lt;p&gt;And this collection:&lt;/p&gt;  &lt;p&gt;[2, 4, 6]&lt;/p&gt;  &lt;p&gt;I’d like to create new collection that is the alternating items from the first and second list:&lt;/p&gt;  &lt;p&gt;[1, 2, 3, 4, 5, 6]&lt;/p&gt;  &lt;p&gt;Here’s the code to do it:&lt;/p&gt;  &lt;pre&gt;&lt;span style="color:blue"&gt;public static &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; Alternate&amp;lt;TSource&amp;gt;(&lt;span style="color:blue"&gt;this &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; first, &lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; second)
{
    &lt;span style="color:blue"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af"&gt;IEnumerator&lt;/span&gt;&amp;lt;TSource&amp;gt; e1 = first.GetEnumerator())
    &lt;span style="color:blue"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af"&gt;IEnumerator&lt;/span&gt;&amp;lt;TSource&amp;gt; e2 = second.GetEnumerator())
        &lt;span style="color:blue"&gt;while &lt;/span&gt;(e1.MoveNext() &amp;amp;&amp;amp; e2.MoveNext())
        {
            &lt;span style="color:blue"&gt;yield return &lt;/span&gt;e1.Current;
            &lt;span style="color:blue"&gt;yield return &lt;/span&gt;e2.Current;
        }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Very simple, I iterate both enumerables at the same time, yielding the first, then second collection’s current item.  So how is this useful?  How about this action:&lt;/p&gt;

&lt;pre&gt;[&lt;span style="color:#2b91af"&gt;Test&lt;/span&gt;]
&lt;span style="color:blue"&gt;public void &lt;/span&gt;Word_play()
{
    &lt;span style="color:blue"&gt;var &lt;/span&gt;source = &lt;span style="color:blue"&gt;new&lt;/span&gt;[] {&lt;span style="color:#a31515"&gt;&amp;quot;The&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;quick&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;brown&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;fox&amp;quot;&lt;/span&gt;};

    &lt;span style="color:blue"&gt;var &lt;/span&gt;result = source.Alternate(Spaces()).Aggregate(&lt;span style="color:blue"&gt;string&lt;/span&gt;.Empty, (a, b) =&amp;gt; a + b);

    result.ShouldEqual(&lt;span style="color:#a31515"&gt;&amp;quot;The quick brown fox &amp;quot;&lt;/span&gt;);
}

&lt;span style="color:blue"&gt;private &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue"&gt;string&lt;/span&gt;&amp;gt; Spaces()
{
    &lt;span style="color:blue"&gt;while &lt;/span&gt;(&lt;span style="color:blue"&gt;true&lt;/span&gt;)
        &lt;span style="color:blue"&gt;yield return &lt;/span&gt;&lt;span style="color:#a31515"&gt;&amp;quot; &amp;quot;&lt;/span&gt;;
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;I cheated a little bit with an infinite sequence (the Spaces() method), but I found this method useful when I had to split, then reconstruct new sequences of strings.&lt;/p&gt;

&lt;h3&gt;Append&lt;/h3&gt;

&lt;p&gt;I really hate this syntax:&lt;/p&gt;

&lt;pre&gt;[&lt;span style="color:#2b91af"&gt;Test&lt;/span&gt;]
&lt;span style="color:blue"&gt;public void &lt;/span&gt;Bad_concat_method()
{
    &lt;span style="color:blue"&gt;var &lt;/span&gt;ints = &lt;span style="color:blue"&gt;new&lt;/span&gt;[] {1, 2, 3};

    &lt;span style="color:blue"&gt;var &lt;/span&gt;oneToFour = ints.Concat(&lt;span style="color:#2b91af"&gt;Enumerable&lt;/span&gt;.Repeat(4, 1));

    &lt;span style="color:#2b91af"&gt;CollectionAssert&lt;/span&gt;.AreEqual(&lt;span style="color:blue"&gt;new&lt;/span&gt;[] { 1, 2, 3, 4 }, oneToFour.ToArray());
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;I want to just stick an item on the end of an existing collection, but I have to use this arcane Enumerable.Repeat method to do so.  Instead, let’s create an operator that lets us tack an item on to the end of a collection:&lt;/p&gt;

&lt;pre&gt;&lt;span style="color:blue"&gt;public static &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; Append&amp;lt;TSource&amp;gt;(&lt;span style="color:blue"&gt;this &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; source, TSource element)
{
    &lt;span style="color:blue"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af"&gt;IEnumerator&lt;/span&gt;&amp;lt;TSource&amp;gt; e1 = source.GetEnumerator())
        &lt;span style="color:blue"&gt;while &lt;/span&gt;(e1.MoveNext())
            &lt;span style="color:blue"&gt;yield return &lt;/span&gt;e1.Current;

    &lt;span style="color:blue"&gt;yield return &lt;/span&gt;element;
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Now our code becomes much easier to understand:&lt;/p&gt;

&lt;pre&gt;[&lt;span style="color:#2b91af"&gt;Test&lt;/span&gt;]
&lt;span style="color:blue"&gt;public void &lt;/span&gt;Easier_concat_with_append()
{
    &lt;span style="color:blue"&gt;var &lt;/span&gt;ints = &lt;span style="color:blue"&gt;new&lt;/span&gt;[] {1, 2, 3};

    &lt;span style="color:blue"&gt;var &lt;/span&gt;oneToFour = ints.Append(4);

    &lt;span style="color:#2b91af"&gt;CollectionAssert&lt;/span&gt;.AreEqual(&lt;span style="color:blue"&gt;new&lt;/span&gt;[] { 1, 2, 3, 4 }, oneToFour.ToArray());
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;h3&gt;Prepend&lt;/h3&gt;

&lt;p&gt;Append wouldn’t be complete without the converse, Prepend, now would it?&lt;/p&gt;

&lt;pre&gt;&lt;span style="color:blue"&gt;public static &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; Prepend&amp;lt;TSource&amp;gt;(&lt;span style="color:blue"&gt;this &lt;/span&gt;&lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TSource&amp;gt; source, TSource element)
{
    &lt;span style="color:blue"&gt;yield return &lt;/span&gt;element;

    &lt;span style="color:blue"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af"&gt;IEnumerator&lt;/span&gt;&amp;lt;TSource&amp;gt; e1 = source.GetEnumerator())
        &lt;span style="color:blue"&gt;while &lt;/span&gt;(e1.MoveNext())
            &lt;span style="color:blue"&gt;yield return &lt;/span&gt;e1.Current;
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Now putting something on the beginning of a list is easier as well:&lt;/p&gt;

&lt;pre&gt;[&lt;span style="color:#2b91af"&gt;Test&lt;/span&gt;]
&lt;span style="color:blue"&gt;public void &lt;/span&gt;Easier_concat_with_prepend()
{
    &lt;span style="color:blue"&gt;var &lt;/span&gt;ints = &lt;span style="color:blue"&gt;new&lt;/span&gt;[] {1, 2, 3};

    &lt;span style="color:blue"&gt;var &lt;/span&gt;zeroToThree = ints.Prepend(0);

    &lt;span style="color:#2b91af"&gt;CollectionAssert&lt;/span&gt;.AreEqual(&lt;span style="color:blue"&gt;new&lt;/span&gt;[] { 0, 1, 2, 3 }, zeroToThree.ToArray());
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Much more readable.  I have a few more around replacing the IEqualityComparer&amp;lt;T&amp;gt; overloads, but those are a little bit more esoteric in their examples of crazy set-based logic.  What’s really cool about all these methods is they still allow all sorts of fun chaining, allowing me to create very terse chains of operations on lists, with what would have taken a bazillion cryptic for..each loops.  Cool stuff!&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=More+missing+LINQ+operators&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f15%2fmore-missing-linq-operators.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f15%2fmore-missing-linq-operators.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=26581" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=RQGPoK31Bus:3SJDeaTCgoQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=RQGPoK31Bus:3SJDeaTCgoQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=RQGPoK31Bus:3SJDeaTCgoQ:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=RQGPoK31Bus:3SJDeaTCgoQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=RQGPoK31Bus:3SJDeaTCgoQ:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/RQGPoK31Bus" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><gr:likingUser>09827590777010521523</gr:likingUser><gr:likingUser>13659463864430149651</gr:likingUser><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1255665856153"><id gr:original-id="ded273ab-9e87-4979-8222-e4e2e46f1b46:26576">tag:google.com,2005:reader/item/31fc2b8c1d9355f7</id><category term="Misc" /><title type="html">Thanks Arkansas!</title><published>2009-10-16T02:01:17Z</published><updated>2009-10-16T02:01:17Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/GrabBagOfT/~3/SDBzOyNeSuc/thanks-arkansas.aspx" type="text/html" /><summary xml:base="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="html">&lt;p&gt;This week I made the drive from Austin to Fort Smith and Springdale, Arkansas to speak at the &lt;a href="http://www.fsdnug.org/"&gt;Fort Smith DNUG&lt;/a&gt; and the &lt;a href="http://www.nwadnug.org/"&gt;Northwest Arkansas DNUG&lt;/a&gt; on UI testing ASP.NET MVC.  Although I showed tools such as WatiN and Gallio, I focused more on design for UI testability, and covered items such as:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Site navigation&lt;/li&gt;    &lt;li&gt;Filling out forms&lt;/li&gt;    &lt;li&gt;Verifying results&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We stepped through a working, but horribly fragile UI test, and walked through how we can put in a few design techniques to share knowledge between view design and the UI test.  Hopefully, my message of “ban test recorders” gets through to someone, as the UI test recorder is something that threw me off for years on creating maintainable UI tests.&lt;/p&gt;  &lt;p&gt;You can find the slides and code here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://grabbagoftimg.s3.amazonaws.com/uitesting-trunk.zip"&gt;Testing the last mile in ASP.NET MVC&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks to all the guys in Arkansas for the great conversations, and I hope to see everyone soon!  One parting shot from a trip to &lt;a href="http://www.arkansasstateparks.com/devilsden/"&gt;Devil’s Den&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/jimmy_5F00_bogard/DSC00219_5F00_0B8F93E7.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="DSC00219" border="0" alt="DSC00219" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/jimmy_5F00_bogard/DSC00219_5F00_thumb_5F00_259379D6.jpg" width="644" height="484"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My jeans were soaked up to my knees from that hike…&lt;/p&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Thanks+Arkansas!&amp;amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f15%2fthanks-arkansas.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f10%2f15%2fthanks-arkansas.aspx" border="0" alt="Kick It on DotNetKicks.com"&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=26576" width="1" height="1"&gt;&lt;div&gt;
&lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=SDBzOyNeSuc:rIllGfk1tLU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?d=yIl2AUoC8zA" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=SDBzOyNeSuc:rIllGfk1tLU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=SDBzOyNeSuc:rIllGfk1tLU:V_sGLiPBpWU" border="0"&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/GrabBagOfT?a=SDBzOyNeSuc:rIllGfk1tLU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/GrabBagOfT?i=SDBzOyNeSuc:rIllGfk1tLU:gIN9vFwOqvQ" border="0"&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/GrabBagOfT/~4/SDBzOyNeSuc" height="1" width="1"&gt;</summary><author><name>bogardj</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/GrabBagOfT"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/GrabBagOfT</id><title type="html">Jimmy Bogard</title><link rel="alternate" href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1255637758327"><id gr:original-id="http://mahendramavani.com/archive/2009/10/15/diwali-or-deepavali-the-grand-festival-of-india.aspx">tag:google.com,2005:reader/item/c8217aa07507520c</id><category term="Anouncement" /><title type="html">Diwali or Deepavali – The grand festival of India</title><published>2009-10-15T19:49:56Z</published><updated>2009-10-15T19:49:56Z</updated><link rel="alternate" href="http://mahendramavani.com/archive/2009/10/15/diwali-or-deepavali-the-grand-festival-of-india.aspx" type="text/html" /><summary xml:base="http://mahendramavani.com/Default.aspx" type="html">&lt;p&gt;As the month of October proceed, &lt;a href="http://en.wikipedia.org/wiki/Hinduism_by_country"&gt;1 billion  people&lt;/a&gt; from all around the world are busy preparing for their grand  festival; &lt;strong&gt;&lt;em&gt;The Diwali&lt;/em&gt;&lt;/strong&gt;. It’s bit of misfortune for some  of my friends here in America, that they have no idea about what 1 in every 6  person on the earth, is busy celebrating with. Why not to take this as  opportunity to tell them about social as well as spiritual significance behind  the festival? There is my 2 cents :)&lt;/p&gt;
Diwali, which is also known as Deepavali, is a festival of lights. These  light signifies enlightenment, joy of victory of Dharma(implies as truth or  good) over Adharma (implies as darkness, bad or evil). The day of festival also  mark end of year as per Vikram Samvat Calendar, one of the oldest calendar in  the history of man kind.(The Vikram Samvat was founded by the emperor &lt;a href="http://en.wikipedia.org/wiki/Vikramaditya"&gt;Vikramaditya&lt;/a&gt; of &lt;a href="http://en.wikipedia.org/wiki/Ujjain"&gt;Ujjain&lt;/a&gt;&lt;sup&gt;&lt;a href="http://en.wikipedia.org/wiki/Bikram_Samwat#cite_note-0"&gt;[1]&lt;/a&gt;&lt;/sup&gt;  following his victory over the &lt;a href="http://en.wikipedia.org/wiki/Saka"&gt;Sakas&lt;/a&gt; in 56 BC. More accurately,  this calendar is 56.7 years ahead (in count) of the solar calendar).
&lt;p&gt;Deepavali is Sanskrit word which means “row of light” (Deep means light and  Avali means row). It teach us to drive way darkness by spreading light of  knowledge. Spiritually, it is the day when Lord Ram returned to Ayodhya after  completing His 14 year of exile (referred as Vanvas in Indian literature) and  His victory over Ravana. Full of joy, people of Ayodhya welcomed their king by  lighting rows(avali) of lamps(deep) and hence the name Deepavali. Just as we  celebrate birth of oneself, Deepavali is for celebration of inner light which  outshines all darkness or ignorance and awakening us to know our true nature;  far far away from just physical existence.&lt;/p&gt;
&lt;p&gt; To celebrate the occasion, people light oil lamps in and around their house  and set off firecrackers. People paint and clean their homes, buy new clothes  and distribute sweets to their relatives and friends. By spreading light in  every corner of our premises, we try to destroy the reign of darkness, on the  night of Diwali. People decorate their premises with diyas, electric bulbs and  other decorative electric lighting fixtures, to make their surroundings filled  with colorful light and to make it bright and beautiful. Many interesting  rituals and traditions have been attached to the celebrations of Diwali. Fire  crackers are burst and people enjoy wearing new clothes, on the auspicious day.  &lt;/p&gt;
&lt;p&gt; Diwali is a five-day long festival, which is celebrated with fun and fervor.  &lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;first &lt;/strong&gt;day of Diwali is known as 'Dhanteras' which is the  thirteenth lunar day of Krishna Paksha, of the Hindu month of Kartik. Lord  Dhanwantari came out of the ocean with Ayurvedic on this day for the welfare of  the mankind. People renovate, decorate their houses on this day and make  traditional &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=rangoli"&gt;'Rangoli&lt;/a&gt;'  on the entrance, to welcome Goddess Lakshmi. Lamps  and candles are lit throughout the night. It is considered auspicious to buy  gold and silver on this day. Many people opt for buying new utensils on this  day.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;second&lt;/strong&gt; day of Diwali is &lt;strong&gt;Narak&lt;/strong&gt;  Chaturdashi.Lord Krishna killed the demon Narakasur on this day to make the  mankind free from his fear. It is a tradition to massage the body with oil and  to bathe on this day. According to an interesting saying it is believed that  those who do not bathe on this day go to the Narak (hell). &lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;third &lt;/strong&gt;day is the main day of the Diwali festival.On this  day, people wear new clothes and share gifts and sweets with their friends and  relatives. Women prepare delicacies and whole house is illuminated with 'diyas'  and candles. Fireworks and crackers are the kids' favorites on this day. This  day signifies end of year. &lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;forth&lt;/strong&gt; day is new year day (as per Vikram Samvat). Day  starts very early for all devotees as they get ready in their new cloths, visit  temple, chant to the GOD, and then wish each other “Sal Mubarak” (i.e. happy new  year) &lt;/p&gt;
&lt;p&gt;The fifth day of the diwali is Bhai Dooj, the time to honour the  brother-sister relationship. On this day, sisters invite their brothers and  their family to their homes and treat them with delicacies. In turn, brothers  offer them with gifts and sweets. Legends have it that in the Vedic era, Lord  Yamaraj (the God of death) visited his sister Yamuna on this day and blessed her  with a boon that if brothers visit their sisters on this day then they will be  liberated from all their sins. Since then it is a tradition that brothers visit  their sisters on this day and the sisters sweeten their mouths with variety of  sweets. The celebration of the Bhai Dooj marks the end of the five days long  festivities of Diwali. &lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For the benefit of my American brothers and sisters: &lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;US President Barack Obama has joined the this grand movement by participating  in ceremonial Diwali lamp at white house. Although it was Bush era back in 2003  when Diwali celebration began at white house, Obama was the first American  president who had fortunate opportunity to personally inaugurate the  ceremony.&lt;/p&gt;
&lt;p&gt;Finally, for the geeks in Austin, there is great opportunity to personally  attend the celebration and thereby know more about the festival. &lt;a href="http://www.barsanadham.org/e-list/twbd/images/divali/Diwali-09.jpg"&gt;Barsanadham&lt;/a&gt; temple is celebrating grand festival on this  Saturday, Oct, 17th 2009 beginning at 5:00 PM. Here is the published  schedule:&lt;/p&gt;
&lt;p&gt;5:00 pm Dinner prasad&lt;br&gt;
6:00 pm Temple tour (in prayer hall)&lt;br&gt;
7:00 pm  Temple tour (in prayer hall)&lt;br&gt;
7:30 pm Temple program – State Representatives  &amp;amp; community leaders lighting the dias ceremony, kirtan, pravachan,  arti&lt;br&gt;
9:00 pm Grand fireworks display&lt;br&gt;
9:30 pm Ras Garba – Live garba  singers: Sur Sangam of Hurst, TX &lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:bold"&gt;Address&lt;/span&gt;: Barsana Dham&lt;br&gt;
(SW of Austin on FM 1826, 7 miles from Hwy  290)&lt;br&gt;
400 Barsana Rd.&lt;br&gt;
Austin, TX 78737&lt;br&gt;
(512)288-7180&lt;/p&gt;
&lt;p&gt; I am there along with my friends and family.  Be there and be part of “The  Light”.&lt;/p&gt;&lt;img src="http://mahendramavani.com/aggbug/13.aspx" width="1" height="1"&gt;</summary><author><name>Mahendra Mavani</name></author><source gr:stream-id="feed/http://mahendramavani.com/Rss.aspx"><id>tag:google.com,2005:reader/feed/http://mahendramavani.com/Rss.aspx</id><title type="html">Mahendra Mavani&amp;#39;s # Corner</title><link rel="alternate" href="http://mahendramavani.com/Default.aspx" type="text/html" /></source></entry><entry gr:crawl-timestamp-msec="1255450142232"><id gr:original-id="http://jeffreypalermo.com/blog/response-quot-agile-is-treating-the-symptoms-not-the-disease-quot-by-ted-neward/">tag:google.com,2005:reader/item/55a68785502210e8</id><category term="Blog" scheme="http://jeffreypalermo.com/blog/" /><title type="html">Response: "Agile is treating the symptoms, not the disease" by Ted Neward</title><published>2009-10-13T16:00:41Z</published><updated>2009-10-13T16:00:41Z</updated><link rel="alternate" href="http://jeffreypalermo.com/blog/response-quot-agile-is-treating-the-symptoms-not-the-disease-quot-by-ted-neward/" type="text/html" /><summary xml:base="http://jeffreypalermo.com/" type="html">&lt;p&gt;&lt;a href="http://blogs.tedneward.com/2009/10/12/quotAgile+Is+Treating+The+Symptoms+Not+The+Diseasequot.aspx"&gt;Ted Neward&lt;/a&gt;, whom I’ve known for about 4 years now, &lt;a href="http://blogs.tedneward.com/2009/10/12/quotAgile+Is+Treating+The+Symptoms+Not+The+Diseasequot.aspx"&gt;wrote a piece&lt;/a&gt; calling out all the complexity that is in the line of business software space these days.&lt;/p&gt;  &lt;p&gt;This post is not to say that I agree or disagree, but it is a refreshing blog post to read.  I love discussion like this.  As the CTO of a &lt;a href="http://headspring.com"&gt;consulting company&lt;/a&gt; that embraces Extreme Programming for project delivery, I’m continually trying to get better at delivering high-quality, maintainable software. &lt;/p&gt;  &lt;p&gt;When reflecting on what Ted calls out that is necessary for my people to know, I’ll quickly add to the list:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;· 7zip&lt;/li&gt;    &lt;li&gt;· aspnetmvc&lt;/li&gt;    &lt;li&gt;· AutoMapper&lt;/li&gt;    &lt;li&gt;· cassini&lt;/li&gt;    &lt;li&gt;· castle&lt;/li&gt;    &lt;li&gt;· CruiseControl.NET&lt;/li&gt;    &lt;li&gt;· exceptioneer&lt;/li&gt;    &lt;li&gt;· FxCop&lt;/li&gt;    &lt;li&gt;· gallio&lt;/li&gt;    &lt;li&gt;· msdeploy&lt;/li&gt;    &lt;li&gt;· mvccontrib&lt;/li&gt;    &lt;li&gt;· naak&lt;/li&gt;    &lt;li&gt;· nant&lt;/li&gt;    &lt;li&gt;· nantcontrib-0.85&lt;/li&gt;    &lt;li&gt;· nbehave&lt;/li&gt;    &lt;li&gt;· ncover&lt;/li&gt;    &lt;li&gt;· ndepend&lt;/li&gt;    &lt;li&gt;· nhibernate&lt;/li&gt;    &lt;li&gt;· nunit&lt;/li&gt;    &lt;li&gt;· rhinomocks&lt;/li&gt;    &lt;li&gt;· SourceMonitor&lt;/li&gt;    &lt;li&gt;· structuremap&lt;/li&gt;    &lt;li&gt;· subversion&lt;/li&gt;    &lt;li&gt;· tarantino&lt;/li&gt;    &lt;li&gt;· watin&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The funny thing is, we are building tools to make delivering software &lt;strong&gt;easier, &lt;/strong&gt;so we have other things added to the .Net framework.  At some point, Microsoft and Oracle need to take a good look at .Net and Java and see how they can raise the abstraction level a bit so that the technical business analyst can have a hope of a small program.&lt;/p&gt;  &lt;p&gt;Just like DRM in the music business has found (&amp;gt;80% of music pirates could not be forced to pay for the music), &amp;gt;80% of technical business analysts will not use .Net or Java for their small little app.  They will walk away and not write the app.  They will instead add just a few more macros to that huge Excel spreadsheet.&lt;/p&gt;</summary><author><name>Jeffrey Palermo</name></author><source gr:stream-id="feed/http://jeffreypalermo.com/feed/"><id>tag:google.com,2005:reader/feed/http://jeffreypalermo.com/feed/</id><title type="html">Jeffrey Palermo (.com)</title><link rel="alternate" href="http://jeffreypalermo.com/" type="text/html" /></source></entry></feed>
