<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chuck Conway</title>
	<atom:link href="http://www.chuckconway.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.chuckconway.com</link>
	<description>Will code C# for food!</description>
	<lastBuildDate>Thu, 10 May 2012 14:50:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Deploying with MsDeploy Outside of Visual Studio</title>
		<link>http://www.chuckconway.com/?p=364</link>
		<comments>http://www.chuckconway.com/?p=364#comments</comments>
		<pubDate>Thu, 10 May 2012 14:41:13 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Build]]></category>
		<category><![CDATA[MSBUILD]]></category>
		<category><![CDATA[MsDeploy]]></category>
		<category><![CDATA[robocopy]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=364</guid>
		<description><![CDATA[Building the msdeploy package with MSBuild. This requires MsDeploy to be installed on the build machine. MSBUILD /T:Package /P:Configuration=QA;PackageLocation="C:\BuildArtifacts\eserve\DEV\QA\QA.zip" Deploying the package with MsDeploy to a web site How to get the msdeploy command. -source:package='C:\BuildArtifacts\eserve\DEV\QA\QA.zip' -dest:auto,ComputerName='https://eserve-dev.sacda.org:8172/MsDeploy.axd?site=eserve-dev',UserName='conwayc',Password='austin_1',IncludeAcls='False',AuthType='Basic' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension &#8230; <a href="http://www.chuckconway.com/?p=364">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Building the msdeploy package with MSBuild.</strong></p>
<p>This requires MsDeploy to be <a href="http://www.iis.net/download/webdeploy">installed</a> on the build machine.</p>
<p><code>MSBUILD /T:Package /P:Configuration=QA;PackageLocation="C:\BuildArtifacts\eserve\DEV\QA\QA.zip"</code></p>
<p><strong>Deploying the package with MsDeploy to a web site</strong></p>
<p>How to get the <a href="http://root-project.org/work/net/automated-web-deployment-with-msbuild-and-msdeploy/">msdeploy command</a>.</p>
<p><code>-source:package='C:\BuildArtifacts\eserve\DEV\QA\QA.zip' -dest:auto,ComputerName='https://eserve-dev.sacda.org:8172/MsDeploy.axd?site=eserve-dev',UserName='conwayc',Password='austin_1',IncludeAcls='False',AuthType='Basic'<br />
-verb:sync<br />
-disableLink:AppPoolExtension<br />
-disableLink:ContentExtension<br />
-disableLink:CertificateExtension<br />
-allowUntrusted<br />
-retryAttempts=2</code></p>
<p><strong>Copying the package with ROBOCOPY</strong></p>
<p>Copying the package to another folder with robocopy has an issue. Robocopy uses exit codes as success/error codes. CI servers look at the exit code of a command to determine success or failure. Robocopy breaks this model. Luckliy the sql team posted a code snippet to get around this issue.</p>
<p><code>rem http://weblogs.sqlteam.com/robv/archive/2010/02/17/61106.aspx<br />
robocopy %*<br />
rem suppress successful robocopy exit statuses, only report genuine errors (bitmask 16 and 8 settings)<br />
set/A errlev="%ERRORLEVEL% &#038; 24"<br />
rem exit batch file with errorlevel so SQL job can succeed or fail appropriately<br />
exit/B %errlev%</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=364</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desktop Windows Manager consuming high CPU on Windows 8</title>
		<link>http://www.chuckconway.com/?p=360</link>
		<comments>http://www.chuckconway.com/?p=360#comments</comments>
		<pubDate>Fri, 04 May 2012 04:06:35 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[desktop windows manager]]></category>
		<category><![CDATA[high cpu usage]]></category>
		<category><![CDATA[windows 8]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=360</guid>
		<description><![CDATA[I don&#8217;t know what caused it, but my video on Windows 8 became slow and jerky. Videos would not play. Desktop Windows Manager was consuming 20 to 25 percent of CPU (an entire core, I have a quad core machine). &#8230; <a href="http://www.chuckconway.com/?p=360">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know what caused it, but my video on Windows 8 became slow and jerky. Videos would not play. Desktop Windows Manager was consuming 20 to 25 percent of CPU (an entire core, I have a quad core machine). I killed Aero and rebooted my machine. Nothing worked.   I have a dual monitor setup. When I uninstalled the video driver I lost the second monitor, but the video was normal again. I re installed the video driver and so far its working. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=360</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightweight jQuery Mobile validation plugin</title>
		<link>http://www.chuckconway.com/?p=356</link>
		<comments>http://www.chuckconway.com/?p=356#comments</comments>
		<pubDate>Thu, 26 Apr 2012 21:12:45 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery mobile]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=356</guid>
		<description><![CDATA[Recently I needed a validation plugin for jQuery Mobile. I tried the existing plugins, but I could not get them to work. I quickly wrote one that served my purpose. It&#8217;s very simple. Currently it only supports required fields. I &#8230; <a href="http://www.chuckconway.com/?p=356">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I needed a validation plugin for jQuery Mobile. I tried the existing plugins, but I could not get them to work. I quickly wrote one that served my purpose. It&#8217;s very simple. Currently it only supports required fields. I looked into expanding it, but have not needed it. Please use it however you see fit. </p>
<p>Usage:</p>
<pre class="brush: js;">
 $("form#loginForm").validate();
</pre>
<p><strong>Plugin:</strong></p>
<pre class="brush: js;">
(function ($) {

    $.fn.validate = function () {
        var items = $(this).find('[class~="required"]');

        var isValid = true;

        items.each(function () {
            var self = $(this);

            self.blur(function () {
                var field = $(this);

                if (field.val().length == 0) {

                    isValid = false;

                    var siblings = field.siblings('label[class~="field-validation-invalid"]');

                    if (siblings.length == 0) {
                        var error = $('<label>')
                            .addClass('field-validation-invalid field-validation-error')
                            .text('This field is required');
                        field.after(error);
                    }
                } else {

                    var errorMessage = field.siblings('label[class~="field-validation-invalid"]').get(0);
                    errorMessage = $(errorMessage);
                    errorMessage.remove();
                    errorMessage.text('');
                }

            });
        });

        var buttons = $(this).find('[type="submit"]');

        buttons.each(function () {
            var button = $(this);

            button.click(function () {

                //reset the value, otherwise it's stuck in false mode forever.
                isValid = true;

                items.each(function () {
                    var self = $(this);

                    self.blur();
                });

                if (!isValid) {

                    return false;
                }
            });
        });

    };
})(jQuery);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=356</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Contracts in Visual Studio Beta 11</title>
		<link>http://www.chuckconway.com/?p=315</link>
		<comments>http://www.chuckconway.com/?p=315#comments</comments>
		<pubDate>Thu, 22 Mar 2012 07:55:19 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[Visual Studio 2012]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=315</guid>
		<description><![CDATA[Download and install the code contract msi. Code contracts will be installed on your machine, but you&#8217;ll notice that Visual Studio beta 11 does not see them. You&#8217;ll need to run the Visual Studio beta 11 installer and &#8220;Repair&#8221; the &#8230; <a href="http://www.chuckconway.com/?p=315">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/devlabs/dd491992">Download</a> and install the code contract msi.</p>
<p>Code contracts will be installed on your machine, but you&#8217;ll notice that Visual Studio beta 11 does not see them. You&#8217;ll need to run the Visual Studio beta 11 installer and &#8220;Repair&#8221; the install.</p>
<p><a href="http://www.chuckconway.com/wp-content/uploads/2012/03/Capture.png"><img src="http://www.chuckconway.com/wp-content/uploads/2012/03/Capture-300x269.png" alt="" title="Capture" width="300" height="269" class="alignnone size-medium wp-image-340" /></a></p>
<p>Another snag that might be encountered if you have Resharper installed is &#8220;JetBrains.ReSharper.TaskRunner.CLR4.MSIL.exe &#8211; Precondition failed.&#8221; Enabling the Contract Reference Assembly will resolve the issue. You&#8217;ll notice once this is enabled a folder called &#8220;CodeContracts&#8221; in the bin/debug directory.</p>
<p><a href="http://www.chuckconway.com/wp-content/uploads/2012/03/Capture1.png"><img src="http://www.chuckconway.com/wp-content/uploads/2012/03/Capture1-300x260.png" alt="" title="Capture" width="300" height="260" class="alignnone size-medium wp-image-341" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=315</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 8</title>
		<link>http://www.chuckconway.com/?p=323</link>
		<comments>http://www.chuckconway.com/?p=323#comments</comments>
		<pubDate>Tue, 13 Mar 2012 05:22:00 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Experience]]></category>
		<category><![CDATA[Windows 8 Consumer Preview]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=323</guid>
		<description><![CDATA[I&#8217;m lost. My start globe is missing. The install screen is a fish with bubbles. No indication of progress. I wait and wait and wait. I press the num-lock key to ensure the computer has not frozen. Not frozen. Hump. &#8230; <a href="http://www.chuckconway.com/?p=323">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m lost. My start globe is missing.</p>
<p>The install screen is a fish with bubbles. No indication of progress. I wait and wait and wait. I press the num-lock key to ensure the computer has not frozen. Not frozen. Hump. I&#8217;ll wait some more.</p>
<p><a href="http://www.chuckconway.com/wp-content/uploads/2012/03/beta.png"><img class="alignnone size-full wp-image-324" title="beta" src="http://www.chuckconway.com/wp-content/uploads/2012/03/beta.png" alt="" width="204" height="191" /></a></p>
<p>After a couple minutes the the install screen came up. The ensuing install experience is virtually the same as Windows 7.</p>
<h2>Start Menu</h3>
<p>It&#8217;s a new beast. The old one is history.</p>
<p><a href="http://www.chuckconway.com/wp-content/uploads/2012/03/start.png"><img src="http://www.chuckconway.com/wp-content/uploads/2012/03/start-300x188.png" alt="" title="start" width="300" height="188" class="alignnone size-medium wp-image-327" /></a></p>
<h2>Task Manager</h2>
<p>Much hype has been around the task manager. It&#8217;s gotten it&#8217;s first makeover. Most will find it easier to read.</p>
<p><a href="http://www.chuckconway.com/wp-content/uploads/2012/03/task.png"><img src="http://www.chuckconway.com/wp-content/uploads/2012/03/task-300x236.png" alt="" title="task" width="300" height="236" class="alignnone size-medium wp-image-329" /></a></p>
<h2>Hot Keys</h3>
<p>Microsoft has trimmed the fat from Windows. Sometimes in places that need a little fat. For example, the shutdown button is hard to find. Below are hot keys that will help navigate through Windows 8.</p>
<p><strong>Win + I</strong> &#8211; Open Desktop Settings (including shutdown)<br />
<strong>Win + W</strong> &#8211; Show Tablet settings.<br />
<strong>Win + F4</strong> &#8211; Kills the application.<br />
<strong>Win + Tab</strong> &#8211; Cycles through tablet apps<br />
<strong>Alt + Tab</strong> &#8211; Cycles through all the applications<br />
<strong>Win + E</strong> &#8211; Opens the explorer window<br />
<strong>Win + D </strong>- Hides all open windows</p>
<p>Check out <a href="http://www.addictivetips.com/windows-tips/30-new-hotkeys-for-windows-8/">30 New HotKeys For Windows 8</a></p>
<h2>Conclusion</h2>
<p>All in all Windows 8 is a refreshing perspective on the Windows OS. It takes tablet concepts and tastefully melds them into a desktop environment. I am optimistic that Windows 8 will be a good operating system. Overall it&#8217;s a refinement of Windows 7. It&#8217;s preparing us for the next step: Windows 9. I&#8217;m on the edge of my seating in anticipation of Windows 9.</p>
<p>Windows 8 is a faster and smaller version of Windows 7. So much so, that I am not upgrading my hardware. Will Windows 8 have widespread adoption? No, most will stick with Windows 7. I&#8217;m saying this now. Windows 7 was the last truly desktop operating system. </p>
<p>Windows 7 is the Windows XP of this decade.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=323</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Impressions of Visual Studio 2012</title>
		<link>http://www.chuckconway.com/?p=306</link>
		<comments>http://www.chuckconway.com/?p=306#comments</comments>
		<pubDate>Sun, 11 Mar 2012 00:10:24 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Experience]]></category>
		<category><![CDATA[Visual Studio 2012]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=306</guid>
		<description><![CDATA[My first impression of Visual Studio 2012 is one of greyness&#8230; First Impression Fast start-up the project icon is easy to read the solution and class explorer are merged active tab and inactive tab are easily distinguishable]]></description>
			<content:encoded><![CDATA[<p>My first impression of Visual Studio 2012 is one of greyness&#8230;</p>
<p><a href="http://www.chuckconway.com/wp-content/uploads/2012/03/VisualStudioLogo2012.png"><img src="http://www.chuckconway.com/wp-content/uploads/2012/03/VisualStudioLogo2012.png" alt="" title="VisualStudioLogo2012" width="460" height="519" class="alignnone size-full wp-image-317" /></a></p>
<p><strong>First Impression</strong></p>
<ul>
<li>Fast start-up</li>
<li>the project icon is easy to read</li>
<li>the solution and class explorer are merged</li>
<li>active tab and inactive tab are easily distinguishable</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=306</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All UTC times are not necessarily the same</title>
		<link>http://www.chuckconway.com/?p=307</link>
		<comments>http://www.chuckconway.com/?p=307#comments</comments>
		<pubDate>Fri, 20 Jan 2012 16:12:24 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Data]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=307</guid>
		<description><![CDATA[A friend pointed out that all UTC Time is not the same. When he told me, I responded with &#8220;What!?! What are you talking about? It&#8217;s the same.&#8221; &#8220;No it&#8217;s not&#8221; he said. He explained, that yes using UTC will &#8230; <a href="http://www.chuckconway.com/?p=307">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A friend pointed out that all UTC Time is not the same. When he told me, I responded with &#8220;What!?! What are you talking about? It&#8217;s the same.&#8221; &#8220;No it&#8217;s not&#8221; he said. He explained, that yes using UTC will allot you an agreed upon time format but that does not guarantee that both server&#8217;s clocks are synchronized.  </p>
<p>For example, Sever A calls server B for updates. Both Servers use UTC Time. Server A sends over a timestamp, how do we know that the two servers clocks are synchronized and that the two times match, we don&#8217;t. The odds are they are not. How can they be? Absolute time does not exist. It&#8217;s all relative. By using a timestamp to retrieve data from another server you are making an assumption that both servers have the same time.</p>
<p><img src="http://farm4.staticflickr.com/3214/2283676770_6b53f8b77f.jpg" alt="" /></p>
<p>*<a href="http://www.flickr.com/photos/tonivc/2283676770/">photo reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=307</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick and Dirty on Migrating Data</title>
		<link>http://www.chuckconway.com/?p=301</link>
		<comments>http://www.chuckconway.com/?p=301#comments</comments>
		<pubDate>Thu, 22 Dec 2011 06:00:25 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[data]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=301</guid>
		<description><![CDATA[I had a great talk with my friend Dave today. He’s a Data Scientist. He knows his stuff, for sure. We talked about a number of things, but one that really stuck out was data migration. He says never to &#8230; <a href="http://www.chuckconway.com/?p=301">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a great talk with my friend <a href="http://theseldonvault.blogspot.com/">Dave</a> today. He’s a Data Scientist. He knows his stuff, for sure.</p>
<p>We talked about a number of things, but one that really stuck out was data migration. He says never to migrate via code, use a tool. You are reinventing the wheel. You are locked into your solution. All the risk is in your court. And the solution is not flexible. With that said. He went on to say the most efficient way to move data is with a primary key and a hash.</p>
<p>The destination side will request all the primary key and row hash. Taking the primary key it will check if the row exists. If it does exist it will compare the hash of the source to the hash of the destination row. If they match then the process is repeated for the next row. If they don’t match, then the primary key is added to a list of rows to request from the source. If the primary key does not exist then the primary key is added to the list of rows to be retrieved from the source. When the row comparison is completed all the rows that are stale or do not exist are requested from the source and persisted to the destination.</p>
<p><img src="http://farm3.staticflickr.com/2422/4037375985_576d1af052.jpg" alt="Grunt" /></p>
<p>If you enjoy grunt work you’ll do the above. If you are a developer who enjoys building robust applications you&#8217;ll leave the grunt work to the tools.</p>
<p>*<a href="http://www.flickr.com/photos/torley/4037375985/">Image reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=301</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding the Problem</title>
		<link>http://www.chuckconway.com/?p=294</link>
		<comments>http://www.chuckconway.com/?p=294#comments</comments>
		<pubDate>Tue, 22 Nov 2011 21:31:28 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Lesson Learned]]></category>
		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=294</guid>
		<description><![CDATA[A recent discussion at work got me thinking… A bug was reported in one of our products. A co-worker was tasked with finding and fixing the problem. His approach was to deploy new code from development into qa. The reasoning &#8230; <a href="http://www.chuckconway.com/?p=294">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A recent discussion at work got me thinking…</p>
<p>A bug was reported in one of our products. A co-worker was tasked with finding and fixing the problem. His approach was to deploy new code from development into qa. The reasoning was that many bugs had been fixed since the issue was first reported. We might have already fixed it.</p>
<p>At first blush this makes perfect sense. Why worry about something when it could already be fixed. If we can’t reproduce it, then there is no issue.</p>
<p>But <em>had</em> we really fixed the bug? It reminded me of a phrase from the Pragmatic Programmer, called “<a href="http://pragprog.com/the-pragmatic-programmer/extracts/coincidence">Coding by coincidence</a>.”</p>
<p>Had we really fixed the bug? Until we witnessed the bug and tracked down its cause we don’t know. Maybe we had, maybe we hadn&#8217;t. </p>
<p>If we could not witness the bug in action and then made a change to the code and then witnessed the bug not occurring we would not know it was fixed. Even if the newly deployed code did not exhibit the symptoms we don&#8217;t know if the bug was actually fixed or the symptoms simply suppressed. </p>
<p><a href="http://www.flickr.com/photos/43564193@N07/6286859096/" title="my ladybug turned black...........:D by François Cactus, on Flickr"><img src="http://farm7.static.flickr.com/6223/6286859096_477df959ae.jpg" width="500" height="500" alt="my ladybug turned black...........:D"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=294</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC Routing Shortcoming</title>
		<link>http://www.chuckconway.com/?p=290</link>
		<comments>http://www.chuckconway.com/?p=290#comments</comments>
		<pubDate>Fri, 18 Nov 2011 18:24:25 +0000</pubDate>
		<dc:creator>chuck</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[rantish]]></category>

		<guid isPermaLink="false">http://www.chuckconway.com/?p=290</guid>
		<description><![CDATA[Recently I’ve been working with ASP.Net Routing. It has some cool features. I particularly like how the RouteValueDictiontionary works. Give it any type and it will reduce the type to a key/value pair. Awesome! The tokenized routes are another lovely &#8230; <a href="http://www.chuckconway.com/?p=290">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I’ve been working with ASP.Net Routing. It has some cool features. I particularly like how the RouteValueDictiontionary works. Give it any type and it will reduce the type to a key/value pair. Awesome! The tokenized routes are another lovely feature, so are the default values.</p>
<p>A pain point I’ve encountered is route evaluation.</p>
<p>For example if you have 10 routes:</p>
<ol>
<li>mq/s</li>
<li>mq/t</li>
<li>mc/e</li>
<li>mt/t</li>
<li>mt/r</li>
<li>ms/s</li>
<li>tr/r</li>
<li>kl/d</li>
<li>kl/c</li>
<li>kl/x</li>
</ol>
<p>The routes are evaluated in the order they appear. This is logical. Evaluating a route consists of processing the incoming url and attempting to extract data from it. If no data exists a null is returned to the Routing Engine and the next route is tried. The issue I have is there is no smarts built into the route evaluation. It iterates over the route collection. For example if my route is the last one “kl/x” the first 9 have to be checked before it reaches the correct one. I’m assuming all the routes are relative to the root of the site. Why couldn’t there be a pre-evaluation to eliminate the routes? For example, I’ve requested kl/x. First 9 will be processed before kl/x. Why can’t the routing framework determine that 8, 9, 10 are the closes possible matches? Instead processing 9 routes we process 3.</p>
<p>This gets bigger when custom constraints are added. Say, for each route there is a constraint that looks up a user in the database then the database will be hit 10 times for the same data! Sure you can throw in caching, but that’s not the point.</p>
<p>Wrapping this up, Routing works great for 80 percent of the cases. It’s a good little framework with a few tweaks it could go from good to great.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckconway.com/?feed=rss2&#038;p=290</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

