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

--><generator uri="http://www.google.com/reader">Google Reader</generator><id>tag:google.com,2005:reader/user/17507267173923544060/state/com.google/broadcast</id><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><title>Koistya `Navin's shared items in Google Reader</title><gr:continuation>CLnQ9pnbiJ4C</gr:continuation><author><name>Koistya `Navin</name></author><updated>2009-11-15T21:05:38Z</updated><link rel="self" href="http://feeds.feedburner.com/koistya" type="application/atom+xml" /><feedburner:emailServiceId>koistya</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gr:crawl-timestamp-msec="1258319138523"><id gr:original-id="http://book.pdfchm.net/SQL-Server-2008-Administration-Instant-Reference/9780470496602/">tag:google.com,2005:reader/item/333dc4b5bd3b6948</id><title type="html">SQL Server 2008 Administration Instant Reference</title><published>2009-11-15T17:12:12Z</published><updated>2009-11-15T17:12:12Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/j_ldcA8mE4g/" type="text/html" /><summary xml:base="http://www.pdfchm.net/" type="html">9780470496602 (0470496606), Sybex, 2009
&lt;br&gt;
&lt;br&gt;&lt;p&gt;Perfect companion to any SQL Server 2008 book, providing fast, accurate answers on the spot for millions of IT professionals&lt;/p&gt;
&lt;p&gt;System and database administrators, IT consultants, and database application developers often need quick answers and practical solutions for SQL Server issues. This convenient guide offers you quick referencing for the product and database topics you need most.      &lt;/p&gt;
&lt;p&gt;If you're an IT administrator looking for the essentials in the day-to-day tasks of  administering SQL Server 2008, you'll appreciate this book's design for providing quick and easy look up of solutions and tables, lists, and step-by-step instructions for answers on the spot. &lt;em&gt;SQL Server 2008 Instant Administration Reference&lt;/em&gt; is a guide that you want to keep within reach.      &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;SQL Server is Microsoft's bestselling database manager; the 2008 version offers enhanced security and high availability, encouraging users to upgrade&lt;/li&gt;
    &lt;li&gt;Features thumb tabs, secondary and tertiary tables of contents, and special heading treatments to provide quick and easy lookup, as well as quick-reference tables and lists to provide answers on the spot&lt;/li&gt;
    &lt;li&gt;Covers installing, configuring, managing, and maintaining SQL Server; optimizing server performance; and troubleshooting&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;SQL Server 2008 Administration Instant Reference&lt;/em&gt; answers the questions you encounter most often in your daily work.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/learn-it/~4/ASfHoCnAe-A" height="1" width="1"&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><source gr:stream-id="feed/http://my.pdfchm.net/account/rss/"><id>tag:google.com,2005:reader/feed/http://my.pdfchm.net/account/rss/</id><title type="html">Today Books - PDFCHM Online</title><link rel="alternate" href="http://www.pdfchm.net/" type="text/html" /></source><feedburner:origLink>http://feeds.pdfchm.net/~r/learn-it/~3/ASfHoCnAe-A/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258318985752"><id gr:original-id="c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7255370">tag:google.com,2005:reader/item/20a978b040df3e31</id><category term="Web Development" scheme="http://weblogs.asp.net/johnkatsiotis/archive/tags/Web+Development/default.aspx" /><category term="ASP.NET" scheme="http://weblogs.asp.net/johnkatsiotis/archive/tags/ASP.NET/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/johnkatsiotis/archive/tags/C_2300_/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/johnkatsiotis/archive/tags/Silverlight/default.aspx" /><title type="html">Make your site run only in ONE Browser window(single instance)!</title><published>2009-11-15T10:49:00Z</published><updated>2009-11-15T10:49:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/9adGlfTkaBg/make-your-site-run-only-in-one-browser-window-single-instance.aspx" type="text/html" /><summary xml:base="http://weblogs.asp.net/" type="html">&lt;p&gt;While a was at Teched2009 and watching Tim Heuer presenting Silverlight 3 I noticed a new cool feature named Local Messaging! &lt;/p&gt;
  
&lt;p&gt;When I saw this new feature, a crazy idea crossed my mind. Could this be used in order to allow the user to open my website in only one browser window?&lt;/p&gt;
  
&lt;p&gt;The answer is yes! But not the way I first thought. Here is how (code in MainPage.xaml.cs):&lt;/p&gt;
  &lt;div style="border:1px solid silver;margin:20px 0px 10px;padding:4px;overflow:auto;text-align:left;line-height:12pt;background-color:rgb(244, 244, 244);width:97.5%;font-family:&amp;#39;Courier New&amp;#39;,courier,monospace;direction:ltr;max-height:200px;font-size:8pt"&gt;   
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;text-align:left;line-height:12pt;background-color:rgb(244, 244, 244);width:100%;font-family:&amp;#39;Courier New&amp;#39;,courier,monospace;direction:ltr;color:black;font-size:8pt"&gt;&lt;span style="color:rgb(0, 0, 255)"&gt;string&lt;/span&gt; _localName = &lt;span style="color:rgb(0, 96, 128)"&gt;"SL App"&lt;/span&gt;;&lt;br&gt;&lt;span style="color:rgb(0, 0, 255)"&gt;bool&lt;/span&gt; _Close = &lt;span style="color:rgb(0, 0, 255)"&gt;false&lt;/span&gt;;&lt;br&gt;&lt;br&gt;&lt;span style="color:rgb(0, 0, 255)"&gt;public&lt;/span&gt; MainPage()&lt;br&gt;{&lt;br&gt;   InitializeComponent();&lt;br&gt;&lt;br&gt;   Loaded += &lt;span style="color:rgb(0, 0, 255)"&gt;new&lt;/span&gt; RoutedEventHandler(MainPage_Loaded);&lt;br&gt;   &lt;span style="color:rgb(0, 0, 255)"&gt;try&lt;/span&gt;&lt;br&gt;   {&lt;br&gt;       LocalMessageReceiver incomingMessage = &lt;span style="color:rgb(0, 0, 255)"&gt;new&lt;/span&gt; LocalMessageReceiver(_localName);&lt;br&gt;       &lt;span style="color:rgb(0, 128, 0)"&gt;//Start listening&lt;/span&gt;&lt;br&gt;       incomingMessage.Listen();&lt;br&gt;   }&lt;br&gt;   &lt;span style="color:rgb(0, 0, 255)"&gt;catch&lt;/span&gt; (ListenFailedException)&lt;br&gt;   {&lt;br&gt;       _Close = &lt;span style="color:rgb(0, 0, 255)"&gt;true&lt;/span&gt;;&lt;br&gt;   }            &lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style="color:rgb(0, 0, 255)"&gt;protected&lt;/span&gt; &lt;span style="color:rgb(0, 0, 255)"&gt;void&lt;/span&gt; MainPage_Loaded(&lt;span style="color:rgb(0, 0, 255)"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br&gt;{&lt;br&gt;   &lt;span style="color:rgb(0, 0, 255)"&gt;if&lt;/span&gt; (_Close)&lt;br&gt;   {&lt;br&gt;       HtmlPage.Window.SetProperty(&lt;span style="color:rgb(0, 96, 128)"&gt;"location"&lt;/span&gt;, &lt;span style="color:rgb(0, 96, 128)"&gt;"/InfoMessage.aspx"&lt;/span&gt;);&lt;br&gt;   }&lt;br&gt;   &lt;span style="color:rgb(0, 0, 255)"&gt;else&lt;/span&gt;&lt;br&gt;   {&lt;br&gt;       LocalMessageSender msgSender = &lt;span style="color:rgb(0, 0, 255)"&gt;new&lt;/span&gt; LocalMessageSender(_localName);&lt;br&gt;       msgSender.SendAsync(&lt;span style="color:rgb(0, 96, 128)"&gt;"New instance loaded"&lt;/span&gt;);&lt;br&gt;   }&lt;br&gt;}&lt;/pre&gt;
  &lt;br&gt;&lt;/div&gt;

&lt;p&gt;Loading Default.aspx&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/johnkatsiotis/image_401E0BA8.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/johnkatsiotis/image_thumb_0960B0A4.png" style="border-width:0px;display:inline" title="image" alt="image" border="0" height="255" width="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the first link 
  &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/johnkatsiotis/image_75671E0D.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/johnkatsiotis/image_thumb_539B457C.png" style="border-width:0px;display:inline" title="image" alt="image" border="0" height="297" width="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Then on the second link&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/johnkatsiotis/image_1CDDEA78.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/johnkatsiotis/image_thumb_5AF70529.png" style="border-width:0px;display:inline" title="image" alt="image" border="0" height="281" width="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Those are the files in the solution&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/johnkatsiotis/image_5FF942D8.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/johnkatsiotis/image_thumb_175F5407.png" style="border-width:0px;display:inline" title="image" alt="image" border="0" height="294" width="294"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;That’s an exception driven solution but works for me! :) &lt;/p&gt;

&lt;p&gt;This works also across different browsers but if you want you can changed to allow one instance per browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://john.katsiotis.com/samples/SingletonWebAppManager.zip"&gt;Here are the solution files.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fjohnkatsiotis%2farchive%2f2009%2f11%2f14%2fmake-your-site-run-only-in-one-browser-window-single-instance.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fjohnkatsiotis%2farchive%2f2009%2f11%2f14%2fmake-your-site-run-only-in-one-browser-window-single-instance.aspx&amp;amp;fgcolor=000000&amp;amp;bgcolor=CCFF00&amp;amp;cfgcolor=333333" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7255370" width="1" height="1"&gt;</summary><author><name>djsolid</name></author><gr:likingUser>09308414162779039699</gr:likingUser><source gr:stream-id="feed/http://weblogs.asp.net/MainFeed.aspx"><id>tag:google.com,2005:reader/feed/http://weblogs.asp.net/MainFeed.aspx</id><title type="html">ASP.NET Weblogs</title><link rel="alternate" href="http://weblogs.asp.net/" type="text/html" /></source><feedburner:origLink>http://weblogs.asp.net/johnkatsiotis/archive/2009/11/15/make-your-site-run-only-in-one-browser-window-single-instance.aspx</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258318939139"><id gr:original-id="tag:blogger.com,1999:blog-15136575.post-1394506758877349">tag:google.com,2005:reader/item/42ad53cad2719947</id><title type="html">Fun with Linq Aggregate</title><published>2009-11-15T11:40:00Z</published><updated>2009-11-15T11:40:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/Dypyo8qiXUM/fun-with-linq-aggregate.html" type="text/html" /><summary xml:base="http://mikehadlow.blogspot.com/" type="html">&lt;p&gt;Say we’ve got a CSV file:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;const&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; csv = 
&lt;span style="color:#006080"&gt;@&amp;quot;1,2,3,4,5
6,7,8,9,10
11,12,13,14,15
16,17,18,19,20&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;We want to parse it into nested List&amp;lt;int&amp;gt;, and then print out all the numbers on a single line. We might do it like this:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; ParseCsvAndOutputAsString()
{
    var data = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; List&amp;lt;List&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt;&amp;gt;();

    &lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (var line &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; csv.Split(&lt;span style="color:#006080"&gt;'\n'&lt;/span&gt;))
    {
        var innerList = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt;();
        &lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (var item &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; line.Split(&lt;span style="color:#006080"&gt;','&lt;/span&gt;))
        {
            innerList.Add(&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.Parse(item));
        }
        data.Add(innerList);
    }

    &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; output = &lt;span style="color:#006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
    &lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (var innerList &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; data)
    {
        &lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (var item &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; innerList)
        {
            output = &lt;span style="color:#0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#006080"&gt;&amp;quot;{0} {1}&amp;quot;&lt;/span&gt;, output, item);
        }
    }

    Console.WriteLine(output);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Yes, I know I should use a StringBuilder and AddRange, but ignore that for the moment, I’m trying to make a point here. &lt;/p&gt;

&lt;p&gt;Taking a collection of values and reducing them down to a single value is a very common task in programming. Here we’re doing it twice; first we’re taking a string, splitting it apart and then reducing it down to a single reference to a List&amp;lt;List&amp;lt;int&amp;gt;&amp;gt;; then we’re taking the may items of data and reducing them to a string.&lt;/p&gt;

&lt;p&gt;This is so common in fact, that many programming languages have some kind of ‘reduce’ functionality built in. It’s especially common with functional languages. Did you know that C# also has a reduce function? It’s the Aggregate extension method. Here’s the same method written in two statements with it:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;[Test]
&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; ParseCsvAndOutputAsStringUsingAgregate()
{
    var data = csv
        .Split(&lt;span style="color:#006080"&gt;'\n'&lt;/span&gt;)
        .Aggregate(
            &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; List&amp;lt;List&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt;&amp;gt;(),
            (list, line) =&amp;gt; list.Append(line
                .Split(&lt;span style="color:#006080"&gt;','&lt;/span&gt;)
                .Select(str =&amp;gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.Parse(str))
                .Aggregate(
                    &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt;(),
                    (innerList, item) =&amp;gt; innerList.Append(item))));

    Console.WriteLine(data
        .SelectMany(innerList =&amp;gt; innerList)
        .Aggregate(&lt;span style="color:#006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, (output, item) =&amp;gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#006080"&gt;&amp;quot;{0} {1}&amp;quot;&lt;/span&gt;, output, item)));
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Aggregate takes two parameters; the first sets up the initial value, in our case we create new instances of List&amp;lt;List&amp;lt;int&amp;gt;&amp;gt;, List&amp;lt;int&amp;gt; and an empty string, this is known as the ‘accumulator’; the second is the function that does the accumulating.&lt;/p&gt;

&lt;p&gt;Aggregate works really well with fluent interfaces, where methods return their instance. I’ve added a fluent ‘Append’ extension method to List&amp;lt;int&amp;gt; to help me here:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; List&amp;lt;T&amp;gt; Append&amp;lt;T&amp;gt;(&lt;span style="color:#0000ff"&gt;this&lt;/span&gt; List&amp;lt;T&amp;gt; list, T item)
{
    list.Add(item);
    &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; list;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;So any time you’ve got a collection of stuff that you want to ‘reduce’ to a single item, remember Aggregate.&lt;/p&gt;  &lt;div&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/15136575-1394506758877349?l=mikehadlow.blogspot.com"&gt;&lt;/div&gt;</summary><author><name>noreply@blogger.com (Mike Hadlow)</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/CodeRant"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/CodeRant</id><title type="html">Code rant</title><link rel="alternate" href="http://mikehadlow.blogspot.com/" type="text/html" /></source><feedburner:origLink>http://feedproxy.google.com/~r/CodeRant/~3/A7VjcEoiCqM/fun-with-linq-aggregate.html</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258243501463"><id gr:original-id="c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7254743">tag:google.com,2005:reader/item/bc4965541cfc8283</id><category term="Visual Studio" scheme="http://weblogs.asp.net/hosamkamel/archive/tags/Visual+Studio/default.aspx" /><category term="Visual Studio 2010" scheme="http://weblogs.asp.net/hosamkamel/archive/tags/Visual+Studio+2010/default.aspx" /><category term=".NET 4.0" scheme="http://weblogs.asp.net/hosamkamel/archive/tags/.NET+4.0/default.aspx" /><title type="html">[Tip] Enable Visual Studio 2010 Online Template/Extension usage</title><published>2009-11-14T20:16:51Z</published><updated>2009-11-14T20:16:51Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/duzf0QTaVOY/tip-enable-visual-studio-2010-online-template-extension-usage.aspx" type="text/html" /><summary xml:base="http://weblogs.asp.net/" type="html">&lt;p&gt;Microsoft Visual Studio 2010 uses a new feature called the Extension Manager to add, remove, enable, and disable Visual Studio extensions. The Extension manager has a UI similar to that of the Windows Control Panel, and can be opened from the Tools menu in Visual Studio by selecting Extension Manager….&lt;/p&gt;  &lt;p&gt;In addition, third party templates may now be installed from the &lt;a href="http://msdn.microsoft.com/en-us/library/3twwby8d(VS.100).aspx"&gt;New Project Dialog Box&lt;/a&gt; by clicking Search Online Templates… in the Templates pane.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;To Enable Online Extensions download and usage, follow the below steps:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;From Visual Studio 2010 go to Options&lt;/li&gt;    &lt;li&gt;Extension Manager&lt;/li&gt;    &lt;li&gt;Check “Load per used extensions when running as administrator”&lt;a href="http://weblogs.asp.net/blogs/hosamkamel/image_4262B3FB.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/hosamkamel/image_thumb_744A2EB8.png" width="244" height="144"&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; if you don’t have this option installed Visual Studio will notify you when selecting “Online Templates” from New Project dialog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/hosamkamel/image_398285E2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px" title="image" border="0" alt="image" align="left" src="http://weblogs.asp.net/blogs/hosamkamel/image_thumb_6C61F07C.png" width="244" height="154"&gt;&lt;/a&gt;&lt;a href="http://weblogs.asp.net/blogs/hosamkamel/image_0D91E659.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/hosamkamel/image_thumb_1AE7D392.png" width="244" height="154"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="margin:0px;padding:0px 0px 0px 0px"&gt;&lt;br&gt;&lt;br&gt;
&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7254743" width="1" height="1"&gt;</summary><author><name>HosamKamel</name></author><source gr:stream-id="feed/http://weblogs.asp.net/MainFeed.aspx"><id>tag:google.com,2005:reader/feed/http://weblogs.asp.net/MainFeed.aspx</id><title type="html">ASP.NET Weblogs</title><link rel="alternate" href="http://weblogs.asp.net/" type="text/html" /></source><feedburner:origLink>http://weblogs.asp.net/hosamkamel/archive/2009/11/14/tip-enable-visual-studio-2010-online-template-extension-usage.aspx</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258243489953"><id gr:original-id="">tag:google.com,2005:reader/item/04eb4e1b5e41f7ea</id><title type="html">Digital Photography For The Web</title><published>2009-11-15T00:04:49Z</published><updated>2009-11-15T00:04:49Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/5e43TkK-Yv8/0980576873" type="text/html" /><summary xml:base="http://www.riaguy.com/books/rss/" type="html">&lt;table border="0" cellspacing="0" cellpadding="0" width="100%"&gt;&lt;tr&gt;&lt;td style="width:160px;text-align:right;vertical-align:top"&gt;&lt;br&gt;&lt;br&gt;&lt;img src="http://ecx.images-amazon.com/images/I/51Za0TXicvL._SL140_.jpg" alt="" style="border-style:none;width:109px;height:140px"&gt;&lt;/td&gt;&lt;td style="width:12px"&gt;   &lt;/td&gt;&lt;td style="vertical-align:top;font-family:&amp;#39;Verdana&amp;#39;"&gt;&lt;h1&gt;Digital Photography For The Web&lt;/h1&gt;&lt;p&gt;&lt;small&gt;Published on &lt;strong&gt;Nov 15, 2009&lt;/strong&gt; by &lt;a href="http://www.amazon.com/gp/search/?SubscriptionId=1T51FF433MVEQZEKEA82&amp;amp;search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-publisher=SitePoint&amp;amp;sort=relevancerank&amp;amp;tag=riaguy-20"&gt;SitePoint&lt;/a&gt;. Author(s): &lt;a href="http://www.amazon.com/gp/search/?SubscriptionId=1T51FF433MVEQZEKEA82&amp;amp;search-alias=stripbooks&amp;amp;unfiltered=1&amp;amp;field-author=Paul+Duncanson&amp;amp;sort=relevancerank&amp;amp;tag=riaguy-20"&gt;Paul Duncanson&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;p&gt;A hands-on on guide to digital photography, with a practical focus on the Web. Readers will learn how to make the most of their digital camera, while learning the basics of composition, exposures, filters and more. Photography is an incredibly hot category, but no book on the market takes into account the millions of people who use their digital cameras for the explicit purpose of using the images on the Web – whether sharing with their friends via Facebook and Flickr to taking product shots and participating in stock photography sites like iStockPhoto and Fotolia.&lt;/p&gt;&lt;p&gt;&lt;small&gt;&lt;a href="http://www.riaguy.com/books/"&gt;&lt;strong&gt;More Books...&lt;/strong&gt;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><source gr:stream-id="feed/http://feeds.feedburner.com/riabooks"><id>tag:google.com,2005:reader/feed/http://feeds.feedburner.com/riabooks</id><title type="html">The Latest Web Development Books</title><link rel="alternate" href="http://www.riaguy.com/books/rss/" type="text/html" /></source><feedburner:origLink>http://www.amazon.com/Digital-Photography-Web-Paul-Duncanson/dp/0980576873?SubscriptionId=1T51FF433MVEQZEKEA82&amp;tag=riaguy-20&amp;linkCode=sp1&amp;camp=2025&amp;creative=165953&amp;creativeASIN=0980576873</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141474847"><id gr:original-id="http://book.pdfchm.net/Windows-PowerShell-2-For-Dummies-Computer-Tech/9780470371985/">tag:google.com,2005:reader/item/88e400bbe2700ebc</id><title type="html">Windows PowerShell 2 For Dummies (Computer/Tech)</title><published>2009-11-12T15:10:55Z</published><updated>2009-11-12T15:10:55Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/XyIM6ffXYIY/" type="text/html" /><summary xml:base="http://www.pdfchm.net/" type="html">9780470371985 (0470371986), For Dummies, 2009
&lt;br&gt;
&lt;br&gt;&lt;p&gt;Prepare for the future of Microsoft automation with this no-nonsense guide&lt;/p&gt;
&lt;p&gt;Windows PowerShell 2 is the scripting language that enables automation within the Windows operating system. Packed with powerful new features, this latest version is complex, and &lt;em&gt;Windows PowerShell 2 For Dummies&lt;/em&gt; is the perfect guide to help system administrators get up to speed.      &lt;/p&gt;
&lt;p&gt;Written by a Microsoft MVP with direct access to the program managers and developers, this book covers every new feature of Windows PowerShell 2 in a friendly, easy-to-follow format.      &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Windows PowerShell 2 is the updated scripting language that enables system administrators to automate Windows operating systems&lt;/li&gt;
    &lt;li&gt;System administrators with limited scripting experience will find this book helps them learn the fundamentals of Windows PowerShell 2 quickly and easily&lt;/li&gt;
    &lt;li&gt;Translates the jargon and complex syntax of Windows PowerShell 2 &lt;/li&gt;
    &lt;li&gt;Covers script debugging improvements, the ability to invoke commands remotely, and the new user interface&lt;/li&gt;
    &lt;li&gt;Uses real-world applications to clarify the theory, fundamentals, and techniques of the scripting language&lt;/li&gt;
    &lt;li&gt;Written by a Microsoft MVP with direct access to the developers of Windows PowerShell 2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Windows PowerShell 2 For Dummies&lt;/em&gt; makes this tool easily accessible to administrators of every experience level.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/learn-it/~4/uO3IsWk6GcA" height="1" width="1"&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><source gr:stream-id="feed/http://my.pdfchm.net/account/rss/"><id>tag:google.com,2005:reader/feed/http://my.pdfchm.net/account/rss/</id><title type="html">Today Books - PDFCHM Online</title><link rel="alternate" href="http://www.pdfchm.net/" type="text/html" /></source><feedburner:origLink>http://feeds.pdfchm.net/~r/learn-it/~3/uO3IsWk6GcA/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141462255"><id gr:original-id="http://book.pdfchm.net/ASP-NET-MVC-1-0-Test-Driven-Development-Problem-Design-Solution-Wrox-Programmer-to-Programmer/9780470447628/">tag:google.com,2005:reader/item/5a0c1f555f63e982</id><title type="html">ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution (Wrox Programmer to Programmer)</title><published>2009-11-12T15:12:24Z</published><updated>2009-11-12T15:12:24Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/f8F6bRcDzP4/" type="text/html" /><summary xml:base="http://www.pdfchm.net/" type="html">9780470447628 (0470447621), Wrox Press, 2009
&lt;br&gt;
&lt;br&gt;&lt;strong&gt;A hands-on journey takes you through the development process of a Web application from concept to production&lt;/strong&gt;
&lt;p&gt;    ASP.NET MVC is a new Web development framework created by Microsoft as an alternative to ASP.NET web forms applications. MVC is well suited to testability, and Test Driven Development (TDD) affords you a generous level of control while also making MVC very powerful and extensible. This book takes the ASP.NET MVC and combines it with a testing methodology and tools and guides you through the process of taking Web application from concept to production.    &lt;/p&gt;
&lt;p&gt;    Using a complete working sample application that demonstrates all the tools needed to build an e-commerce Web application, the popular Problem – Design – Solution format gradually introduces you to new alternative tools, frameworks, and methodologies to get you started creating cutting-edge Web applications.      &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;ASP.NET MVC is Microsoft's hot new Web development framework to use as an alternative to ASP.NET Web forms applications      &lt;/li&gt;
    &lt;li&gt;Use the popular Problem – Design – Solution recipe and encourages you to get involved with developing a Web application from concept to production      &lt;/li&gt;
    &lt;li&gt;Introduces new alternative tools, frameworks, and methodologies, such as nUnit and Inversion of Control containers      &lt;/li&gt;
    &lt;li&gt;Shows you how to use open source JavaScript libraries and work with a mocking framework      &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;    As you work with all facets of Web application development-requirements, design, testing, deployment, beta releases, refactoring, tool, and framework selection-you will have developed a live Web application by the time the book is finished.    &lt;/p&gt;
&lt;p&gt;    &lt;strong&gt;Note:&lt;/strong&gt; CD-ROM/DVD and other supplementary materials are not included as part of eBook file.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/learn-it/~4/ILEnix5kUfs" height="1" width="1"&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><source gr:stream-id="feed/http://my.pdfchm.net/account/rss/"><id>tag:google.com,2005:reader/feed/http://my.pdfchm.net/account/rss/</id><title type="html">Today Books - PDFCHM Online</title><link rel="alternate" href="http://www.pdfchm.net/" type="text/html" /></source><feedburner:origLink>http://feeds.pdfchm.net/~r/learn-it/~3/ILEnix5kUfs/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141452010"><id gr:original-id="http://book.pdfchm.net/Ultra-fast-ASP-NET-Build-Ultra-Fast-and-Ultra-Scalable-Websites-Using-ASP-NET-and-SQL-Server/9781430223832/">tag:google.com,2005:reader/item/9b2ad1b64f02f98a</id><title type="html">Ultra-fast ASP.NET: Build Ultra-Fast and Ultra-Scalable Websites Using ASP.NET and SQL Server</title><published>2009-11-12T15:14:55Z</published><updated>2009-11-12T15:14:55Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/E5xk4LDSN8c/" type="text/html" /><summary xml:base="http://www.pdfchm.net/" type="html">9781430223832 (1430223839), Apress, 2009
&lt;br&gt;
&lt;br&gt;&lt;p&gt;&lt;em&gt;Ultra-Fast ASP.NET&lt;/em&gt; presents a practical approach to building fast and scalable web sites using ASP.NET and SQL Server. In addition to a wealth of tips, tricks and secrets, you&amp;#39;ll find advice and code examples for all tiers of your application, including the client, caching, IIS 7, ASP.NET, threads, session state, SQL Server, Analysis Services, infrastructure and operations. By applying the ultra-fast approach to your projects, you’ll squeeze every last ounce of performance out of your code and infrastructure—giving your site unrivaled speed. &lt;/p&gt;
&lt;p&gt;The approach is mostly prescriptive; rather than drowning you in options, the book presents and explains specific high-impact recommendations and demonstrates them with detailed examples. Using this knowledge, you will soon be building high-performance web sites that scale easily as your site grows.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/learn-it/~4/mVp1h9tFp0k" height="1" width="1"&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><source gr:stream-id="feed/http://my.pdfchm.net/account/rss/"><id>tag:google.com,2005:reader/feed/http://my.pdfchm.net/account/rss/</id><title type="html">Today Books - PDFCHM Online</title><link rel="alternate" href="http://www.pdfchm.net/" type="text/html" /></source><feedburner:origLink>http://feeds.pdfchm.net/~r/learn-it/~3/mVp1h9tFp0k/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141446346"><id gr:original-id="http://book.pdfchm.net/Pro-SQL-Server-2008-Mirroring/9781430224235/">tag:google.com,2005:reader/item/2e7db450ae18c451</id><title type="html">Pro SQL Server 2008 Mirroring</title><published>2009-11-12T15:16:14Z</published><updated>2009-11-12T15:16:14Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/Y38KOCEuA1Y/" type="text/html" /><summary xml:base="http://www.pdfchm.net/" type="html">9781430224235 (1430224231), Apress, 2009
&lt;br&gt;
&lt;br&gt;&lt;p&gt;&lt;em&gt;Pro SQL Server 2008 Mirroring&lt;/em&gt; is your complete guide to planning, using, deploying, and maintaining database mirroring as a high-availability option. Mirroring protects you by maintaining one or more duplicate copies of your database for use in the event the primary copy is damaged. It is a key component of any production-level, high-availability solution. This book covers the full spectrum of database mirroring, taking you from the planning phase through the implementation to the maintenance phase and beyond.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Easy to follow, step-by-step instructions for beginner and intermediate users&lt;/li&gt;
    &lt;li&gt;In-depth, detailed information for advanced and expert users&lt;/li&gt;
    &lt;li&gt;Covers all phases of database mirroring from planning to sustained maintenance&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/learn-it/~4/NDb95sfTxik" height="1" width="1"&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><source gr:stream-id="feed/http://my.pdfchm.net/account/rss/"><id>tag:google.com,2005:reader/feed/http://my.pdfchm.net/account/rss/</id><title type="html">Today Books - PDFCHM Online</title><link rel="alternate" href="http://www.pdfchm.net/" type="text/html" /></source><feedburner:origLink>http://feeds.pdfchm.net/~r/learn-it/~3/NDb95sfTxik/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141331392"><id gr:original-id="c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7250520">tag:google.com,2005:reader/item/839fb30439b0ce59</id><category term="C#" scheme="http://weblogs.asp.net/fredriknormen/archive/tags/C_2300_/default.aspx" /><category term=".Net" scheme="http://weblogs.asp.net/fredriknormen/archive/tags/.Net/default.aspx" /><category term="VS2010" scheme="http://weblogs.asp.net/fredriknormen/archive/tags/VS2010/default.aspx" /><title type="html">.NET 4.0 is to Lazy</title><published>2009-11-10T13:10:00Z</published><updated>2009-11-10T13:10:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/0l7cfxFvlBA/net-4-0-is-to-lazy.aspx" type="text/html" /><summary xml:base="http://weblogs.asp.net/" type="html">&lt;p&gt;With .NET 4.0 there is a new class added to the System namespace called Lazy&amp;lt;T&amp;gt;. This class is what the name says, lazy. Here is an example where Lazy is used: &lt;br&gt;&lt;/p&gt;&lt;pre&gt;var lazy = &lt;span&gt;new&lt;/span&gt; Lazy&amp;lt;IList&amp;lt;OrderRow&amp;gt;&amp;gt;(
                                () =&amp;gt;
                                {
                                        var rows = &lt;span&gt;//get order rows;&lt;/span&gt;
                                        &lt;span&gt;return&lt;/span&gt; rows;
                                });

var rows = lazy.Value;&lt;/pre&gt;


&lt;p&gt;&lt;br&gt;The Lazy&amp;lt;T&amp;gt;’s constructor can take a Func&amp;lt;T&amp;gt; as an argument, the function passed as an argument to the contractor will first be invoked when the Value property of the Lazy&amp;lt;T&amp;gt; class is used, but not invoked the next time the Value property is used. The code above will first execute the function passed as an argument when the we request the value of the Lazy&amp;lt;T&amp;gt;, the returned value of the function will be cached. The next time Value is used, the function will not be invoked, instead the cached value will be returned. This class  can for example be used when we want some kind of Lazy Loading.&lt;/p&gt;
&lt;p&gt;I’m on twitter: &lt;a href="http://www.twitter.com/fredrikn"&gt;http://www.twitter.com/fredrikn&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7250520" width="1" height="1"&gt;</summary><author><name>Fredrik N</name></author><gr:likingUser>06602180506123390746</gr:likingUser><gr:likingUser>18281847282686570686</gr:likingUser><source gr:stream-id="feed/http://weblogs.asp.net/MainFeed.aspx"><id>tag:google.com,2005:reader/feed/http://weblogs.asp.net/MainFeed.aspx</id><title type="html">ASP.NET Weblogs</title><link rel="alternate" href="http://weblogs.asp.net/" type="text/html" /></source><feedburner:origLink>http://weblogs.asp.net/fredriknormen/archive/2009/11/10/net-4-0-is-to-lazy.aspx</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141254590"><id gr:original-id="http://channel9.msdn.com/posts/kmcgrath/New-MSDN-Library-views/">tag:google.com,2005:reader/item/4f7f13480fc26796</id><category term="MSDN Library" /><category term="Visual Studio" /><category term="Visual Studio 2010" /><title type="html">New MSDN Library views</title><published>2009-11-06T23:07:00Z</published><updated>2009-11-06T23:07:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/NaRICTCMZ7k/" type="text/html" /><media:group><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_ch9.mp4" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_ch9.mp3" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_ch9.mp4" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_ch9.wma" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_2MB_ch9.wmv" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_512_ch9.png" /><media:content url="http://ss.channel9.msdn.com/ch9/4/5/5/4/0/5/MSDNLibraryViews.ism/Manifest" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_2MB_ch9.wmv" /></media:group><summary xml:base="http://channel9.msdn.com/Media/Videos/" type="html">&lt;img src="http://ecn.channel9.msdn.com/o9/ch9/4/5/5/4/0/5/MSDNLibraryViews_85_ch9.png" border="0"&gt;&lt;p&gt;In this video, Mark D'Urso, a Senior Development Lead on the Library Experience Team, demonstrates the new Library views on MSDN:  &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd831853(VS.100,lightweight).aspx"&gt;Lightweight view&lt;/a&gt;  &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd831853(VS.100,loband).aspx"&gt;ScriptFree view&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd831853(VS.100,classic).aspx"&gt;Classic view&lt;/a&gt;&lt;br&gt;
      &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Kathleen McGrath&lt;br&gt;
Visual Studio User Education&lt;br&gt;
&lt;a href="http://blogs.msdn.com/kathleen"&gt;http://blogs.msdn.com/kathleen&lt;/a&gt;&lt;br&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkID=102169"&gt;Visual Studio and .NET Framework Content Survey&lt;/a&gt;&lt;/p&gt;&lt;img src="http://channel9.msdn.com/504554/WebViewBug.aspx?EVT=0" height="1" width="1" alt=""&gt;</summary><author><name>Kathleen McGrath</name></author><source gr:stream-id="feed/http://channel9.msdn.com/rss.aspx?ForumID=14&amp;Mode=0&amp;sortby=0&amp;sortorder=1"><id>tag:google.com,2005:reader/feed/http://channel9.msdn.com/rss.aspx?ForumID=14&amp;Mode=0&amp;sortby=0&amp;sortorder=1</id><title type="html">videos - Channel 9</title><link rel="alternate" href="http://channel9.msdn.com/Media/Videos/" type="text/html" /></source><feedburner:origLink>http://channel9.msdn.com/posts/kmcgrath/New-MSDN-Library-views/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141154589"><id gr:original-id="http://msdn.microsoft.com/magazine/4cfa4870-b515-4979-85ba-253338e403f6">tag:google.com,2005:reader/item/452b9e3daf9f8826</id><title type="html">Inside Microsoft patterns &amp;amp; practices: Dependency Injection in Libraries</title><published>2009-11-16T00:00:00Z</published><updated>2009-11-16T00:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/_a1HtbPvRIM/4cfa4870-b515-4979-85ba-253338e403f6" type="text/html" /><summary xml:base="http://www.msdnmagazine.com/" type="html">November 2009&lt;br&gt;&lt;br&gt;This article discusses how to write a library or framework that uses the Dependency Injection pattern and how the change in focus affects the usage of the pattern.</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:likingUser>16810806341071424900</gr:likingUser><source gr:stream-id="feed/http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?issue=tue"><id>tag:google.com,2005:reader/feed/http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?issue=tue</id><title type="html">MSDN Magazine RSS Feed:</title><link rel="alternate" href="http://www.msdnmagazine.com" type="text/html" /></source><feedburner:origLink>http://msdn.microsoft.com/magazine/4cfa4870-b515-4979-85ba-253338e403f6</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258141101834"><id gr:original-id="http://msdn.microsoft.com/magazine/3fc94394-227a-4781-a4aa-6ca95ff0107a">tag:google.com,2005:reader/item/171ee37d2d464492</id><title type="html">N-Tier Apps and the Entity Framework: Building N-Tier Apps with EF4</title><published>2009-11-16T00:00:00Z</published><updated>2009-11-16T00:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/r0l0C-tg7Yw/3fc94394-227a-4781-a4aa-6ca95ff0107a" type="text/html" /><summary xml:base="http://www.msdnmagazine.com/" type="html">November 2009&lt;br&gt;&lt;br&gt;This article is the third in a series about n-tier programming with the Entity Framework, specifically about building custom Web services with the Entity Framework and WCF. This article looks at features coming in the second release of the Entity Framework (EF4) and how you use them to implement the Self-Tracking Entities and Data Transfer Objects (DTOs) n-tier patterns.</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:likingUser>16810806341071424900</gr:likingUser><source gr:stream-id="feed/http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?issue=tue"><id>tag:google.com,2005:reader/feed/http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?issue=tue</id><title type="html">MSDN Magazine RSS Feed:</title><link rel="alternate" href="http://www.msdnmagazine.com" type="text/html" /></source><feedburner:origLink>http://msdn.microsoft.com/magazine/3fc94394-227a-4781-a4aa-6ca95ff0107a</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140924312"><id gr:original-id="c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7250824">tag:google.com,2005:reader/item/fd522976dbb51df0</id><category term="SOLID" scheme="http://weblogs.asp.net/drohrer/archive/tags/SOLID/default.aspx" /><category term="General Software Development" scheme="http://weblogs.asp.net/drohrer/archive/tags/General+Software+Development/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/drohrer/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/drohrer/archive/tags/.NET/default.aspx" /><category term="Refactoring" scheme="http://weblogs.asp.net/drohrer/archive/tags/Refactoring/default.aspx" /><title type="html">In response to "The Dangers of Single Responsibility in Programming"</title><published>2009-11-10T19:55:00Z</published><updated>2009-11-10T19:55:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/BjXfGlIkGuA/in-response-to-quot-the-dangers-of-single-responsibility-in-programming-quot.aspx" type="text/html" /><summary xml:base="http://weblogs.asp.net/" type="html">&lt;p&gt;David Cooksey writes an interesting article titled "&lt;a href="http://www.thycotic.com/the-dangers-of-single-responsibility-in-programming"&gt;The Dangers of Single Responsibility in Programming&lt;/a&gt;&amp;quot; in which he proposes that there is a certain level of granularity below which SRP is not appropriate.  Although I understand where he&amp;#39;s coming from, I tend to disagree with his conclusion, and I think it&amp;#39;s because his hypothetical programmer didn&amp;#39;t actually find the right responsibilities, not because the method was already granular enough.  I&amp;#39;d propose a slightly different breakdown of the responsibilities, leveraging Inversion of Control and creating several Pricing Calculators that each handle a different kind of discount (In his scenario, there are Sales prices and Gold Level Discounts).  I would see each of these items as their own calculator, and a separate &amp;quot;Pricer&amp;quot; class that would use each of these.  Note that in a real application I would probably leverage something like StructureMap to find all classes that implement IPriceCalculator and have some way to control the orderring of these (probably a Priority field on the IPriceCalculator interface to sort by) but to keep things simple I&amp;#39;m hard-coding the calculators list in this example.  So, something like this:&lt;/p&gt;
&lt;div style="font-family:Consolas;background:#181818;color:#e0e0e0;font-size:10pt"&gt;
&lt;div style="font-family:Consolas;background:#181818;color:#e0e0e0;font-size:10pt"&gt;
&lt;p style="margin:0px"&gt;   &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;interface&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IProduct&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;BasePrice&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;SalesPrice&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;GoldLevelDiscount&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;bool&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;IsOnSale&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;
&lt;p style="margin:0px"&gt; &lt;/p&gt;
&lt;p style="margin:0px"&gt;    &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;interface&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ICustomer&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;bool&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;HasFixedDiscountAgreement&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;FixedDiscount&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;bool&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;IsGoldLevelCustomer&lt;/span&gt; { &lt;span style="color:#8080c0"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;
&lt;p style="margin:0px"&gt; &lt;/p&gt;
&lt;p style="margin:0px"&gt;    &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;class&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;Pricer&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;private&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&amp;gt; &lt;span style="color:#fef1a9"&gt;_calculators&lt;/span&gt; = &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;          {&lt;/p&gt;
&lt;p style="margin:0px"&gt;              &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;GoldLevelPriceCalculator&lt;/span&gt;(),&lt;/p&gt;
&lt;p style="margin:0px"&gt;              &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;SalePriceCalculator&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin:0px"&gt;          };&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;GetPrice&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;IProduct&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;ICustomer&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;        {&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt; = &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;BasePrice&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;foreach&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;calculator&lt;/span&gt; &lt;span style="color:#8080c0"&gt;in&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;_calculators&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;            {&lt;/p&gt;
&lt;p style="margin:0px"&gt;                &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt; = &lt;span style="color:#fef1a9"&gt;calculator&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;CalculatePrice&lt;/span&gt;(&lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;, &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;, &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px"&gt;            }&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;return&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px"&gt;        }&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;
&lt;p style="margin:0px"&gt; &lt;/p&gt;
&lt;p style="margin:0px"&gt;    &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;interface&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;CalculatePrice&lt;/span&gt;(&lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;ICustomer&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;IProduct&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;
&lt;p style="margin:0px"&gt; &lt;/p&gt;
&lt;p style="margin:0px"&gt;    &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;class&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;GoldLevelPriceCalculator&lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;CalculatePrice&lt;/span&gt;(&lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;ICustomer&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;IProduct&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;        {&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;if&lt;/span&gt; (&lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;IsGoldLevelCustomer&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;            {&lt;/p&gt;
&lt;p style="margin:0px"&gt;                &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt; = &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;*(1 - &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;GoldLevelDiscount&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px"&gt;            }&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;return&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px"&gt;        }&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;
&lt;p style="margin:0px"&gt; &lt;/p&gt;
&lt;p style="margin:0px"&gt;    &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;class&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;SalePriceCalculator&lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;CalculatePrice&lt;/span&gt;(&lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;ICustomer&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;IProduct&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;        {&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;if&lt;/span&gt; (&lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;IsOnSale&lt;/span&gt; &amp;amp;&amp;amp; !&lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;HasFixedDiscountAgreement&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;            {&lt;/p&gt;
&lt;p style="margin:0px"&gt;                &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt; = &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;SalesPrice&lt;/span&gt; &amp;lt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt; ? &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;SalesPrice&lt;/span&gt; : &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px"&gt;            }&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;return&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px"&gt;        }&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Notice that now, each type of discount is contained in its own class which takes the customer, product, and current price and applies its business rules to the price.  In this way, the &lt;em&gt;GetPrice&lt;/em&gt; method isn&amp;#39;t going to turn into a Monster Method as new business rules are added. Also notice that it&amp;#39;s easy to add a new pricing calculator.   So, for grins, let&amp;#39;s add the &amp;quot;FixedDiscount&amp;quot; version alluded to in David&amp;#39;s example.  First, create a new price calculator:&lt;/p&gt;
&lt;div style="font-family:Consolas;background:#181818;color:#e0e0e0;font-size:10pt"&gt;
&lt;p style="margin:0px"&gt;&lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;class&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;FixedDiscountCalculator&lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;    {&lt;/p&gt;
&lt;p style="margin:0px"&gt;        &lt;span style="color:#8080c0"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;CalculatePrice&lt;/span&gt;(&lt;span style="color:#8080c0"&gt;decimal&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;ICustomer&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;IProduct&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;product&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;        {&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;if&lt;/span&gt; (&lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;HasFixedDiscountAgreement&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px"&gt;            {&lt;/p&gt;
&lt;p style="margin:0px"&gt;                &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt; = &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;*(1 - &lt;span style="color:#fef1a9"&gt;customer&lt;/span&gt;.&lt;span style="color:#fef1a9"&gt;FixedDiscount&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px"&gt;            }&lt;/p&gt;
&lt;p style="margin:0px"&gt;            &lt;span style="color:#8080c0"&gt;return&lt;/span&gt; &lt;span style="color:#fef1a9"&gt;price&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px"&gt;        }&lt;/p&gt;
&lt;p style="margin:0px"&gt;    }&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Now, we simply add this to the collection of price calculator used by our pricer (again, this would be handled by our DI container of choice in the real world):&lt;/p&gt;
&lt;div style="font-family:Consolas;background:#181818;color:#e0e0e0;font-size:10pt"&gt;
&lt;p style="margin:0px"&gt;&lt;span style="color:#8080c0"&gt;private&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&amp;gt; &lt;span style="color:#fef1a9"&gt;_calculators&lt;/span&gt; = &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;IPriceCalculator&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin:0px"&gt;                                                          {&lt;/p&gt;
&lt;p style="margin:0px"&gt;                                                              &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;GoldLevelPriceCalculator&lt;/span&gt;(),&lt;/p&gt;
&lt;p style="margin:0px"&gt;                                                              &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;SalePriceCalculator&lt;/span&gt;(),&lt;/p&gt;
&lt;p style="margin:0px"&gt;                                                              &lt;span style="color:#8080c0"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1"&gt;FixedDiscountCalculator&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin:0px"&gt;                                                          };&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;And we&amp;#39;re done.  Now, we&amp;#39;ve got a well-factored system which follows SRP and is easily extendable with new pricing rules (which, I would assume, could become significantly more complex than the examples given).&lt;/p&gt;
&lt;p&gt;Well, we&amp;#39;re not really done - if the theoretical developer had actually modified this original functionality in a Test-driven manner, you&amp;#39;d have a large number of unit tests to prove that you didn&amp;#39;t break anything when you added the new FixedDiscountCalculator.  Note that I&amp;#39;m a fan of RhinoMocks, and leveraged it so I don&amp;#39;t actually care about where my customer or product information comes from (there&amp;#39;s actually no implementation of these interfaces at all - they should be loaded using your favorite repository-pattern-ORM-leveraging-code).  For the sake of keeping this post short, I&amp;#39;ve uploaded the complete source with unit tests as &lt;a href="http://weblogs.asp.net/blogs/drohrer/PricingCalculator.txt"&gt;PricingCalculator.txt&lt;/a&gt; - rename to .cs, add NUnit and RhinoMocks references, and you&amp;#39;re good to go.&lt;/p&gt;
&lt;p&gt;In conclusion, Is SRP dangerous?  IMHO, not when properly applied.  But that&amp;#39;s true for most &lt;a href="http://en.wikipedia.org/wiki/Solid_(Object_Oriented_Design)"&gt;SOLID&lt;/a&gt; principles - you need to know how to apply them appropriately.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7250824" width="1" height="1"&gt;</summary><author><name>drohrer</name></author><gr:likingUser>12876087448559230915</gr:likingUser><gr:likingUser>10242948346484870580</gr:likingUser><source gr:stream-id="feed/http://weblogs.asp.net/MainFeed.aspx"><id>tag:google.com,2005:reader/feed/http://weblogs.asp.net/MainFeed.aspx</id><title type="html">ASP.NET Weblogs</title><link rel="alternate" href="http://weblogs.asp.net/" type="text/html" /></source><feedburner:origLink>http://weblogs.asp.net/drohrer/archive/2009/11/10/in-response-to-quot-the-dangers-of-single-responsibility-in-programming-quot.aspx</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140781222"><id gr:original-id="http://simonwillison.net/2009/Nov/11/documentation/">tag:google.com,2005:reader/item/ea4fd474e9a0999c</id><category term="django" /><category term="documentation" /><category term="jacobkaplanmoss" /><category term="python" /><title type="html">Writing good documentation (part 1)</title><published>2009-11-11T07:13:57Z</published><updated>2009-11-11T07:13:57Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/IMn_smA7k6M/" type="text/html" /><summary xml:base="http://simonwillison.net/" xml:lang="en-gb" type="html">&lt;div&gt;&lt;p&gt;&lt;a href="http://jacobian.org/writing/good-documentation/"&gt;Writing good documentation (part 1)&lt;/a&gt;. Jacob explains some of the philosophy behind Django’s documentation. Topical guides are particularly interesting—many projects skip them (leaving books to fill the gap) but they fill an essential gap between tutorials and low-level reference documentation.&lt;/p&gt;
&lt;/div&gt;</summary><author gr:unknown-author="true"><name>(author unknown)</name></author><gr:likingUser>08283262736758624906</gr:likingUser><gr:likingUser>13080889749889413543</gr:likingUser><gr:likingUser>05690229047086915053</gr:likingUser><gr:likingUser>04241088551180937596</gr:likingUser><source gr:stream-id="feed/http://feeds.simonwillison.net/swn-everything"><id>tag:google.com,2005:reader/feed/http://feeds.simonwillison.net/swn-everything</id><title type="html">Simon Willison&amp;#39;s Weblog</title><link rel="alternate" href="http://simonwillison.net/" type="text/html" /></source><feedburner:origLink>http://simonwillison.net/2009/Nov/11/documentation/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140751217"><id gr:original-id="c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7251477">tag:google.com,2005:reader/item/47d4322f174b36bf</id><category term="blog" scheme="http://weblogs.asp.net/aspnet-whatsnew/archive/tags/blog/default.aspx" /><title type="html">Facebook Toolkit for Microsoft Developers</title><published>2009-11-11T13:42:00Z</published><updated>2009-11-11T13:42:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/rhP7o555J6c/" type="text/html" /><summary xml:base="http://weblogs.asp.net/aspnet-whatsnew/default.aspx" type="html">Build your own FaceBook applications with ASP.NET, ASP.NET MVC, WinForms or Silverlight ! Read More Download the SDK Facebook.dll : This is the main assembly that will be used by all applications. This has all the logic to handle communication with the...(&lt;a href="http://misfitgeek.com/blog/facebook-toolkit-for-microsoft-developers/"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7251477" width="1" height="1"&gt;</summary><author><name>Latest Microsoft Blogs</name></author><source gr:stream-id="feed/http://weblogs.asp.net/aspnet-whatsnew/rss.aspx"><id>tag:google.com,2005:reader/feed/http://weblogs.asp.net/aspnet-whatsnew/rss.aspx</id><title type="html">What&amp;#39;s New</title><link rel="alternate" href="http://weblogs.asp.net/aspnet-whatsnew/default.aspx" type="text/html" /></source><feedburner:origLink>http://misfitgeek.com/blog/facebook-toolkit-for-microsoft-developers/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140733507"><id gr:original-id="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.wmv">tag:google.com,2005:reader/item/07da5f2f30622fd8</id><category term="SyncToy" /><title type="html">SyncToy 2.1 Available for Download</title><published>2009-11-11T19:59:00Z</published><updated>2009-11-11T19:59:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/mkkUegbCX0I/" type="text/html" /><link rel="enclosure" href="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.wmv" type="video/x-ms-wmv" length="85680349" /><media:group><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.mp4" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.mp3" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.mp4" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.wma" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_ch9.wmv" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_2MB_ch9.wmv" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_Zune_ch9.wmv" /><media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_512_ch9.png" /><media:content url="http://ss.channel9.msdn.com/ch9/7/8/1/4/0/5/SyncToy2.ism/Manifest" /></media:group><summary xml:base="http://channel9.msdn.com/Media/Videos/" type="html">&lt;img src="http://ecn.channel9.msdn.com/o9/ch9/7/8/1/4/0/5/SyncToy2_85_ch9.png" border="0"&gt;How many times have you tried to copy a huge number of files only to accidently hit space or escape cancelling the transfer and you don't want to re-start from scratch? Well there's a better way to sync files between directories and drives, SyncToy. You might remember this from the XP PowerToys days, the ease of use makes it a very popular download. Deepa from the Sync team stopped by to show us the latest version, SyncToy 2.1. &lt;br&gt;
&lt;br&gt;
You can find out more &lt;a href="http://blogs.msdn.com/sync/archive/2009/11/11/synctoy-2-1available-for-download.aspx"&gt;here&lt;/a&gt;, download it &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=C26EFA36-98E0-4EE9-A7C5-98D0592D8C52&amp;amp;displaylang=en"&gt;here&lt;/a&gt;, or give the team feedback &lt;a href="http://social.microsoft.com/Forums/en-US/synctoy/threads"&gt;here&lt;/a&gt;.&lt;img src="http://channel9.msdn.com/504187/WebViewBug.aspx?EVT=0" height="1" width="1" alt=""&gt;</summary><author><name>Larry Larsen</name></author><source gr:stream-id="feed/http://channel9.msdn.com/rss.aspx?ForumID=14&amp;Mode=0&amp;sortby=0&amp;sortorder=1"><id>tag:google.com,2005:reader/feed/http://channel9.msdn.com/rss.aspx?ForumID=14&amp;Mode=0&amp;sortby=0&amp;sortorder=1</id><title type="html">videos - Channel 9</title><link rel="alternate" href="http://channel9.msdn.com/Media/Videos/" type="text/html" /></source><feedburner:origLink>http://channel9.msdn.com/posts/LarryLarsen/SyncToy-21-Available-for-Download/</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140723083"><id gr:original-id="">tag:google.com,2005:reader/item/e935449c13bd16fe</id><title type="html">ASP.NET 4 &amp;quot;Quick Hit&amp;quot; - Auto Start</title><published>2009-11-11T18:48:00Z</published><updated>2009-11-11T18:48:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/en9Anyb72AI/video-8843.aspx" type="text/html" /><summary xml:base="http://www.asp.net/learn/" type="html">In this video you will learn about the new auto-start scalability feature which provides a controlled approach for starting up an application pool, initializing an ASP.NET application, and then accepting HTTP requests.</summary><author><name>ASP.NET Videos</name></author><source gr:stream-id="feed/http://asp.net/learn/videos/rss.ashx"><id>tag:google.com,2005:reader/feed/http://asp.net/learn/videos/rss.ashx</id><title type="html">ASP.NET Videos</title><link rel="alternate" href="http://www.asp.net/learn/" type="text/html" /></source><feedburner:origLink>http://www.asp.net/learn/aspnet-4-quick-hit-videos/video-8843.aspx</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140721783"><id gr:original-id="">tag:google.com,2005:reader/item/151f6d4a97b1b69c</id><title type="html">ASP.NET 4 &amp;quot;Quick Hit&amp;quot; - Imperative WebForms Routing</title><published>2009-11-05T05:00:00Z</published><updated>2009-11-05T05:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/RjA8TvPJLPM/video-8773.aspx" type="text/html" /><summary xml:base="http://www.asp.net/learn/" type="html">In this video you will learn how to use an expression builder to do WebForms routing imperatively.</summary><author><name>ASP.NET Learn Content</name></author><source gr:stream-id="feed/http://asp.net/learn/rss.ashx"><id>tag:google.com,2005:reader/feed/http://asp.net/learn/rss.ashx</id><title type="html">ASP.NET Learn Content</title><link rel="alternate" href="http://www.asp.net/learn/" type="text/html" /></source><feedburner:origLink>http://www.asp.net/learn/aspnet-4-quick-hit-videos/video-8773.aspx</feedburner:origLink></entry><entry gr:crawl-timestamp-msec="1258140720505"><id gr:original-id="">tag:google.com,2005:reader/item/ea485e22a2574d20</id><title type="html">Visual Studio 2010 &amp;quot;Quick Hit&amp;quot; - Snippets IntelliSense</title><published>2009-11-11T05:00:00Z</published><updated>2009-11-11T05:00:00Z</updated><link rel="alternate" href="http://feedproxy.google.com/~r/koistya/~3/yN5KLjIFmB4/video-8853.aspx" type="text/html" /><summary xml:base="http://www.asp.net/learn/" type="html">In this video you will learn about Visual Studio's snippet support of HTML, ASP.NET markup and JavaScript.</summary><author><name>ASP.NET Learn Content</name></author><source gr:stream-id="feed/http://asp.net/learn/rss.ashx"><id>tag:google.com,2005:reader/feed/http://asp.net/learn/rss.ashx</id><title type="html">ASP.NET Learn Content</title><link rel="alternate" href="http://www.asp.net/learn/" type="text/html" /></source><feedburner:origLink>http://www.asp.net/learn/vs2010-quick-hit-videos/video-8853.aspx</feedburner:origLink></entry></feed>
