<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>iParag.com - Parag C Mehta's .NET World</title>
	<atom:link href="http://solutionevangelist.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutionevangelist.wordpress.com</link>
	<description>Blog is about life in the .NET world. The struggles, the challenges, the knowledge, the fun, the climax that we have fiddling with .NET technologies :)</description>
	<lastBuildDate>Sat, 18 Jul 2009 11:20:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='solutionevangelist.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>iParag.com - Parag C Mehta's .NET World</title>
		<link>http://solutionevangelist.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://solutionevangelist.wordpress.com/osd.xml" title="iParag.com - Parag C Mehta&#039;s .NET World" />
	<atom:link rel='hub' href='http://solutionevangelist.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Testing Post</title>
		<link>http://solutionevangelist.wordpress.com/2009/06/24/testing-post/</link>
		<comments>http://solutionevangelist.wordpress.com/2009/06/24/testing-post/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 03:06:49 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iparag.com/2009/06/24/testing-post/</guid>
		<description><![CDATA[Test<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=70&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><B>Test</B></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=70&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2009/06/24/testing-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>MVC Preview 4 Talk by Phil Haack</title>
		<link>http://solutionevangelist.wordpress.com/2008/08/06/mvc-preview-4-talk-by-phil-haack/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/08/06/mvc-preview-4-talk-by-phil-haack/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 04:18:57 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=44</guid>
		<description><![CDATA[Post is here : http://channel9.msdn.com/shows/Continuum/MVCPreview4/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=44&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Post is here : http://channel9.msdn.com/shows/Continuum/MVCPreview4/</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=44&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/08/06/mvc-preview-4-talk-by-phil-haack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>Randy Pausch is called by god</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/28/randy-pausch-is-called-by-god/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/28/randy-pausch-is-called-by-god/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 09:25:55 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Inspirational]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=42</guid>
		<description><![CDATA[Hi fellows, Thanks for comments to my last post. However with deep sadness, I inform you that Randy Pausch has lost his fight towards cancer and demised on 25th July, 2008. God always needs these souls. His work has been legendary and he will be remembered for long. I wish I would have met him [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=42&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi fellows,</p>
<p>Thanks for comments to my last post. However with deep sadness, I inform you that Randy Pausch has lost his fight towards cancer and demised on 25th July, 2008. God always needs these souls.</p>
<p>His work has been legendary and he will be remembered for long.</p>
<p>I wish I would have met him somehow, but it&#8217;s no longer possible. I wish peace to Randy&#8217;s soul and may god give courage to his family to counter such heavy loss.</p>
<p>I salute him.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=42&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/28/randy-pausch-is-called-by-god/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>Thoroughly Inspirational &#8211; Randy Pausch Last Lecture: Achieving Your Childhood Dreams</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/21/thoroughly-inspirational-randy-pausch-last-lecture-achieving-your-childhood-dreams/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/21/thoroughly-inspirational-randy-pausch-last-lecture-achieving-your-childhood-dreams/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 08:39:34 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=40</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=40&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://solutionevangelist.wordpress.com/2008/07/21/thoroughly-inspirational-randy-pausch-last-lecture-achieving-your-childhood-dreams/"><img src="http://img.youtube.com/vi/ji5_MqicxSo/2.jpg" alt="" /></a></span>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=40&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/21/thoroughly-inspirational-randy-pausch-last-lecture-achieving-your-childhood-dreams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET MVC in the Real World</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/16/aspnet-mvc-in-the-real-world/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/16/aspnet-mvc-in-the-real-world/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 11:51:40 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=36</guid>
		<description><![CDATA[MVC (the &#8220;model view control&#8221; pattern) isn&#8217;t new, but it is new to ASP.NET. If you&#8217;re like me, you may have been impressed by a demo, but you&#8217;ve probably thought &#8220;how does this work in the real world?&#8221; I hope to answer that question in this article. All of the MVC demos that I have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=36&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>MVC (the &#8220;model view control&#8221; pattern) isn&#8217;t new, but it is new to ASP.NET. If you&#8217;re like me, you may have been impressed by a demo, but you&#8217;ve probably thought &#8220;how does this work in the real world?&#8221; I hope to answer that question in this article.</p>
<p>All of the MVC demos that I have seen show how quick and easy it is to get going with ASP.NET MVC (from here on I&#8217;ll just say &#8220;MVC&#8221;). They show a CSS&#8217;d up site with a navigation section, and a main content section. And in very little code, and very little time, they show how to retrieve data from your Model (the &#8220;Controller&#8221; does this), and how to display it in your page (the &#8220;View&#8221; does this). It look so simple, but there are some design questions that need to be addressed. We&#8217;ll discuss them as we look into MVC.</p>
<h3>MVC and Web Sites</h3>
<p>The gist behind MVC is that a &#8220;View&#8221; is only responsible for displaying it&#8217;s data, and nothing else. This means that if you had a View named &#8216;UsedCars&#8217;, it is only responsible for listing out used cars. There is no code for adding, deleting or updating the data in a View itself; there is no provision for displaying anything else other than &#8220;used car data&#8221;.</p>
<p>So, MVC in a web application means that a View is not responsible for the navigation, header, footer or any other part of the site. With that being said, a few questions come to my mind. These are the items that this article will discuss as our &#8216;real world&#8217; issues:</p>
<ol>
<li>How does MVC handle dynamic sections on a website that are not part of the current &#8220;View&#8221;? &#8211; For instance, on SingingEels.com, if you&#8217;re logged in, the navigation section changes to include member&#8217;s only links. When you&#8217;re looking at an article, the &#8220;related section&#8221; on the right of the site will show you blog posts that are similar to the content you are looking at.</li>
<li>How does MVC work with validating a user input, and displaying a friendly message back to the user on a screen that he expects to see? The reason I mention this is because in MVC, an HTML form on one View will be posting to an Action (a different URL) that actually does the work. This is different than in the &#8220;Web Forms&#8221; world, where the page posts-back to itself. So if the user entered some invalid data, how do you send them back to the original View, fill out the form back to how they had it, and display the error message?</li>
</ol>
<p>Aside from these &#8220;issues&#8221; above, we&#8217;ll see how to achieve common functionality (that we all do every day in the &#8220;Web Forms&#8221; world). These include things like creating paging functionality (I won&#8217;t explain this in the article, but it&#8217;s in the source code at the end). So, to demonstrate how to build a &#8220;full featured&#8221; MVC site that needs to solve the above issues, we&#8217;re going to build a &#8216;used cars&#8217; website. There will be a list of cars for sale (that will be paginated), displaying results from a database. We&#8217;ll also have a few static pages and a &#8220;contact us&#8221; form. I&#8217;ll include the entire source code and project at the end of the article. Keep in mind, this article and demo was written for ASP.NET MVC Preview 3.</p>
<h3>Building Our MVC Layout with MVC Master Pages</h3>
<p>The <a rel="nofollow" href="http://en.wikipedia.org/wiki/Model-view-controller">MVC design pattern</a> was not originally for web applications, so extending this architectural pattern to the web allows for some breathing room. This is where we will answer our first question: &#8220;how do we handle dynamic sections in our web site that isn&#8217;t part of a particular View?&#8221; Well, the answer is the same for how we handle our entire web site (the layout and styling of it) outside of any one particular View &#8211; with Master Pages!</p>
<p>So the first thing we are going to do with our MVC &#8220;Used Cars&#8221; website, is to create our basic layout and styles, and make a &#8216;stub&#8217; for our Views to live in (basically, a ContentPlaceHolder). Here&#8217;s what our site will look like:</p>
<p><img src="http://www.singingeels.com/Articles/Articles/UserImage.aspx?ImageID=f18aa072-25a0-4792-859d-38c1b6aa9f4a" alt="SingingEels_MVC Used Cars Site" /></p>
<p>Now, there are a few new tricks that we get with ASP.NET MVC (yes, I used the whole name here &#8211; for a purpose). The .NET team has provided a lot of powerful &#8220;helper functions&#8221; that snap right into the MVC framework. So, to make the navigation links above, I would normally have done this:</p>
<div class="CodeBlock xml">&lt;<span class="Tag">a</span> <span class="Key">href</span><span class="Value">=&#8221;/Home&#8221;</span>&gt;Home&lt;<span class="Tag">/a</span>&gt;</p>
<p>&lt;<span class="Tag">a</span> <span class="Key">href</span><span class="Value">=&#8221;/ForSale&#8221;</span>&gt;For Sale&lt;<span class="Tag">/a</span>&gt;</p>
<p>&lt;<span class="Tag">a</span> <span class="Key">href</span><span class="Value">=&#8221;/About&#8221;</span>&gt;About Us&lt;<span class="Tag">/a</span>&gt;</div>
<p>&#8230; But the problem here is that we are making links to &#8220;pages&#8221; instead of making links to &#8220;MVC Views&#8221;. This forces our file structure to be very tied to our web design, which may not be what you&#8217;re going for. Instead we&#8217;ll do this:</p>
<div class="CodeBlock xml"><span class="InlineAsp">&lt;%</span><span class="AspKey">=</span> Html.ActionLink(<span class="String">&#8220;Home&#8221;</span>, <span class="String">&#8220;Index&#8221;</span>)<span class="InlineAsp">%&gt;</span></p>
<p><span class="InlineAsp">&lt;%</span><span class="AspKey">=</span> Html.ActionLink(<span class="String">&#8220;For Sale&#8221;</span>, <span class="String">&#8220;ForSale&#8221;</span>)<span class="InlineAsp">%&gt;</span></p>
<p><span class="InlineAsp">&lt;%</span><span class="AspKey">=</span> Html.ActionLink(<span class="String">&#8220;About Us&#8221;</span>, <span class="String">&#8220;About&#8221;</span>)<span class="InlineAsp">%&gt;</span></div>
<p>This allows us to define our links in terms of pointing to a &#8216;View&#8217;, as apposed to being tied to a specific URL. You don&#8217;t have to build your links this way, but it helps if you decide to change your route logic and you want your site to automatically update the links. Since we have our basic layout done, let&#8217;s take a look at how these pages work.</p>
<h3>Simple ASP.NET MVC Views</h3>
<p>For simple Views that don&#8217;t have a lot of logic around them, you don&#8217;t have to do much in your controller. So for the home page and the about us page, this is basically all of the code in my controller:</p>
<div class="CodeBlock C#"><span class="KeyWord">public</span> ActionResult About()<br />
{<br />
<span class="KeyWord">this</span>.ViewData[<span class="String">"Title"</span>] = <span class="String">&#8220;About Page&#8221;</span>;</p>
<p><span class="KeyWord">this</span>.ViewData[<span class="String">"PageHeading"</span>] = <span class="String">&#8220;Learn All About Us&#8221;</span>;</p>
<p><span class="KeyWord">return</span> <span class="KeyWord">this</span>.View();<br />
}</p>
<p><span class="KeyWord">public</span> ActionResult Index()<br />
{<br />
<span class="KeyWord">this</span>.ViewData[<span class="String">"Title"</span>] = <span class="String">&#8220;Home Page&#8221;</span>;</p>
<p><span class="KeyWord">this</span>.ViewData[<span class="String">"PageHeading"</span>] = <span class="String">&#8220;Welcome to Used Cars by Eels!&#8221;</span>;</p>
<p><span class="KeyWord">return</span> <span class="KeyWord">this</span>.View();<br />
}</div>
<p>Then, in our View, we can display the data. Normally this would go in the &#8216;aspx&#8217; or &#8216;ascx&#8217; files, but I&#8217;m displaying the above data in the master page (since the title of the page, and the page heading could be considered part of the standard layout). Again, you can download the source code for this project at the end of the article to see for yourself.</p>
<h3>Real-World MVC Issue : Data Validation</h3>
<p>So, let&#8217;s get out of the boring, and talk about the other big problem that needs to be solved &#8211; form validation. When a user fills out our contact us form, we want to check for required fields and alert the user when the form is invalid. If all goes well, we&#8217;ll send the user to a &#8220;Thank You&#8221; page.</p>
<p>Here&#8217;s what our page will ultimately look like:</p>
<p><img src="http://www.singingeels.com/Articles/Articles/UserImage.aspx?ImageID=16e57acb-20a8-424d-b0c0-8452d683fcf9" alt="SingingEels_MVC - contact us form being validated" /></p>
<p>But the question remains: how do we do it? First, we build our HTML form using the helper methods:</p>
<div class="CodeBlock asp">&lt;form action=&#8221;<span class="InlineAsp">&lt;%</span><span class="AspKey">=</span> <span class="KeyWord">this</span>.Url.Action(<span class="String">&#8220;SendContact&#8221;</span>, <span class="String">&#8220;Home&#8221;</span>) <span class="InlineAsp">%&gt;</span>&#8221; method=&#8221;post&#8221;&gt;<br />
First Name <span class="InlineAsp">&lt;%</span><span class="AspKey">=</span><span class="KeyWord">this</span>.Html.TextBox(<span class="String">&#8220;FirstName&#8221;</span>, Request[<span class="String">"FirstName"</span>]) <span class="InlineAsp">%&gt;</span></p>
<p>Last Name <span class="InlineAsp">&lt;%</span><span class="AspKey">=</span><span class="KeyWord">this</span>.Html.TextBox(<span class="String">&#8220;LastName&#8221;</span>, Request[<span class="String">"LastName"</span>]) <span class="InlineAsp">%&gt;</span></p>
<p><span class="Comment">&lt;!&#8211; etc &#8211;&gt;</span><br />
&lt;<span class="Tag">/form</span>&gt;</div>
<div class="update"><span class="date">Update: Jun 21 2008</span>You can also build forms by using the following helper method:</p>
<div class="CodeBlock ASP"><span class="InlineAsp">&lt;%</span> <span class="KeyWord">using</span> (<span class="KeyWord">this</span>.Html.Form(<span class="String">&#8220;SendContact&#8221;</span>, <span class="String">&#8220;Home&#8221;</span>)) { <span class="InlineAsp">%&gt;</span></p>
<p><span class="Comment">&lt;!&#8211; form stuff here &#8211;&gt;</span></p>
<p><span class="InlineAsp">&lt;%</span> } <span class="InlineAsp">%&gt;</span></div>
</div>
<p>Then, in our Controller we will do the validation:</p>
<div class="CodeBlock c#">List&lt;<span class="KeyWord">string</span>&gt; errors = <span class="KeyWord">new</span> List&lt;<span class="KeyWord">string</span>&gt;();</p>
<p><span class="KeyWord">if</span> (<span class="KeyWord">string</span>.IsNullOrEmpty(firstName))<br />
errors.Add(<span class="String">&#8220;First Name <span class="KeyWord">is</span> a required field.&#8221;</span>);</p>
<p><span class="KeyWord">if</span> (<span class="KeyWord">string</span>.IsNullOrEmpty(lastName))<br />
errors.Add(<span class="String">&#8220;Last Name <span class="KeyWord">is</span> a required field.&#8221;</span>);<span class="Comment"></p>
<p>// etc&#8230; and now the important part!</span></p>
<p><span class="KeyWord">if</span> (errors.Count &gt; 0)<br />
{<span class="Comment"><br />
// In order to pass data <span class="KeyWord">on</span> to a page that we are</span><span class="Comment"><br />
// redirecting to, we use the &#8216;TempData&#8217; field.</span><br />
<span class="KeyWord">this</span>.TempData[<span class="String">"ErrorMessages"</span>] = errors.ToArray();<span class="Comment"></p>
<p>// Because the form <span class="KeyWord">is</span> invalid, redirect back to the</span><span class="Comment"><br />
// View and pass back the form data.</span><br />
<span class="KeyWord">return</span> <span class="KeyWord">this</span>.RedirectToAction(<span class="String">&#8220;Contact&#8221;</span>, <span class="KeyWord">new</span><br />
{<br />
FirstName = firstName,<br />
LastName = lastName,<br />
EmailAddress = emailAddress,<br />
Message = message<br />
});<br />
}</div>
<p>The last piece of the puzzle is back in the contact us View. It&#8217;s where we check the TempData field to see if there are any error messages in there, and if so, we display them. There are a few things to be concerned about here with using the TempData though. Mainly, it&#8217;s important to know that behind the scenes, MVC is using the Session object to store the data between hits. Now, it is very quick to clean it up (immediately after the next request)&#8230; but if you&#8217;re using a web-farm, it&#8217;s important to remember that you&#8217;ll need a shared session pool.</p>
<h3>In Conclusion</h3>
<p>MVC is a beautiful new tool that will no doubt be invaluable in the future. It does require a different approach to architecting your web sites, but it can be very worth it in the end. However, it&#8217;s also important to remember that MVC is not replacing Web Forms.</p>
<p>I hope this article has shown that you can still achieve the functionality that you&#8217;re used to having using ASP.NET MVC. Check it out for yourself and see if you don&#8217;t grow to love it (or at least appreciate it) as I have. And of course, here&#8217;s the source code for the above project: <a href="http://www.singingeels.com/Articles/UserFile.aspx?FileID=47c17faf-7a21-4045-8480-759647cb2c0b">SingingEels_MVC Used Cars Demo.zip</a>. Again, it was written and compiled for ASP.NET MVC Preview 3.</p>
<p>Original Article at : http://www.singingeels.com/Articles/ASPNET_MVC_in_the_Real_World.aspx</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=36&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/16/aspnet-mvc-in-the-real-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>

		<media:content url="http://www.singingeels.com/Articles/Articles/UserImage.aspx?ImageID=f18aa072-25a0-4792-859d-38c1b6aa9f4a" medium="image">
			<media:title type="html">SingingEels_MVC Used Cars Site</media:title>
		</media:content>

		<media:content url="http://www.singingeels.com/Articles/Articles/UserImage.aspx?ImageID=16e57acb-20a8-424d-b0c0-8452d683fcf9" medium="image">
			<media:title type="html">SingingEels_MVC - contact us form being validated</media:title>
		</media:content>
	</item>
		<item>
		<title>We Love To Hate Microsoft But What About Apple?</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/16/we-love-to-hate-microsoft-but-what-about-apple/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/16/we-love-to-hate-microsoft-but-what-about-apple/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 11:43:30 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Philosophy]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=34</guid>
		<description><![CDATA[The reasons so many people hate (or intensely dislike) Microsoft are plentiful and for the most part, pretty easy to understand.  If you were to ask around, reasons cited would centralize around too much power, lack of innovation, stifling creativity, being &#8220;closed&#8221; and generally products that on average, fail to delight customers.  If you&#8217;re one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=34&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The reasons so many people hate (or intensely dislike) Microsoft are  plentiful and for the most part, pretty easy to understand.  If you were to ask  around, reasons cited would centralize around too much power, lack of  innovation, stifling creativity, being &#8220;closed&#8221; and generally products that on  average, fail to delight customers.  If you&#8217;re one of those that hates  Microsoft, I&#8217;m sure you have your reasons.  <strong>Many of us love to hate  Microsoft</strong>.</p>
<p>And, of course, lots of us <strong><em>love</em> Apple</strong>.  We love  Apple in that sheepishly adoring way that causes us to want to run our fingers  lovingly over our favorite Apple product when nobody is looking just because it  makes us happy.  Happy in a good way, and not in that weird, twisted kind of  way.  It&#8217;s an innocent love.  All sunshine and daffodils.  <img style="display:block;" src="http://onstartups.com/Portals/150/images/love-hate.jpg" alt="" hspace="7" vspace="7" width="232" height="211" align="right" /></p>
<p>But, I&#8217;m going to argue that though we will likely continue to love Apple for  a while, there may come a day we <em>hate</em> doing so.</p>
<p><strong>Why might we hate to love Apple someday?</strong></p>
<p>One simple, fundamental reason:  Apple cares too much about customers, and  the customer experience &#8212; and not much about the community.  <strong>Apple has  become a benevolent dictator</strong>.  They&#8217;ll invest lots of time, energy and  money making their products great and their customers &#8220;happy&#8221;.  But, at their  core, they want it to be <em>them</em> that delivers that happiness &#8212; not  someone else.  Third-party developers are a necessary evil.</p>
<p>There&#8217;s a reason for this:  Apple (rightly) thinks that a phenomenal  experience is created by closed, proprietary systems by companies that control  the boundaries and edges of product design.</p>
<p>Great experiences are created when the experience designer can dictate and  control as much as possible.  The iPod would not have been great if the hardware  were designed by one company, the device software by another, applications by  another, etc.  The iPod was exceptionally great because Apple controlled it  all.</p>
<p>This is why the original Apple computers had such a better  <em>experience</em> than the IBM PC.  On the IBM PC platform different companies  built the hardware, OS, apps, devices, etc.  Lots of creativity &#8212; but  understandably, lots of crap.  And lots of complexity for the user/customer.</p>
<p>So, Apple likes control.  But this advantage of control only goes so far.   Eventually, users will come to value something more than the delightful  experience.  Might be performance of an individual component (larger storage),  lower price, wider selection of add-ons, etc.  (Maybe even replaceable  batteries, less confining DRM, etc.)</p>
<p>Now, thanks to Apple, millions of consumers are enjoying technology like  digital music that would likely not have done so without Apple&#8217;s fanatical focus  on solving for ease-of-use and experience.  But, now that we&#8217;re there, will our  love of Apple endure?</p>
<p>And, if we do continue to love Apple, will we hate ourselves for doing so  someday?  Maybe.  Maybe not.</p>
<p><strong>The insight for startups?</strong> Some of the biggest innovations and market successes come from companies that are total control-freaks and fanatically focused on solving the problem.  Often, the problem is best solved by an uncompromising purity of approach.</p>
<p>Looking for other startup fanatics?  Request access to the <a href="http://linkedin.onstartups.com/" target="_blank">OnStartups LinkedIn Group</a>.  13,000+ members and growing daily.</p>
<p>Original Article at : http://feeds.feedburner.com/~r/onstartups/~3/330959672/We-Love-To-Hate-Microsoft-But-What-About-Apple.aspx</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=34&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/16/we-love-to-hate-microsoft-but-what-about-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>

		<media:content url="http://onstartups.com/Portals/150/images/love-hate.jpg" medium="image" />
	</item>
		<item>
		<title>Rules for CLR Add-Ins Contract and View Assemblies</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/16/rules-for-clr-add-ins-contract-and-view-assemblies/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/16/rules-for-clr-add-ins-contract-and-view-assemblies/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 11:39:59 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=31</guid>
		<description><![CDATA[The CLR Add-In team recently released on CodePlex a set of 49 FxCop rules to verify View and Contract assemblies. If you don’t don’t know what is View and Contract assemblies, I suggest reading this excellent CLR Inside-Out MSDN Magazine article by Jack Gudenkauf and Jesse Kaplan. It is about how to harness System.AddIn facilities. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=31&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://blogs.msdn.com/clraddins" target="_blank">CLR Add-In team</a> recently released on CodePlex a set of <a href="http://blogs.msdn.com/clraddins/archive/2008/07/08/addin-fxcop-rules-released.aspx" target="_blank">49 FxCop rules</a> to verify <em>View</em> and <em>Contract</em> assemblies. If you don’t don’t know what is <em>View</em> and <em>Contract</em> assemblies, I suggest reading this excellent <a href="http://msdn.microsoft.com/msdnmag/issues/07/03/CLRInsideOut/default.aspx" target="_blank">CLR Inside-Out MSDN Magazine</a> article by <em>Jack Gudenkauf</em> and <em>Jesse Kaplan</em>. It is about how to harness <a href="http://msdn.microsoft.com/en-us/library/system.addin.aspx" target="_blank">System.AddIn</a> facilities.</p>
<p style="margin:0 0 .0001pt;">
<p style="margin:0 0 .0001pt;">I spent an hour implementing these rules with <a href="http://www.ndepend.com/Features.aspx#CQL" target="_blank">CQL</a> and came to the following result. Notice that these rules can be readily adapted if you have sereval contract or view assemblies.</p>
<p style="margin:0 0 .0001pt;">
<p style="margin:0 0 .0001pt;">
<p style="margin:0 0 .0001pt;"><strong><span style="font-size:16pt;">Rules on Contract assemblies</span></strong></p>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not have references to non-framework assemblies</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">IsUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;"> 
  </span><span style="color:#008000;">// Framework assemblies are mscorlib and thos whose names begin with System.
</span><span style="color:#000000;">  </span><span style="color:#000000;">(</span><span style="color:#000000;">!</span><span style="color:#000064;">NameIs</span> <span style="color:#a31515;">"mscorlib"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;"> 
   </span><span style="color:#000000;">!</span><span style="color:#000064;">NameLike</span> <span style="color:#a31515;">"^System."</span><span style="color:#000000;">)</span><span style="color:#000000;">

</span><span style="color:#008000;">// Don't reference non-framework assemblies from the contract assembly unless you can 
</span><span style="color:#008000;">// be sure that the assembly can be loaded on both sides of the contract boundary.
</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract types that represent add-ins should be marked with the AddInContractAttribute</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsInterface</span> <span style="color:#0000ff;">AND</span> <span style="color:#008000;">// Limiting search to interfaces only.
</span><span style="color:#000000;">  </span><span style="color:#000000;">!</span><span style="color:#000064;">HasAttribute</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Pipeline.AddInContractAttribute"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Contracts that represent add-ins and are intended to be activated should be marked 
</span><span style="color:#008000;">// with the AddInContractAttribute. Contracts that only represent objects passed between 
</span><span style="color:#008000;">// hosts and add-ins do not need this attribute; if all of the types in this assembly 
</span><span style="color:#008000;">// fall under this category then this rule can be ignored.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Value types defined in a contract assembly should be serializable</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsStructure</span> <span style="color:#0000ff;">AND</span> <span style="color:#000000;">!</span><span style="color:#000064;">IsSerializable</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Value types (structs) are only useful in the contract assembly if 
</span><span style="color:#008000;">// they can be serialized across the boundary.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract interfaces must implement IContract</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">IsInterface</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">!</span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.IContract"</span><span style="color:#000000;">

</span><span style="color:#008000;">// All interfaces defined in the contract assembly must implement IContract, 
</span><span style="color:#008000;">// or another interface that implements IContract. Using an interface that 
</span><span style="color:#008000;">// doesn’t implement IContract can cause problems with lifetime management.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not define types that derive from MarshalByRefObject</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.MarshalByRefObject"</span><span style="color:#000000;">

</span><span style="color:#008000;">// MarshalByRefObjects can cause problems with lifetime management. If this type 
</span><span style="color:#008000;">// represents an object you want to marshal by reference, you should define an 
</span><span style="color:#008000;">// interface implementing IContract to represent it. If it is intended to be copied 
</span><span style="color:#008000;">// (and thus passed by value), then you should define a simple serializable value 
</span><span style="color:#008000;">// type (struct) to represent it.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Exception types must implement ISerializable and be marked with the Serializable attribute</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Exception"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">(</span><span style="color:#000000;">!</span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Runtime.Serialization.ISerializable"</span> <span style="color:#0000ff;">OR</span><span style="color:#000000;">
   </span><span style="color:#000000;">!</span><span style="color:#000064;">HasAttribute</span> <span style="color:#a31515;">"OPTIONAL:System.SerializableAttribute"</span><span style="color:#000000;">)</span><span style="color:#000000;">

</span><span style="color:#008000;">// Exception must implement ISerializable and be marked with the SerializableAttribute 
</span><span style="color:#008000;">// in order to function well across AppDomain boundaries.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not define static types</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span> <span style="color:#000064;">IsStatic</span><span style="color:#000000;">

</span><span style="color:#008000;">// The state of static types is stored per AppDomain and changes to state 
</span><span style="color:#008000;">// in one AppDomain are not reflected in others.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not define reference types other than exception types</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsClass</span> <span style="color:#0000ff;">AND</span> <span style="color:#000000;">!</span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Exception"</span><span style="color:#000000;">

</span><span style="color:#008000;">// The only valid reference type is an Exception type. If this type represents an 
</span><span style="color:#008000;">// object you want to marshal by reference, you should define an interface implementing 
</span><span style="color:#008000;">// IContract to represent it. If it is intended to be copied (and thus passed by value),
</span><span style="color:#008000;">// then you should define a simple serializable value type (struct) to represent it.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not define delegate types</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span> <span style="color:#000064;">IsDelegate</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Delegates do no marshal well across AppDomain or Process boundaries 
</span><span style="color:#008000;">// and so should not be used in contracts.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not define exception types</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Exception"</span><span style="color:#000000;">

</span><span style="color:#008000;">// If possible, you should use one of the framework defined exceptions rather 
</span><span style="color:#008000;">// than defining your own. If you decide to define your own exceptions, 
</span><span style="color:#008000;">// they become part of your object model and you will need to define corresponding 
</span><span style="color:#008000;">// Exception types in the views and perform the conversion in your adapters.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Non-exception types should prefer [Serializable] attribute over ISerializable</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000000;">!</span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Exception"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Runtime.Serialization.ISerializable"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Implementing ISerializable adds a significant performance overhead compared 
</span><span style="color:#008000;">// to standard serialization. If possible, use the built in serialization 
</span><span style="color:#008000;">// engine instead of customizing it with ISerializable.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>All interfaces used in contract assemblies should implement IContract</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsInterface</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">!</span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.IContract"</span><span style="color:#000000;">

</span><span style="color:#008000;">// All interfaces used in the contract assembly should implement IContract, or 
</span><span style="color:#008000;">// another interface that implements IContract. Using an interface that doesn’t 
</span><span style="color:#008000;">// implement IContract can cause problems with lifetime management.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use types that derive from MarshalByRefObject</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.MarshalByRefObject"</span><span style="color:#000000;">

</span><span style="color:#008000;">// MarshalByRefObjects can cause problems with lifetime management. If this
</span><span style="color:#008000;">// type represents an object you want to marshal by reference, you should define
</span><span style="color:#008000;">// an interface implementing IContract to represent it. If it is intended to be
</span><span style="color:#008000;">// copied (and thus passed by value), then you should define a simple serializable
</span><span style="color:#008000;">// value type (struct) to represent it.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should only use types that are either serializable or are interfaces implementing IContract</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">(</span><span style="color:#000000;">!</span><span style="color:#000064;">IsSerializable</span> <span style="color:#0000ff;">OR</span><span style="color:#000000;">
   </span><span style="color:#000000;">(</span><span style="color:#000064;">IsInterface</span> <span style="color:#0000ff;">AND</span> <span style="color:#000000;">!</span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.IContract"</span><span style="color:#000000;">)</span><span style="color:#000000;">)</span><span style="color:#000000;">

</span><span style="color:#008000;">// This type is neither serializable nor is it an interface implementing IContract. 
</span><span style="color:#008000;">// If it represents an object you want to marshal by reference, you should define an 
</span><span style="color:#008000;">// interface implementing IContract to represent it. If it is intended to be copied 
</span><span style="color:#008000;">// (and thus passed by value), then you should define a simple serializable value 
</span><span style="color:#008000;">// type (struct) to represent it.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not contain any static members</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">FIELDS</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span> <span style="color:#000064;">IsStatic</span><span style="color:#000000;">

</span><span style="color:#008000;">// Static state is stored per AppDomain, and changes to state in one 
</span><span style="color:#008000;">// AppDomain are not reflected in others.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use delegates</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDelegate</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Delegates do not marshal well across AppDomain or Process boundaries, 
</span><span style="color:#008000;">// and so should not be used in contracts.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use arbitrary types that implement ICollection&lt;T&gt; or ICollection</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">(</span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Collections.Generic.ICollection&lt;T&gt;"</span> <span style="color:#0000ff;">OR</span><span style="color:#000000;">
   </span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Collections.ICollection"</span><span style="color:#000000;">)</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use a type defined simply as System.Object</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">FullNameIs</span> <span style="color:#a31515;">"System.Object"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Using the System.Object type makes it very difficult to ensure that this
</span><span style="color:#008000;">// will version well over time. If this is intended to represent an arbitrary
</span><span style="color:#008000;">// contract, type you should use IContract instead.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use a type defined simply as System.Type</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">FullNameIs</span> <span style="color:#a31515;">"System.Type"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Passing a System.Type across the boundary causes the assembly containing it 
</span><span style="color:#008000;">// to be loaded in the other domain as well. This greatly lessens the value of 
</span><span style="color:#008000;">// the isolation boundary for versioning, security, unloadability, and reliability.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use types from the System.Reflection namespace other than AssemblyName</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">FullNameLike</span> <span style="color:#a31515;">"System.Reflection."</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">!</span><span style="color:#000064;">NameIs</span> <span style="color:#a31515;">"AssemblyName"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Passing most reflection types across the boundary causes the assembly 
</span><span style="color:#008000;">// containing it to be loaded in that domain as well. This greatly lessens 
</span><span style="color:#008000;">// the value of the isolation boundary for versioning, security, unloadability, 
</span><span style="color:#008000;">// and reliability.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use System.AddIn.Contract.Collections.IListContract&lt;T&gt;</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">FullNameIs</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.Collections.IListContract&lt;C&gt;"</span><span style="color:#000000;">

</span><span style="color:#008000;">// System.AddIn contains helper methods for using System.AddIn.Contract.IList&lt;T&gt; and 
</span><span style="color:#008000;">// should be preffered over the version in System.AddIn.Contracts.Collections. 
</span><span style="color:#008000;">// System.AddIn.Contract.Collections.IList&lt;T&gt; is in place largely for compatibility reasons.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not use System.AddIn.Contract.Collections.*</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">NAMESPACES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">NameIs</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.Collections"</span><span style="color:#000000;">

</span><span style="color:#008000;">// System.AddIn.Contract.Collections.* should not be used. If you use 
</span><span style="color:#008000;">// System.AddIn.Contract.Collections, you will need to write your own adapters for them.</span></pre>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Contract assemblies should not declare non-public types</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyContractAssembly"</span> <span style="color:#0000ff;">WHERE</span> <span style="color:#000000;">!</span><span style="color:#000064;">IsPublic</span><span style="color:#000000;">

</span><span style="color:#008000;">// The purpose of a contract assembly is to allow adapters to represent the 
</span><span style="color:#008000;">// types across isolation and versioning boundaries. Making a type in this 
</span><span style="color:#008000;">// assembly non-public prevents it from being used in this fashion.</span></pre>
<p><strong><span style="font-size:16pt;">Rules on View assemblies</span></strong></p>
<hr />
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Activatable add-in types should be marked with the AddInBaseAttribute</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000000;">(</span><span style="color:#000064;">IsInterface</span> <span style="color:#0000ff;">OR</span> <span style="color:#000064;">IsAbstract</span><span style="color:#000000;">)</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">HasAttribute</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Pipeline.AddInBaseAttribute"</span><span style="color:#000000;">

</span><span style="color:#008000;">// No type in the assembly is marked with the AddInBaseAttribute. For this assembly 
</span><span style="color:#008000;">// to be used (without modification) as an AddInView, the types that represent 
</span><span style="color:#008000;">// add-ins need to be marked with the AddInBaseAttribute. Even if the type will not 
</span><span style="color:#008000;">// be used directly through System.AddIn today, applying this attribute now will 
</span><span style="color:#008000;">// make it easier to migrate while still maintaining compatibility.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not implement IContract or an interface that implements IContract</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.IContract"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Exposing a contract directly in the view can cause a variety of problems. It makes it
</span><span style="color:#008000;">// very difficult to version over time since it strongly binds the consumer of the view 
</span><span style="color:#008000;">// to a particular version of the contract assembly.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not be marked serializable</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Runtime.Serialization.ISerializable"</span> <span style="color:#0000ff;">OR</span><span style="color:#000000;">
  </span><span style="color:#000064;">HasAttribute</span> <span style="color:#a31515;">"OPTIONAL:System.SerializableAttribute"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Types defined in views should never have to directly cross any isolation 
</span><span style="color:#008000;">// boundary, and so shouldn’t need to be serializable. You can mark these 
</span><span style="color:#008000;">// serializable if you need to store them to disk but you shouldn’t do so in
</span><span style="color:#008000;">// order to pass them across boundaries.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not derive from MarshalByRefObject</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.MarshalByRefObject"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Types defined in views should never have to directly cross any isolation
</span><span style="color:#008000;">// boundary and so shouldn’t need to be a MarshalByRefObject.
</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not have generic parameters</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">IsGeneric</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Types with generic parameters are difficult to isolate, since their 
</span><span style="color:#008000;">// pipeline components cannot be generated automatically.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>There should be no exception types defined in the view assembly</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Exception"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Defining your own exception makes that exception type part of your object model. 
</span><span style="color:#008000;">// This means it will require a different exception type to cross the isolation 
</span><span style="color:#008000;">// boundary, and adapting logic on either side to do the conversion. If at all 
</span><span style="color:#008000;">// possible, you should use one of the existing framework exception types.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not be marked static</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">IsStatic</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// The state of static types is stored per AppDomain, and changes to state 
</span><span style="color:#008000;">// in one AppDomain are not reflected in others. Static types in the view 
</span><span style="color:#008000;">// are only OK if they provide simple helper functionality, and are stateless.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not inherit from FrameworkElement</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Windows.FrameworkElement"</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Building adapters for types that inherit from FrameworkElement is difficult, 
</span><span style="color:#008000;">// since you have to hand-code them..</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View types should not inherit from Control</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;"> 
  </span><span style="color:#000064;">DeriveFrom</span> <span style="color:#a31515;">"OPTIONAL:System.Windows.Forms.Control"</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Building adapters for types that inherit from Control is difficult, 
</span><span style="color:#008000;">// since you have to hand-code them.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Types used in views should not implement IContract</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.AddIn.Contract.IContract"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Exposing a contract directly in the view can cause a variety of problems. 
</span><span style="color:#008000;">// It makes it very difficult to version over time since it strongly binds 
</span><span style="color:#008000;">// the consumer of the view to a particular version of the contract assembly.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Concrete reference types used in views should be serializable</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsClass</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">!</span><span style="color:#000064;">IsSerializable</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// Concrete types are very difficult isolate down the road. They should only 
</span><span style="color:#008000;">// be in this assembly if they inherit/implement an abstract base class or interface 
</span><span style="color:#008000;">// in this assembly. Other types should reference the abstract base class or 
</span><span style="color:#008000;">// interface, and not the concrete helper type.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Concrete reference types used in views should belong to a framework assembly</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsClass</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">!</span><span style="color:#000064;">FullNameLike</span> <span style="color:#a31515;">"^System."</span> <span style="color:#008000;">// The namespace name must begin with System. for framework type.
</span><span style="color:#000000;">
</span><span style="color:#008000;">// Concrete types are very difficult isolate down the road. They should only be in 
</span><span style="color:#008000;">// this assembly if they inherit/implement an abstract base class or interface in this 
</span><span style="color:#008000;">// assembly. Other types should reference the abstract base class or interface, and not 
</span><span style="color:#008000;">// the concrete helper type. You can pass types across the boundary directly only if 
</span><span style="color:#008000;">// they are serializable and can be loaded in both sides of an isolation boundary. 
</span><span style="color:#008000;">// This is only true for serializable framework types.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Events should be of the generic type EventHandler&lt;T&gt;</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">FIELDS</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsEventDelegateObject</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;"> 
  </span><span style="color:#000000;">!</span><span style="color:#000064;">IsOfType</span> <span style="color:#a31515;">"OPTIONAL:System.EventHandler&lt;TEventArgs&gt;"</span><span style="color:#000000;">

</span><span style="color:#008000;">// There are no tools that automatically generate adapters for events other
</span><span style="color:#008000;">// than EventHandler&lt;T&gt; which would make building adapters for this member 
</span><span style="color:#008000;">// very difficult.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>IList&lt;T&gt; should be used instead of arbitrary ICollections</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">(</span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Collections.Generic.ICollection&lt;T&gt;"</span> <span style="color:#0000ff;">OR</span><span style="color:#000000;">
   </span><span style="color:#000064;">Implement</span> <span style="color:#a31515;">"OPTIONAL:System.Collections.ICollection"</span><span style="color:#000000;">)</span><span style="color:#000000;">
  </span><span style="color:#0000ff;">AND</span> <span style="color:#000000;">!</span><span style="color:#000064;">FullNameIs</span> <span style="color:#a31515;">"OPTIONAL:System.Collections.Generic.IList&lt;T&gt;"</span><span style="color:#000000;">

</span><span style="color:#008000;">// There are no pre-built contracts or adapters for collections other than IList&lt;T&gt;. 
</span><span style="color:#008000;">// Thus, if you use these you will have to write your own adapters.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Non-concrete types used in views should be defined in the view assembly</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">OUT</span> <span style="color:#0000ff;">OF</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000000;">(</span><span style="color:#000064;">IsInterface</span> <span style="color:#0000ff;">OR</span> <span style="color:#000064;">IsAbstract</span><span style="color:#000000;">)</span><span style="color:#000000;">

</span><span style="color:#008000;">// If you are using an interface/abstract base class defined in a different assembly,
</span><span style="color:#008000;">// you need to ensure that that type follows the same rules that govern types in this assembly.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Serializable types used by views should be defined in a framework assembly</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsSerializable</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;"> 
  </span><span style="color:#000000;">!</span><span style="color:#000064;">FullNameLike</span> <span style="color:#a31515;">"^System."</span> <span style="color:#008000;">// The namespace name must begin with System. for framework type.
</span><span style="color:#000000;">
</span><span style="color:#008000;">// If you intend to serialize this type across an isolation boundary, you need to be 
</span><span style="color:#008000;">// sure that the type is going to be available to load in both sides of the isolation 
</span><span style="color:#008000;">// boundary. This is hard to ensure if it is not a framework type.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View members should not have open generic parameters</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">METHODS</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsGeneric</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// There are no tools to automatically generate pipelines for open generic types. 
</span><span style="color:#008000;">// Thus, if you decide to isolate this type later you will have to do the adapter 
</span><span style="color:#008000;">// logic by hand.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>Views should not use a type defined simply as System.Object</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">TYPES</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsDirectlyUsedBy</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">AND</span><span style="color:#000000;">
  </span><span style="color:#000064;">FullNameIs</span> <span style="color:#a31515;">"System.Object"</span><span style="color:#000000;">

</span><span style="color:#008000;">// Defining the type as System.Object makes it very difficult to ensure that
</span><span style="color:#008000;">// it versions well over time. If this is intended to represent an arbitrary 
</span><span style="color:#008000;">// contract type, you should use a more specific type instead.</span></pre>
<hr />
<div></div>
<pre><span style="color:#008000;">// &lt;Name&gt;</span><strong>View members should not be marked static</strong><span style="color:#008000;">&lt;/Name&gt;
</span><span style="color:#0000ff;">WARN</span> <span style="color:#0000ff;">IF</span> <span style="color:#000064;">Count</span> <span style="color:#000000;">&gt;</span> <strong>0</strong> <span style="color:#0000ff;">IN</span> <span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">FIELDS</span> <span style="color:#0000ff;">FROM</span> <span style="color:#0000ff;">ASSEMBLIES</span> <span style="color:#a31515;">"MyViewAssembly"</span> <span style="color:#0000ff;">WHERE</span><span style="color:#000000;">
  </span><span style="color:#000064;">IsStatic</span><span style="color:#000000;"> 

</span><span style="color:#008000;">// The state of static types is stored per AppDomain, and changes to state 
</span><span style="color:#008000;">// in one AppDomain are not reflected in others. Static types in the view are OK 
</span><span style="color:#008000;">// as long as they provide simple helper functionality and are stateless.</span></pre>
<pre></pre>
<p style="margin:0 0 .0001pt;">42 on 49 rules can readily be expressed with CQL. Here are the ones that cannot be written with the current version of CQL :</p>
<p style="margin:0 0 .0001pt;">
<p><em>(Contract)Arrays should not contain types that implement IContract ; (Contract)Arrays should only contain serializable types ; (View) Arrays should only contain serializable types</em> : While you can constraint some methods to use some array or not with some regex on method signature and the term [], CQL cannot yet constraint element types of an array.</p>
<p><em>(Contract)Contract interfaces should not implement non-IContract interfaces</em> : This rules implies 2 composite queries, the first one to get contract interfaces and the second one takes the result of the first one and check if it implements non-IContract interfaces. Composing queries this way is not yet possible with CQL but it is a major feature for the future.</p>
<p><em>(View) Concrete Reference Types Should Derive From A View Type Defined In The Current Assembly</em> : Here also this rule need 2 composite queries to be implemented.</p>
<p><em><span style="font-size:12pt;">(Contract)Contract assemblies should not define events</span></em><span style="font-size:12pt;"> ; <em>(View) Events should only be declared on Interfaces, not AbstractBaseClasses</em>: While you can check if a class or a structure define some event by checking fields with the condition IsEventDelegateObject, CQL cannot so far check if an interface define some events.</span></p>
<p>Original Article at : http://feeds.feedburner.com/~r/CodeBetter/~3/336931612/rules-for-clr-add-ins-contract-and-view-assemblies.aspx</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=31&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/16/rules-for-clr-add-ins-contract-and-view-assemblies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>Using defence in depth to produce high quality software</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/16/using-defence-in-depth-to-produce-high-quality-software/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/16/using-defence-in-depth-to-produce-high-quality-software/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 11:37:52 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=29</guid>
		<description><![CDATA[‘Defence in depth’ is a military strategy where the attacker is allowed to penetrate the defender’s lines, but is then gradually worn down by successive layers of defences. This strategy was famously used by the Soviet Army to halt the German blitzkrieg at the battle of Kursk, using a vast defensive network including trenches, minefields [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=29&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>‘Defence in depth’ is a military strategy where the attacker is allowed to penetrate the defender’s lines, but is then gradually worn down by successive layers of defences. This strategy was famously used by the Soviet Army to halt the German blitzkrieg at the battle of <a href="http://en.wikipedia.org/wiki/Battle_of_Kursk" target="_blank">Kursk</a>, using a vast defensive network including trenches, minefields and gun emplacements. Defence in depth also has parallels in non-military applications. I use a defence in depth approach to detect bugs in my code. A bug has to pass through multiple layers of defences undetected before it can cause problems for my customers.</p>
<h3>Layer 1: Compiler warnings</h3>
<p>Compiler warnings can help to spot many potential bugs. Crank your compiler warnings up to maximum sensitivity to get the most benefit.</p>
<h3>Layer 2: Static analysis</h3>
<p>Static analysis takes over where compiler warnings leave off, examining code in great detail looking for potential errors. An example static analyser is <a href="http://www.gimpel.com/" target="_blank">Gimpel PC-Lint for C and C++</a>. PC-Lint performs hundreds of checks for known issues in C/C++ code. The flip side of it’s thoroughness is that it can be difficult to spot real issues amongst the vast numbers of warnings and it can take some time to fine-tune the checking to a useful level.</p>
<h3>Layer 3: Code review</h3>
<p>A fresh set of eyes looking at your code will often spot problems that you didn’t see. There are various ways to go about this, including formal <a href="http://en.wikipedia.org/wiki/Fagan_inspection" target="_blank">Fagan inspections</a>, Extreme Programming style <a href="http://en.wikipedia.org/wiki/Pair_programming" target="_blank">pair programming</a> and informal reviews. There is quite a lot of documented evidence to suggest that this is one of the most effective ways to find bugs. It is also an excellent way to mentor less experienced programmers. But it is time consuming and can be hard on the ego of the person being reviewed. Also it isn’t really an option for solo developers</p>
<h3>Layer 4: Self-checking</h3>
<p>Of the vast space of states that a program can occupy, usually only a minority will be valid. E.g. it might makes no sense to set a zero or negative radius for a circle. We can check for invalid states in C/C++ with an assert() macro:</p>
<pre style="padding-left:30px;">class Circle
{
    public:
        void setRadius( double radius );
    private:
        double m_radius;
}

void Circle::setRadius( double radius )
{
    assert( radius &gt; 0.0 );
    m_radius = radius;
}</pre>
<p>The program will now halt with a warning message if the radius is set inappropriately. This can be very helpful for finding bugs during testing. Assertions can also be useful for setting pre-conditions and post-conditions:</p>
<pre>    void List::remove( Item* i )
    {
        assert( contains( i ) );
        ...
        assert( !contains( i ) );
    }</pre>
<p>Or detecting when an unexpected branch is executed:</p>
<pre>    switch ( shape )
    {
        case Shape::Square:
            ...
        break;

        case Shape::Rectangle:
            ...
        break;

        case Shape::Circle:
            ...
        break;

        case Shape::Ellipse:
            ...
        break;

        default:
            assert( false ); // shouldn't get here
        break;
    }</pre>
<p>Assertions are not compiled into release versions of the software, which means they don’t incur any overhead in production code. But this also means:</p>
<ul>
<li>Assertions are not a substitute for proper error handling. They should only be used to check for states that should never occur, regardless of the program input.</li>
<li>Calls to an assert() must not change the program state, or the debug and release versions will behave differently.</li>
</ul>
<p>Different languages have different approaches, for example pre and post conditions are built into the <a href="http://en.wikipedia.org/wiki/Eiffel_%28programming_language%29" target="_blank">Eiffel </a>language.</p>
<h3>Layer 5: Dynamic analysis</h3>
<p>Dynamic checking usually involves automatically instrumenting the code in some way so that it’s runtime behaviour can be checked for potential problems such as: array bound violations, reading memory that hasn’t be written to and memory leaks. An example dynamic analyser is the excellent and free <a href="http://valgrind.org/" target="_blank">Valgrind</a> for Linux. There are a few dynamic analysers for Windows, but they tend to be expensive. The only one I have tried in the last few years was <a href="http://www-306.ibm.com/software/awdtools/purify/" target="_blank">Purify</a> and it was flaky (do IBM/Rational actually use their own tools?).</p>
<h3>Layer 6: Unit testing</h3>
<p>Unit testing requires the creation of a test harness to execute various tests on a small unit of code (typically a class or function) and flag any errors. Ideally the unit tests should then be executed every time you make a change to the code. You can write your own test harnesses from scratch, but it probably makes more sense to use one of the existing frameworks, such as: NUnit (.NET), JUnit (Java), QUnit (Qt) etc.</p>
<p>According to the <a href="http://en.wikipedia.org/wiki/Test_driven_development" target="_blank">Test Driven Development</a> approach you should write your unit tests <span style="text-decoration:underline;">before</span> you write the code. This makes a lot of sense, but requires discipline.</p>
<h3>Layer 7: Integration testing</h3>
<p>Integration testing involves testing that different modules of the system work correctly together, particularly the interfaces between your code and hardware or third party libraries.</p>
<h3>Layer 8: System testing</h3>
<p>System testing is testing the system in it’s entirety, as delivered to the end-user. System testing can be done manually or automatically, using a test scripting tool.</p>
<p>Unit, integration and system testing should ideally be done using a coverage tool such as <a href="http://successfulsoftware.net/2008/03/10/coverage-validator/" target="_blank">Coverage Validator</a> to check that the testing is sufficiently thorough.</p>
<h3>Layer 9: Regression testing</h3>
<p>Regression testing involves running a series of tests and comparing the results to the same input data run on the previous release of the system. Any differences may be the result of bugs introduced since the last release. Regression testing works particularly well on systems that take a single input file and produce a single output file &#8211; the output file can just be diff’ed against the previous output.</p>
<h3>Layer 10: Third party testing</h3>
<p>Different users have different patterns of usage. You might prefer drag and drop, someone else might use right-click a lot and yet another person might prefer keyboard accelerators. So it would be unwise to release a system that has only ever been tested by the developer. Furthermore, the developer inevitably makes all sorts of assumptions about how the software will be used. Some of those assumptions will almost certainly be wrong.</p>
<p>There are a number of companies that can be paid by the day to do third party testing. I have used<a href="http://www.softwareexaminer.com/" target="_blank"> softwareexaminer.com</a> in the past with some success.</p>
<h3>Layer 11: Beta testing</h3>
<p>End-user systems can vary in processor speed, memory, screen resolution, video card, font size, language choice, operating system version/update level and installed software. So it is necessary to test your software on a representative range of supported hardware + operating system + installed software. Typically this is done by recruiting users who are keen to try out new features, for example through a newsletter. Unfortunately it isn’t always easy to get good feedback from beta testers.</p>
<h3>Layer 12: Crash reporting</h3>
<p>If each of the above 11 layers of defence catches 50% of the bugs missed by the previous layer, we would expect only 1 bug in 2,048 to make it into production code undetected. Assuming your coding isn’t spectacularly sloppy in the first place, you should end up with very few bugs in your production code. But, inevitably, some will still slip through. You can catch the ones that crash your software with built-in crash reporting. This is less than ideal for the person whose software crashed. But it allows you to get detailed feedback on crashes and consequently get fixes out much faster.</p>
<p>I rolled my own crash reporting for Windows and MacOSX. On Windows the magic function call is <a href="http://msdn.microsoft.com/en-us/library/ms680634%28VS.85%29.aspx" target="_blank">SetUnhandledExceptionFilter</a>. You can also sign up to the Windows Winqual program to receive crash reports via Windows’ own crash reporting. But, after my deeply demoralising encounter with Winqual as part of getting the “works with Vista” logo, I would rather take <a href="http://www.youtube.com/watch?v=wvsboPUjrGc" target="_blank">dance lessons from Steve Ballmer</a>.</p>
<h3>Test what you ship, ship what you test</h3>
<p>A change of a single byte in your binaries could be the difference between a solid release and a release with a showstopper bug. Consequently you should only ship the binaries you have tested. Don’t ship the release version after only having tested the debug version and don’t ship your software after a bug fix without re-doing the QA, no matter how ‘trivial’ the fix. Sometimes it is better to ship with minor (but known) bugs than to try to fix these bugs and risk introducing new (and potentially much worse) bugs.</p>
<h3>Cross-platform development</h3>
<p>I find that shipping my software on Windows and MacOSX from a single code base has advantages for QA.</p>
<ul>
<li>different tools with different strengths are available on each platform</li>
<li>the Gnu C++ compiler may warn about issues that the Visual Studio C++ compiler doesn’t (and vice versa)</li>
<li>a memory error that is intermittent and hard to track down on Windows might be much easier to find on MacOSX (and vice versa)</li>
</ul>
<h3>Conclusion</h3>
<p>For the best results you need your layers of checks to be part of your day-to-day development, not something you do just before a release. This is best done by automating them as much as possible, e.g.:</p>
<ul>
<li>setting the compiler to treat warnings as errors</li>
<li>performing static analysis and unit tests on code check-in</li>
<li>running regression tests on the latest version of the code every night</li>
</ul>
<p>Also you should design your software in such a way that it is easy to test. E.g. building in log file output can make it much easier to perform regression tests.</p>
<p>Defence in depth can find a high percentage of bugs. But obviously the more bugs you start with the more bugs that will end up in your code. So it doesn’t remove the need for good coding practices. Quality can’t be ‘tested in’ to code afterwards.</p>
<p>I have used all 12 layers of defence above at some point in my career. Currently I am not using static analysis (I must update that PC-Lint licence), code review (I am a solo developer) and dynamic analysis (I don’t currently have a dynamic analyser for Windows or MacOSX). I could also do better on unit testing. But according to my crash reporting, the latest version of <a href="http://www.perfecttableplan.com/" target="_blank">PerfectTablePlan</a> has crashed just three times in the last 5000+ downloads (the same bug each time, somewhere deep down in the Qt print engine). Not all customer click the ‘Submit’ button to send the crash reports and crashes aren’t the only type of bug, but I think this is indicative of a good level of quality. It is probably a lot better than most of the other consumer software my customers use[1]. Assuming the crash reporting isn’t buggy, of course…</p>
<p>Original Article at : http://successfulsoftware.net/2008/07/09/using-defence-in-depth-to-produce-high-quality-software/</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=29&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/16/using-defence-in-depth-to-produce-high-quality-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>CSLA Light preview release</title>
		<link>http://solutionevangelist.wordpress.com/2008/07/16/csla-light-preview-release/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/07/16/csla-light-preview-release/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 11:35:37 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=27</guid>
		<description><![CDATA[I have put a very early preview release of CSLA Light and CSLA .NET 3.6 online at www.lhotka.net/cslalight/download.aspx. There is no sample app at this point, so you&#8217;ll have to look at the unit tests in cslalighttest and cslatest to figure out how to use the various features. Obviously this is very early code, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=27&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have put a <em>very</em> early preview release of CSLA Light and CSLA .NET 3.6 online at <a href="http://www.lhotka.net/cslalight/download.aspx" target="_blank">www.lhotka.net/cslalight/download.aspx</a>.</p>
<p>There is no sample app at this point, so you&#8217;ll have to look at the unit tests in cslalighttest and cslatest to figure out how to use the various features.</p>
<p>Obviously this is <em>very</em> early code, but it is healthy to release early and often, so here we go <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One side-effect of our work with CSLA Light is that we discovered that testing asynchronous methods is really hard with nunit and MSTest, and impossible with the Silverlight unit test framework provided by Microsoft. And yet in Silverlight, async methods are commonly required, and for parity a number of async features are now also in CSLA .NET. And we need to have unit tests for them.</p>
<p>To address this issue, we ended up creating our own Silverlight unit testing framework, and an add-on framework for nunit or MSTest. This allows us to write a common set of test code that runs in both Silverlight and .NET so we can test both, and establish that we have parity between them.</p>
<p>Earier today, Justin split this testing framework out of CSLA and we put it up on CodePlex, calling it <a href="http://www.codeplex.com/UnitDriven" target="_blank">UnitDriven</a>. The <a href="http://www.lhotka.net/cslalight" target="_blank">CSLA Light project </a>and <a href="http://www.magenic.com/" target="_blank">Magenic</a> are donating the code to the community as an open-source project, because it can be used to build async unit tests for any app, not just for CSLA Light.</p>
<p>Original Article at : http://www.lhotka.net/weblog/CSLALightPreviewRelease.aspx</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=27&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/07/16/csla-light-preview-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
		<item>
		<title>Common Outsourcing Rates for Freelance Programming Services?</title>
		<link>http://solutionevangelist.wordpress.com/2008/05/05/common-outsourcing-rates-for-freelance-programming-services/</link>
		<comments>http://solutionevangelist.wordpress.com/2008/05/05/common-outsourcing-rates-for-freelance-programming-services/#comments</comments>
		<pubDate>Mon, 05 May 2008 02:51:24 +0000</pubDate>
		<dc:creator>solutionevangelist</dc:creator>
				<category><![CDATA[Freelance]]></category>
		<category><![CDATA[Outsource]]></category>

		<guid isPermaLink="false">http://solutionevangelist.wordpress.com/?p=23</guid>
		<description><![CDATA[Recently we are data-mining to find appropriate hourly rates for outsourcing services. We are launching a new outsourcing site and will attract customers towards it. My question to the readers if you can help(Specially indian counterparts), what is the ideal rate for Outsourcing in .NET world ? Let&#8217;s say we have a developer having 2 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=23&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently we are data-mining to find appropriate hourly rates for outsourcing services. We are launching a new outsourcing site and will attract customers towards it. My question to the readers if you can help(Specially indian counterparts), what is the ideal rate for Outsourcing in .NET world ?</p>
<p>Let&#8217;s say we have a developer having 2 years experience, what should be the rate ? What should be the rate for somene with 4 years, 6 years and 8 years of experience.</p>
<p>I have seen some freelance sites, where people work even at miserly 4$/hour! . I am leaning more towards $18/hour for our company. If you have similar requirements contact me at <a title="Click to Email" href="mailto:parag@iparag.com">parag@iparag.com</a> .To put things in perspective, we have expertise in ASP.NET 2.0, 3.5, C#, SQL Server 2005, Compact Framework development, Sharepoint development, Biztalk development, Flex development, Silverlight 2.0 Development etc. Our company name is DirectToIndia.</p>
<p>There is another breed of sites offering &#8220;dedicated&#8221; hire for a fixed monthly fee, where the client manages the resource basically the company just makes sure &#8220;dedicated&#8221; resources have regular attendance and are on time.</p>
<p>Any creative ideas are welcome. You can email me directly at <a title="Click to Email" href="mailto:parag@iparag.com">parag@iparag.com</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/solutionevangelist.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/solutionevangelist.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/solutionevangelist.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/solutionevangelist.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/solutionevangelist.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/solutionevangelist.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/solutionevangelist.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/solutionevangelist.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/solutionevangelist.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/solutionevangelist.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=solutionevangelist.wordpress.com&amp;blog=927361&amp;post=23&amp;subd=solutionevangelist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://solutionevangelist.wordpress.com/2008/05/05/common-outsourcing-rates-for-freelance-programming-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/029bb7c7b966ae1a269a6cd8b993b204?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">solutionevangelist</media:title>
		</media:content>
	</item>
	</channel>
</rss>
