<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Espresso Fueled Agile Development : .NET</title><link>http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx</link><description>Tags: .NET</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Where is WCSF headed?</title><link>http://blogs.msdn.com/mpuleio/archive/2008/12/03/where-is-wcsf-headed.aspx</link><pubDate>Wed, 03 Dec 2008 21:24:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9171150</guid><dc:creator>mpuleio</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/9171150.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=9171150</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=9171150</wfw:comment><description>&lt;p&gt;Blaine &amp;amp; I have been getting a lot of emails, messages, comments, etc about WCSF.&amp;#160; There are a lot of people interested in a public statement from patterns &amp;amp; practices about the roadmap for WCSF and future support of WCSF, in addition to the &amp;quot;normal&amp;quot; feature requests.&lt;/p&gt;  &lt;p&gt;Well, we have some good news: Blaine has publicly released the WCSF roadmap in his blog as &lt;a href="http://blogs.msdn.com/blaine/archive/2008/12/03/roadmap-for-wcsf.aspx"&gt;Roadmap for WCSF&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Basically, right now, we are asking for feedback from the community.&amp;#160; Let Blaine and/or I know what you want via our blogs, email, or the WCSF CodePlex site at &lt;a href="http://www.codeplex.com/websf"&gt;www.codeplex.com/websf&lt;/a&gt;.&amp;#160; You can also create work items/ issues on the WCSF CodePlex site and have people vote on them (&lt;a title="http://www.codeplex.com/websf/WorkItem/List.aspx" href="http://www.codeplex.com/websf/WorkItem/List.aspx"&gt;http://www.codeplex.com/websf/WorkItem/List.aspx&lt;/a&gt;).&amp;#160; &lt;/p&gt;  &lt;p&gt;Thanks in advance for the feedback...&lt;/p&gt;  &lt;p&gt;[Edit: I created a specific thread on the CodePlex discussions board to facilitate feedback: &lt;a title="http://www.codeplex.com/websf/Thread/View.aspx?ThreadId=41403" href="http://www.codeplex.com/websf/Thread/View.aspx?ThreadId=41403"&gt;http://www.codeplex.com/websf/Thread/View.aspx?ThreadId=41403&lt;/a&gt;). Enjoy]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9171150" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Composite Application Guidance for WPF Shipped!</title><link>http://blogs.msdn.com/mpuleio/archive/2008/07/31/composite-application-guidance-for-wpf-shipped.aspx</link><pubDate>Thu, 31 Jul 2008 20:26:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8793821</guid><dc:creator>mpuleio</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8793821.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8793821</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8793821</wfw:comment><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;A while back, I was Dev Lead on the Smart Client Software Factory (SCSF) when we added the ability to host WPF controls in a Composite Application Block (CAB) application. Since then, the thinking in the WPF space has changed a bit, and p&amp;amp;p decided that offering guidance on full WPF applications was a good idea.&amp;nbsp; &lt;a href="http://blogs.msdn.com/blaine" target="_blank"&gt;Blaine&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/francischeung" target="_blank"&gt;Francis&lt;/a&gt;, Bob, and &lt;a href="http://blogs.msdn.com/gblock" target="_blank"&gt;Glenn&lt;/a&gt; have worked with a great team to create guidance for building composite applications using WPF. This guidance was started from a clean slate, as there are enough differences between Windows Forms and WPF (as we learned doing SCSF) to cause challenges.&amp;nbsp; The result is the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" target="_blank"&gt;Composite Application Guidance for WPF June 2008&lt;/a&gt;, which recently shipped (formerly code-named &lt;a href="http://codeplex.com/CompositeWPF" target="_blank"&gt;Prism&lt;/a&gt;).&amp;nbsp; This guidance is simple, easy to consume, can be used piecemeal, and should not have the steep learning curve that CAB and SCSF have.&amp;nbsp; You can learn more at the &lt;a href="http://codeplex.com/CompositeWPF" target="_blank"&gt;Prism CodePlex Community Site&lt;/a&gt;, or at any of the places below.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Check out Francis's post, &lt;a href="http://blogs.msdn.com/francischeung/archive/2008/07/17/shipped-composite-application-guidance-for-wpf-june-2008.aspx" target="_blank"&gt;SHIPPED!!! Composite Application Guidance for WPF June 2008&lt;/a&gt;, for details and where to get it.&lt;/p&gt; &lt;p&gt;Or take a look at Glenn's post on the subject: &lt;a href="http://blogs.msdn.com/gblock/archive/2008/07/03/composite-application-guidance-is-live.aspx"&gt;Composite Application Guidance is Live&lt;/a&gt;&lt;/p&gt; &lt;p&gt;And here are a few other posts about what they have been up to, by person in chronological order:&lt;/p&gt; &lt;p&gt;From Francis:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/01/28/composite-wpf-guidance.aspx"&gt;Composite WPF Guidance&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/01/28/di-or-not-di.aspx"&gt;DI or not DI&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/05/29/decoupled-communication-with-prism-intro.aspx"&gt;Decoupled Communication with Prism (intro)&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/05/29/decoupled-communication-with-prism-shared-views-services.aspx"&gt;Decoupled Communication with Prism (Shared Services)&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/05/30/decoupled-communication-with-prism-commanding.aspx"&gt;Decoupled Communication with Prism (Commanding)&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/06/02/decoupled-communication-with-prism-event-aggregation.aspx"&gt;Decoupled Communication with Prism (Event Aggregation)&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/06/16/poor-man-s-ui-composition.aspx"&gt;Poor man's UI Composition&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/francischeung/archive/2008/07/16/activeaware-views-and-commands.aspx"&gt;ActiveAware Views and Commands&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;From Blaine:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/blaine/archive/2008/05/15/track-prim-project.aspx"&gt;Track Prism project&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/blaine/archive/2008/06/08/loosely-couple-communication.aspx"&gt;Loosely coupled communication&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;From Glenn:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/03/12/prism-launches-on-codeplex.aspx"&gt;'Prism' launches on CodePlex&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/03/12/prism-ri-first-drop.aspx"&gt;'Prism' RI first drop&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/03/26/prism-drop-2.aspx"&gt;Prism Drop 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/04/01/prism-talk-at-wpf-bootcamp.aspx"&gt;Prism talk at WPF Bootcamp&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/04/27/the-prism-team-and-how-we-develop.aspx"&gt;The Prism team and how we develop&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/04/29/brian-noyes-thoughts-on-prism.aspx"&gt;Brian Noyes thoughts on Prism&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/05/05/prismshouldnotreferenceunity.aspx"&gt;PrismShouldNotReferenceUnity&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/05/08/prism-vs-framework-xxx.aspx"&gt;Prism vs Framework XXX&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/05/08/wpf-from-this-to-that-wow.aspx"&gt;WPF, from this to that..Wow!&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/05/11/prism-cab-and-winforms-futures.aspx"&gt;Prism, CAB, and WinForms futures&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/05/24/using-viewmodels-and-datatemplates-to-compose-your-ui.aspx"&gt;Using ViewModels and DataTemplates to compose your UI&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/06/04/loosely-coupled-communication-prism-style.aspx"&gt;Loosely coupled communication - Prism style&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/06/12/stocktrader-ri-using-castle-windsor.aspx"&gt;StockTrader RI using Castle Windsor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/06/30/composite-application-guidance-time-to-ship.aspx"&gt;Composite Application Guidance, time to ship&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/06/30/talking-about-prism-with-infoq.aspx"&gt;Talking about Prism with InfoQ&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/07/01/how-prism-supports-using-multiple-ioc-containers.aspx"&gt;How Prism supports using multiple IOC containers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/07/02/composite-application-guidance-what-is-it.aspx"&gt;Composite Application Guidance - What is it?&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/07/03/composite-application-guidance-is-live.aspx"&gt;Composite Application Guidance is Live&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I know I am looking forward to using this guidance when I get a chance to work with WPF more seriously.&lt;/p&gt; &lt;p&gt;Enjoy.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8793821" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Smart+Client+Software+Factory/default.aspx">Smart Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Proof of Concept: a simple DI solution for ASP.NET WebForms</title><link>http://blogs.msdn.com/mpuleio/archive/2008/07/17/proof-of-concept-a-simple-di-solution-for-asp-net-webforms.aspx</link><pubDate>Thu, 17 Jul 2008 23:32:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8744912</guid><dc:creator>mpuleio</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8744912.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8744912</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8744912</wfw:comment><description>&lt;p&gt;&lt;a href="http://www.tavaresstudios.com/Blog/" target="_blank"&gt;Chris Tavares&lt;/a&gt; and I were chatting yesterday morning about an idea Chris had: building a simple, reusable Http Module that gives folks DI scoped to the Application, Session, and Request.&amp;nbsp; Yesterday afternoon, during the p&amp;amp;p Dev team's weekly "Code Kata" we threw together a spike/proof of concept in a couple of hours.&amp;nbsp; "Code Kata" is a three hour block of time that the p&amp;amp;p Dev team uses for a number of things: &lt;/p&gt; &lt;ul&gt; &lt;li&gt;cross-project pollination of ideas, things that work, things that don't work across project teams &lt;li&gt;investigating new and emerging technologies that p&amp;amp;p may work with in the future  &lt;li&gt;investigating new and emerging platforms to determine if p&amp;amp;p may want to provide guidance in the future  &lt;li&gt;play with new shiny bits :-)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;There are no unit tests, just simple acceptance tests written as a really simple web site.&amp;nbsp; If the site works and shows the right text, the test passes.&amp;nbsp; We started with a list of requirements (scaled to just the application level) on the whiteboard that looked sort of like this (which I am creating from memory):&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Create a DI container for the application  &lt;li&gt;Create a way to get to the container ( we choose an extension method on the Application class)  &lt;li&gt;Allow a way to configure the container  &lt;li&gt;Allow DI to work for pages  &lt;li&gt;Allow DI to work for user controls  &lt;li&gt;Allow DI to work for master pages  &lt;li&gt;Allow DI to work for ASMX web services  &lt;li&gt;Allow the above functionality in a simple and self contained way&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;So, we created a simple Web Site Application and a DLL to hold the custom HttpModule.&amp;nbsp; We created a simple web page that needed a property injected into it.&amp;nbsp; We then wrote the code to make my "test" page work properly.&amp;nbsp; First we wrote an extension method for HttpApplication.&amp;nbsp; After a short bit it changed to one for HttpApplicationState: &lt;/p&gt; &lt;blockquote&gt;&lt;pre class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Practices.Unity;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;UnityForTheWebLib
{
    &lt;span style="color: blue"&gt;public static class &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: #2b91af"&gt;HttpApplicationStateExtensions
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;private const string &lt;/span&gt;GlobalContainerKey = &lt;span style="color: #a31515"&gt;"Your global Unity container"&lt;/span&gt;;

        &lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IUnityContainer &lt;/span&gt;GetContainer(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HttpApplicationState &lt;/span&gt;application)
        {
            application.Lock();
            &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: blue"&gt;try
            &lt;/span&gt;{
                &lt;span style="color: #2b91af"&gt;IUnityContainer &lt;/span&gt;container = application[GlobalContainerKey] &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IUnityContainer&lt;/span&gt;;
                &lt;span style="color: blue"&gt;if&lt;/span&gt;(container == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                {
                    container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
                    application[GlobalContainerKey] = container;
                }
                &lt;span style="color: blue"&gt;return &lt;/span&gt;container;
            }
            &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: blue"&gt;finally
            &lt;/span&gt;{
                application.UnLock();
            }
        }
    }
}&lt;/font&gt;&lt;/font&gt;
&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Basically, we have lazy initialization of the container and a mechanism to stuff it into the application state.&amp;nbsp; And then the initial HttpModule that only does injection on a Page:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web.UI;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Practices.Unity;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;UnityForTheWebLib
{
    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityHttpModule &lt;/span&gt;: &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: #2b91af"&gt;IHttpModule
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;#region &lt;/span&gt;IHttpModule Members

        &lt;/font&gt;&lt;/font&gt;&lt;span style="color: gray"&gt;&lt;font face="con" size="2"&gt;///&amp;lt;summary&amp;gt;
        ///&lt;/font&gt;&lt;/span&gt;&lt;span style="color: green"&gt;&lt;font face="con" size="2"&gt;Initializes a module and prepares it to handle requests.
        &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;///&amp;lt;/summary&amp;gt;
        ///
        ///&amp;lt;param name="context"&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;An &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;see cref="T:System.Web.HttpApplication"&amp;gt;&amp;lt;/see&amp;gt; &lt;/span&gt;&lt;span style="color: green"&gt;that provides access to the methods, properties, and events common to all application objects within an ASP.NET application &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;
        &lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;Init(&lt;span style="color: #2b91af"&gt;HttpApplication &lt;/span&gt;context)
        {
            context.PreRequestHandlerExecute += OnPreRequestHandlerExecute;
        }

        &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;///&amp;lt;summary&amp;gt;
        ///&lt;/span&gt;&lt;span style="color: green"&gt;Disposes of the resources (other than memory) used by the module that implements &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;see cref="T:System.Web.IHttpModule"&amp;gt;&amp;lt;/see&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color: green"&gt;&lt;font face="con" size="2"&gt;.
        &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;///&amp;lt;/summary&amp;gt;
        ///
        &lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;Dispose()
        {
        }

        &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: blue"&gt;#endregion

        private void &lt;/span&gt;OnPreRequestHandlerExecute(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)
        {
            &lt;span style="color: #2b91af"&gt;IHttpHandler &lt;/span&gt;handler = &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Handler;
            &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Application.GetContainer().BuildUp(handler.GetType(), handler);
        }
    }
}&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;This is a very simple module that calls BuildUp on the page.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;At this point we added another test, and implemented it.&amp;nbsp; After a few iterations of this we ended up with tests for injection into a User Control and a Master Page, an interface that needed to be configured on the container.&amp;nbsp; The final implementation of the Http Module looks like this &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;&lt;br&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;&lt;br&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web;&lt;br&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web.UI;&lt;br&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Practices.Unity;&lt;br&gt;&lt;br&gt;&lt;span style="color: blue"&gt;namespace &lt;/span&gt;UnityForTheWebLib&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityHttpModule &lt;/span&gt;: &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: #2b91af"&gt;IHttpModule&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;#region &lt;/span&gt;IHttpModule Members&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;span style="color: gray"&gt;&lt;font face="con" size="2"&gt;///&amp;lt;summary&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;/font&gt;&lt;/span&gt;&lt;span style="color: green"&gt;&lt;font face="con" size="2"&gt;Initializes a module and prepares it to handle requests.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;///&amp;lt;/summary&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&amp;lt;param name="context"&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;An &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;see cref="T:System.Web.HttpApplication"&amp;gt;&amp;lt;/see&amp;gt; &lt;/span&gt;&lt;span style="color: green"&gt;that provides access to the methods, properties, and events common to all application objects within an ASP.NET application &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;&amp;lt;/param&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;Init(&lt;span style="color: #2b91af"&gt;HttpApplication &lt;/span&gt;context)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.PreRequestHandlerExecute += OnPreRequestHandlerExecute;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;///&amp;lt;summary&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;/span&gt;&lt;span style="color: green"&gt;Disposes of the resources (other than memory) used by the module that implements &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;see cref="T:System.Web.IHttpModule"&amp;gt;&amp;lt;/see&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color: green"&gt;&lt;font face="con" size="2"&gt;.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: gray"&gt;///&amp;lt;/summary&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;Dispose()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: blue"&gt;#endregion&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void &lt;/span&gt;OnPreRequestHandlerExecute(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;IHttpHandler &lt;/span&gt;handler = &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Handler;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Application.GetContainer().BuildUp(handler.GetType(), handler);&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: green"&gt;// User Controls are ready to be built up after the page initialization is complete&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Page &lt;/span&gt;page = &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Handler &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Page&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if &lt;/span&gt;(page != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; page.InitComplete += OnPageInitComplete;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: green"&gt;// Get the controls in the page's control tree excluding the page itself&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Control&lt;/span&gt;&amp;gt; GetControlTree(&lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;root)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;child &lt;span style="color: blue"&gt;in &lt;/span&gt;root.Controls)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;yield return &lt;/span&gt;child;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;c &lt;span style="color: blue"&gt;in &lt;/span&gt;GetControlTree(child))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;yield return &lt;/span&gt;c;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: green"&gt;// Build up each control in the page's control tree&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;OnPageInitComplete(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;Page &lt;/span&gt;page = (&lt;span style="color: #2b91af"&gt;Page&lt;/span&gt;) sender;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;IUnityContainer &lt;/span&gt;container = &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Application.GetContainer();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;c &lt;span style="color: blue"&gt;in &lt;/span&gt;GetControlTree(page))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; container.BuildUp(c.GetType(), c);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Configuration of the container can happen in the Global Application_Start handler like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Practices.Unity;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;UnityForTheWebTestSite
{
    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Global &lt;/span&gt;: System.Web.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="con"&gt;&lt;span style="color: #2b91af"&gt;HttpApplication
    &lt;/span&gt;{

        &lt;span style="color: blue"&gt;protected void &lt;/span&gt;Application_Start(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)
        {
            &lt;span style="color: #2b91af"&gt;IUnityContainer &lt;/span&gt;c = Application.GetContainer();
            c.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IControlData&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;ControlData1&lt;/span&gt;&amp;gt;();
        }
    }
}&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;So, from the initial requirements we have this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;Create a DI container for the application&lt;/strike&gt; &lt;strong&gt;Lazy initialization&lt;/strong&gt; 
&lt;li&gt;&lt;strike&gt;Create a way to get to the container ( we choose an extension method on the Application class) &lt;/strike&gt;&lt;strong&gt;Extension Method&lt;/strong&gt; 
&lt;li&gt;&lt;strike&gt;Allow a way to configure the container&lt;/strike&gt; &lt;strong&gt;Application Start&lt;/strong&gt; 
&lt;li&gt;&lt;strike&gt;Allow DI to work for pages&lt;/strike&gt;&amp;nbsp; &lt;strong&gt;Add the HttpModule and Attributes&lt;/strong&gt; 
&lt;li&gt;&lt;strike&gt;Allow DI to work for user controls &lt;/strike&gt;&lt;strong&gt;Add the HttpModule and Attributes&lt;/strong&gt; 
&lt;li&gt;&lt;strike&gt;Allow DI to work for master pages &lt;/strike&gt;&lt;strong&gt;Add the HttpModule and Attributes&lt;/strong&gt; 
&lt;li&gt;Allow DI to work for ASMX web services 
&lt;li&gt;&lt;strike&gt;Allow the above functionality in a simple and self contained way&lt;/strike&gt; &lt;strong&gt;This is all in a single module&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;We met the last requirement (simple and self contained) since all we did to the web application was add a single line to the web config.&amp;nbsp; That met the requirement. 
&lt;p&gt;The last area is one we met, but we are not happy with the solution.&amp;nbsp; Basically, we need to do a bit more research and see if there is a way to get into the pipeline for an ASMX request early enough to do injection and not screw things up for the normal use case or the Ajax extensions.&amp;nbsp; Until we get this figured out right, the solution is to have your Web Service constructor ask the container to do injection.&amp;nbsp; This is an ugly hack and looks something like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;&lt;font size="2"&gt;&lt;font face="consol"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.ComponentModel;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web.Services;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Practices.Unity;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;UnityForTheWebTestSite
{&lt;/font&gt;&lt;/font&gt;&lt;span style="color: gray"&gt;
&lt;font face="consol" size="2"&gt;    &lt;/font&gt;&lt;/span&gt;&lt;font face="consol" size="2"&gt;[&lt;span style="color: #2b91af"&gt;WebService&lt;/span&gt;(Namespace = &lt;span style="color: #a31515"&gt;"http://tempuri.org/"&lt;/span&gt;)]
    [&lt;span style="color: #2b91af"&gt;WebServiceBinding&lt;/span&gt;(ConformsTo = &lt;span style="color: #2b91af"&gt;WsiProfiles&lt;/span&gt;.BasicProfile1_1)]
    [&lt;span style="color: #2b91af"&gt;ToolboxItem&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;)]
    &lt;/font&gt;&lt;font size="2"&gt;&lt;font face="consol"&gt;&lt;span style="color: green"&gt;// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    &lt;/span&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyWebService &lt;/span&gt;: System.Web.Services.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="consol"&gt;&lt;span style="color: #2b91af"&gt;WebService
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;public &lt;/span&gt;MyWebService()
        {
            &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;.Current.Application.GetContainer().BuildUp(&lt;span style="color: blue"&gt;this&lt;/span&gt;);
        }

        [&lt;span style="color: #2b91af"&gt;Dependency&lt;/span&gt;]
        &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IControlData &lt;/span&gt;Data
        {
            &lt;span style="color: blue"&gt;get&lt;/span&gt;;
            &lt;span style="color: blue"&gt;set&lt;/span&gt;;
        }

        [&lt;span style="color: #2b91af"&gt;WebMethod&lt;/span&gt;]
        &lt;span style="color: blue"&gt;public string &lt;/span&gt;HelloWorld()
        {
            &lt;span style="color: blue"&gt;return &lt;/span&gt;&lt;span style="color: #a31515"&gt;"Hello World " &lt;/span&gt;+ Data.GetText();
        }
    }
}&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;To add the ability to have a container at the Session level and the request level should be as simple as following the pattern for the extension method and the http handler above. (I will leave it as an exercise for the reader.) You could use the same container for everything, or have the Session container a child of the application container, and the request container a child of the session container.&amp;nbsp; When and if we do a real implementation (as opposed to a proof of concept) we will figure out the best approach for most cases.&amp;nbsp; When and if this happens, I will update my CWAB with Unity solution and dramatically simplify it. :-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8744912" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Unity/default.aspx">Unity</category></item><item><title>Converting the Composite Web Application Block to Unity - Using the UnityCompositionContainer</title><link>http://blogs.msdn.com/mpuleio/archive/2008/05/21/converting-the-composite-web-application-block-to-unity-using-the-unitycompositioncontainer.aspx</link><pubDate>Wed, 21 May 2008 19:38:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8528652</guid><dc:creator>mpuleio</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8528652.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8528652</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8528652</wfw:comment><description>&lt;p&gt;This is the sixth post in a series. The other post include:  &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-intro.aspx"&gt;Converting the Composite Web Application Block to Unity - Intro&lt;/a&gt;.  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-adding-an-icompositioncontainer.aspx" target="_blank"&gt;Converting the Composite Web Application Block to Unity - Adding an ICompositionContainer&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/09/converting-the-composite-web-application-block-to-unity-clean-up-icompositioncontainer.aspx"&gt;Converting the Composite Web Application Block to Unity - Clean Up ICompositionContainer&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/22/converting-the-composite-web-application-block-to-unity-ummmm-oooops.aspx"&gt;Converting the Composite Web Application Block to Unity - Ummmm...Oooops.&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/05/01/converting-the-composite-web-application-block-to-unity-actually-adding-unity.aspx" target="_blank"&gt;Converting the Composite Web Application Block to Unity - Actually Adding Unity&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you want background, go read the earlier posts.  &lt;p&gt;Based upon feedback, I am making the source code available at &lt;a title="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" target="_blank"&gt;CWAB and Unity&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;For those who have been following along, you all know I am making this up as I go. So, I am asking that you be patient with me as we figure this out together. This article (in particular) may have a few false starts, and "ooops" moments.&amp;nbsp; We are replacing something that was not meant to be pluggable, and all of the refactoring work that has been done up to this point may not be enough.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;Reminder:&amp;nbsp; &lt;/strong&gt;&lt;em&gt;&lt;u&gt;This is a proof of concept&lt;/u&gt;&lt;/em&gt;.&amp;nbsp; The version of CWAB I am creating here is not a supported product or guidance from patterns &amp;amp; practices.&amp;nbsp; If you really want Unity support in WCSF, please go to the Issue Tracker on the &lt;a href="http://www.codeplex.com/websf" target="_blank"&gt;WCSF Community Site&lt;/a&gt; and vote for the work item to get Unity support for WCSF.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;At the end of the last post I planned on trying to actually use the UnityCompositionContainer, and then nuke the old CompositionContainer.&lt;/p&gt; &lt;p&gt;Let's get started by replacing any calls that creates a CompositionContainer with code that creates a UnityCompositionContainer.&amp;nbsp; There is ONE spot, in WebClientApplication.&amp;nbsp; Simple. Change, recompile, re-run unit tests, and we are green. &lt;/p&gt; &lt;p&gt;If it really was that simple, we should be able to remove the CompositionContainer class (and its test fixture) from the solution, and not have any challenges.&amp;nbsp; Let's try that.&lt;/p&gt; &lt;p&gt;We fail to compile.&amp;nbsp; Our TestableRootCompositionContainer is part of the problem. MockContainer in ManagedObjectCollectionFixture is the rest of it.&lt;/p&gt; &lt;p&gt;If we derive TestableRootCompositionContainer from UnityContainer, and remove everything from the class (as a temporary measure), we go from two to 27 build errors.&amp;nbsp; &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;timewarp duration="an or two"/&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Not good.&amp;nbsp; But not too bad, considering what comes next.&amp;nbsp; After fixing these build errors, I got on a roll, and did the following:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Removed references to the old ObjectBuilder.dll in both unit test and system projects  &lt;li&gt;Removed the BuilderStrategies folder in both unit test and system projects  &lt;li&gt;Removed the Collections folder in both unit test and system projects  &lt;li&gt;Removed the ObjectBuilder folder in both unit test and system projects  &lt;li&gt;Removed the ProviderDependencyAttribute and its fixture  &lt;li&gt;Removed StateDependencyAttribute and its fixture  &lt;li&gt;Removed OptionalDependencyAttribute and its fixture  &lt;li&gt;Removed ServiceDependencyAttribute and its fixture  &lt;li&gt;Removed all references to the old ObjectBuilder namespace  &lt;li&gt;Replaced any [CreateNew] attributes with the Unity [Dependency] attribute  &lt;li&gt;Hacked on WebClientApplication  &lt;li&gt;Removed the Services collection.&amp;nbsp; Replaced calls to container.Services.Add with container.RegisterType.&amp;nbsp; If needed added a call to container.Resolve, when the Services.Add call was supposed to return an object.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Ok, things are compiling again.&amp;nbsp; Finally.&amp;nbsp; But there are a few failing unit tests, about 20 or so...&amp;nbsp; Let's fix those.&lt;/p&gt; &lt;p&gt;&amp;lt;type... type.... swear.... type /&amp;gt;&lt;/p&gt; &lt;p&gt;Getting those test to pass was fairly simple.&amp;nbsp; All of them required a little bit of container setup that was different than before.&amp;nbsp; This was not a big deal.&lt;/p&gt; &lt;p&gt;There is one major change I did make in the process, and a related renaming.&amp;nbsp; First, the renaming, Page became InjectablePage; MasterPage became InjectableMasterPage, and guess what UserControl became? Excactly, InjectableUserControl.&amp;nbsp; These are better descriptions and will remove the confusion I have dealt with on the forums where people use the wrong Page base class.&amp;nbsp; The other change is that, previously CompositionContainer had two Builders: one for things like services that stayed around, and another for Pages and transient items like presenters.&amp;nbsp; We no longer need two builders, and can get containers and lifetime managers to handle the differences.&amp;nbsp; The approach I took for simplicity is to have each page create a container that is a child of the correct Module container, use this for doing injection on the page, and then nuking the container on Page.Dispose.&amp;nbsp; This is quick and dirty, and it works, but I may revisit it later. &lt;/p&gt; &lt;p&gt;Now, since Unity 1.1 just shipped, it is time to upgrade.&amp;nbsp; I replaced the binaries and...&lt;/p&gt; &lt;p&gt;Everything still passes.&lt;/p&gt; &lt;p&gt;I think that is enough for today.&lt;/p&gt; &lt;p&gt;As a quick check, I just looked at the solution statistics for the original version of CWAB and the current solution.&amp;nbsp; CWAB went from 26KLOC (pre-article one) to 14KLOC, both numbers including unit tests.&amp;nbsp; And I bet that there is more to be cut out and cleaned up.&amp;nbsp; Having a purpose built, re-usable component for DI helped a lot here.&amp;nbsp; For this edition, windiff will probably be the best bet for following all the types of changes I made.&amp;nbsp; This one took a while and impacted &lt;em&gt;&lt;strong&gt;a lot &lt;/strong&gt;&lt;/em&gt;of code.&lt;/p&gt; &lt;p&gt;Next, I am going to review unit tests, run code coverage, determine if there are gaps in test coverage after all the hacking.&amp;nbsp; After that, it will be porting one of the quickstarts over to the new version of CWAB.&amp;nbsp; After that, the RI, at which point I will be sure that the updated version works well enough to be a good proof of concept.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8528652" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Unity/default.aspx">Unity</category></item><item><title>Converting the Composite Web Application Block to Unity - Actually Adding Unity</title><link>http://blogs.msdn.com/mpuleio/archive/2008/05/01/converting-the-composite-web-application-block-to-unity-actually-adding-unity.aspx</link><pubDate>Fri, 02 May 2008 02:44:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8447888</guid><dc:creator>mpuleio</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8447888.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8447888</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8447888</wfw:comment><description>&lt;p&gt;This is the fifth post in a series. The other post include:  &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-intro.aspx"&gt;Converting the Composite Web Application Block to Unity - Intro&lt;/a&gt;.  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-adding-an-icompositioncontainer.aspx" target="_blank"&gt;Converting the Composite Web Application Block to Unity - Adding an ICompositionContainer&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/09/converting-the-composite-web-application-block-to-unity-clean-up-icompositioncontainer.aspx"&gt;Converting the Composite Web Application Block to Unity - Clean Up ICompositionContainer&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/mpuleio/archive/2008/04/22/converting-the-composite-web-application-block-to-unity-ummmm-oooops.aspx"&gt;Converting the Composite Web Application Block to Unity - Ummmm...Oooops.&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you want background, go read the earlier posts.  &lt;p&gt;Based upon feedback, I am making the source code available at &lt;a title="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" target="_blank"&gt;CWAB and Unity&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;First off, I have moved this little side project to source control, so I can avoid the re-work I had to do before I could write this part of the series. &lt;/p&gt; &lt;p&gt;Note to self :&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;NEVER work without a safety net.&amp;nbsp; That means both unit tests and source control. &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Ok.&amp;nbsp; Now that that is out of the way....&lt;/p&gt; &lt;p&gt;Let's go add Unity to CWAB, via EDD (formerly TDD).&lt;/p&gt; &lt;p&gt;How can we do this?&amp;nbsp; First, we need a test fixture.&amp;nbsp; So, I added &lt;span style="color: #2b91af"&gt;CompositionContainerFixture&lt;/span&gt; to the CompositeWeb.Tests project as an empty test fixture.&amp;nbsp; And then I added the following very simple test as a starting point:&lt;/p&gt; &lt;blockquote&gt;&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
&lt;span style="color: blue"&gt;public void &lt;/span&gt;UnityCompositionContainerIsICompositionContainer()
{
    UnityCompositionContainer container = &lt;span style="color: blue"&gt;new &lt;/span&gt;UnityCompositionContainer();
    &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.IsInstanceOfType(container, &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ICompositionContainer&lt;/span&gt;));
}
&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;This will allow me to write enough code to create the &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;class and ensure that it implements the right interface.&lt;/p&gt;
&lt;p&gt;Making the test compile forces me to create a new &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;class (I added it to the fixture as a nested class for the moment), and the test fails.&amp;nbsp; No problem.&amp;nbsp; I add the interface, implement it with methods that throw, and..... We are green again.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Next step, I copied the unit test &lt;span style="color: green"&gt;RootContainerParentIsNull&lt;/span&gt; over, changed its name to NewUnityContainerParentIsNull, updated it to create a new UnityCompositionContainer, and compiled and ran the test.&amp;nbsp; It passed, which is not idea;l, but I will leave it an move on, knowing it will be important later.&amp;nbsp; For the next test, I copied &lt;span style="color: green"&gt;ChildContainerHasParent &lt;/span&gt;changed its name to NewUnityContainerParentIsNull, updated it to create a new UnityCompositionContainer, and compiled and ran the test... Red. Just like we expected.&amp;nbsp; To make this work, I could do a bit of throw away work, or I could add Unity.&amp;nbsp; I feel like I can skip the simplest thing possible, because I know where I want to go.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;However, first, I'm doing a check-in.&amp;nbsp; I'll comment out the failing test, and sync up.&amp;nbsp; Just a sec.&lt;/p&gt;
&lt;p&gt;&amp;lt;click click&amp;gt;&lt;/p&gt;
&lt;p&gt;Ok, now To add Unity.&amp;nbsp; I grabbed the binaries from MSDN, dropped them in my tree in the Lib folder and we are good to go.&amp;nbsp; I added references in the CWAB projecct to Unity.DLL and ObjectBuilder2.DLL.&amp;nbsp; This means we have two completely separate DI systems as part of out code, which is awful.&amp;nbsp; However, it won't last too long.&lt;/p&gt;
&lt;p&gt;Now, we can make that test pass.&amp;nbsp; I added an IUnityContainer field to UnityCompositionContainer.&amp;nbsp; I then implemented a constructor to initialize it.&amp;nbsp; Then we needed to implement CreateChildContainer.&amp;nbsp; For this, the simplest thing was to create a new constructor for UnityCompositionContainer which takes a parent container as the only parameter.&amp;nbsp; After a little wire-up we end up with passing tests and this code:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;UnityCompositionContainer(&lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;parentContainer)
{
    Parent = parentContainer;
    wrappedContainer = parentContainer.wrappedContainer.CreateChildContainer();
}&lt;/pre&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;CreateChildContainer()
{
    &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;child = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;);
    &lt;span style="color: blue"&gt;return &lt;/span&gt;child;
}&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Fairly simple.&amp;nbsp; I will continue moving unit tests over, adapting them, and making them pass.&amp;nbsp; If there are any interesting deviations from normal, or new tests added, I'll let you know.&lt;/p&gt;
&lt;p&gt;&amp;lt;timewarp duration="a short while" /&amp;gt;&lt;/p&gt;
&lt;p&gt;That was actually fairly simple.&amp;nbsp; I copied the tests one at a time, replaced the container used with the UnityCompositionContainer, compiled, ran the tests, watched them fail due to NotImplementedExceptions, and fixed them.&amp;nbsp; Here's the test fixture:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;TestClass&lt;/span&gt;]
&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainerFixture
&lt;/span&gt;{
    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;UnityCompositionContainerIsICompositionContainer()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.IsInstanceOfType(container, &lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ICompositionContainer&lt;/span&gt;));
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;NewUnityContainerParentIsNull()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.IsNull(container.Parent);
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;ChildContainerHasParent()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;parent = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();

        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;child = parent.CreateChildContainer();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreSame(parent, child.Parent);
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanRegisterTypeMappingOnRootContainer()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();

        root.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;IFoo &lt;/span&gt;resolvedIFoo = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), resolvedIFoo.GetType());
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanRegisterTypeMappingViaTypeObjects()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        root.RegisterType(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;), &lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;));

        &lt;span style="color: #2b91af"&gt;IFoo &lt;/span&gt;resolvedIFoo = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), resolvedIFoo.GetType());
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RequestingTypeMappingForUnmappedTypeReturnsRequestedType()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();

        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;resolvedFoo = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), resolvedFoo.GetType());
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    [&lt;span style="color: #2b91af"&gt;ExpectedException&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ArgumentException&lt;/span&gt;))]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;TypeMappingsMustBeTypeCompatible()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        root.RegisterType(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;IBar&lt;/span&gt;), &lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;));
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanRegisterMultipleTypeMappings()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();

        root.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;();
        root.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IBar&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Bar&lt;/span&gt;&amp;gt;();
        &lt;span style="color: #2b91af"&gt;IBar &lt;/span&gt;b = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IBar&lt;/span&gt;&amp;gt;();
        &lt;span style="color: #2b91af"&gt;IFoo &lt;/span&gt;f = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Bar&lt;/span&gt;), b.GetType());
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), f.GetType());
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RequestingTypeMappingOnChildReadsFromParent()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;parent = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;child = (&lt;span style="color: #2b91af"&gt;ICompositionContainer&lt;/span&gt;) parent.CreateChildContainer();

        parent.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), child.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;&amp;gt;().GetType());
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;ChildContainersCanOverrideParentTypeMapping()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;parent = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;child = (&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;) parent.CreateChildContainer();

        parent.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;();
        child.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Foo2&lt;/span&gt;&amp;gt;();

        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), parent.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;&amp;gt;().GetType());
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo2&lt;/span&gt;), child.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;IFoo&lt;/span&gt;&amp;gt;().GetType());
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanCreateChildContainer()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();

        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;child = container.CreateChildContainer();
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.IsNotNull(child);
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreNotSame(container, child);
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanRegisterInstance()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        root.RegisterInstance(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"foo"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"bar"&lt;/span&gt;);
        &lt;span style="color: blue"&gt;string &lt;/span&gt;returned = (&lt;span style="color: blue"&gt;string&lt;/span&gt;) root.Resolve(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"foo"&lt;/span&gt;);
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: #a31515"&gt;"bar"&lt;/span&gt;, returned);
    }


    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanRegisterInstanceViaGenericWithoutName()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;f1 = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;();
        root.RegisterInstance&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;(f1);
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;returnedFoo = (&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;) root.Resolve(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;));
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(f1, returnedFoo);
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanRegisterInstanceViaGenericWithName()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;f1 = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;();
        root.RegisterInstance&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"asdf"&lt;/span&gt;, f1);
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;returnedFoo = (&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;) root.Resolve(&lt;span style="color: blue"&gt;typeof &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"asdf"&lt;/span&gt;);
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(f1, returnedFoo);
    }


    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanResolveViaGenericWithoutName()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;f1 = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;();
        root.RegisterInstance&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;(f1);
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;returnedFoo = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;();
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(f1, returnedFoo);
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;CanResolveInstanceViaGenericWithName()
    {
        &lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;root = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;f1 = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;();
        root.RegisterInstance&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"asdf"&lt;/span&gt;, f1);
        &lt;span style="color: #2b91af"&gt;Foo &lt;/span&gt;returnedFoo = root.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;Foo&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"asdf"&lt;/span&gt;);
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(f1, returnedFoo);
    }

    [&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;UnityCompositionContainerImplementsIDisposable()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;disposableContainer = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;();
        &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.IsNotNull(disposableContainer &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDisposable&lt;/span&gt;);
    }

    &lt;span style="color: green"&gt;// This test is commented out intentionally. The purpose of this test is to show 
    // that if you use the generic version of the RegisterTypeMapping method, if the
    // types aren't compatible it'll fail at compile time. 
    // 
    // This is exactly what happens. However that also means this file won't compile.
    // The test is left in as comments, if you wish to verify this then remove the comments,
    // watch the compile file, and then comment it out again.

    //[TestMethod]
    //public void GenericTypeMappingRegistrationEnforcesCompileTimeCompatibility()
    //{
    //    UnityCompositionContainer root = new UnityCompositionContainer();
    //    root.RegisterType&amp;lt;IBar, Foo&amp;gt;();
    //}
&lt;/span&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Notice, there are no tests for the Services collection.&amp;nbsp; This is intentional.&amp;nbsp; We will see if we can avoid implementing the methods at all.&lt;/p&gt;
&lt;p&gt;And here is the code to make those tests pass:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;ICompositionContainer&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;IDisposable
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;parent = &lt;span style="color: blue"&gt;null&lt;/span&gt;;
    &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IUnityContainer &lt;/span&gt;wrappedContainer;

    &lt;span style="color: blue"&gt;public &lt;/span&gt;UnityCompositionContainer()
    {
        wrappedContainer = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
    }

    &lt;span style="color: blue"&gt;private &lt;/span&gt;UnityCompositionContainer(&lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;parentContainer)
    {
        Parent = parentContainer;
        wrappedContainer = parentContainer.wrappedContainer.CreateChildContainer();
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;Parent
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;parent; }
        &lt;span style="color: blue"&gt;set &lt;/span&gt;{ parent = &lt;span style="color: blue"&gt;value&lt;/span&gt;; }
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IServiceCollection &lt;/span&gt;Services
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotImplementedException&lt;/span&gt;(); &lt;span style="color: green"&gt;// return services; 
        &lt;/span&gt;}
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RegisterInstance(&lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;t, &lt;span style="color: blue"&gt;object &lt;/span&gt;instance)
    {
        wrappedContainer.RegisterInstance(t, instance);
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RegisterInstance(&lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;t, &lt;span style="color: blue"&gt;string &lt;/span&gt;name, &lt;span style="color: blue"&gt;object &lt;/span&gt;instance)
    {
        wrappedContainer.RegisterInstance(t, name, instance);
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RegisterInstance&amp;lt;TInterface&amp;gt;(TInterface instance)
    {
        wrappedContainer.RegisterInstance&amp;lt;TInterface&amp;gt;(instance);
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RegisterInstance&amp;lt;TInterface&amp;gt;(&lt;span style="color: blue"&gt;string &lt;/span&gt;name, TInterface instance)
    {
        wrappedContainer.RegisterInstance&amp;lt;TInterface&amp;gt;(name, instance);
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RegisterType&amp;lt;TRequested, TReturned&amp;gt;() &lt;span style="color: blue"&gt;where &lt;/span&gt;TReturned : TRequested
    {
        wrappedContainer.RegisterType&amp;lt;TRequested, TReturned&amp;gt;();
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;RegisterType(&lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;requested, &lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;returned)
    {
        wrappedContainer.RegisterType(requested, returned);
    }

    &lt;span style="color: blue"&gt;public object &lt;/span&gt;Resolve(&lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;typeOfItem)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;wrappedContainer.Resolve(typeOfItem);
    }

    &lt;span style="color: blue"&gt;public object &lt;/span&gt;Resolve(&lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;typeOfItem, &lt;span style="color: blue"&gt;string &lt;/span&gt;name)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;wrappedContainer.Resolve(typeOfItem, name);
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;T Resolve&amp;lt;T&amp;gt;()
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;wrappedContainer.Resolve&amp;lt;T&amp;gt;();
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;T Resolve&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;string &lt;/span&gt;name)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;wrappedContainer.Resolve&amp;lt;T&amp;gt;(name);
    }

    &lt;span style="color: blue"&gt;public object &lt;/span&gt;BuildItem(&lt;span style="color: #2b91af"&gt;IBuilder&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;WCSFBuilderStage&lt;/span&gt;&amp;gt; builder, &lt;span style="color: blue"&gt;object &lt;/span&gt;item)
    {
        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotImplementedException&lt;/span&gt;();
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ICompositionContainer &lt;/span&gt;CreateChildContainer()
    {
        &lt;span style="color: #2b91af"&gt;UnityCompositionContainer &lt;/span&gt;child = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityCompositionContainer&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;child;
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;Dispose()
    {
        wrappedContainer.Dispose();
        wrappedContainer = &lt;span style="color: blue"&gt;null&lt;/span&gt;;
    }
}&lt;/pre&gt;&lt;/blockquote&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;We are now in a green state, time to check in.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Abusing Source Control&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Agile teams usually check in very often.&amp;nbsp; Some teams check in every time they hit green.&amp;nbsp; I think that is a bit of overkill, unless you have a source control system with NO overhead.&amp;nbsp; I check in when I complete a feature or a story, and usually at a few good, green stopping points in the process, like I have been doing.&amp;nbsp; This was a good stopping point, and my next task is a bit risky, so this is a perfect time to check in.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is a long enough post, even though I didn't do all that much, that I will call it quits for today.&amp;nbsp; Next post, actually use the UnityCompositionContainer, and then nuke the old CompositionContainer.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8447888" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Example+Driven+Design+_2800_Formerly+TDD_2900_/default.aspx">Example Driven Design (Formerly TDD)</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Unity/default.aspx">Unity</category></item><item><title>Smart Client Software Factory – April 2008 Release is available on MSDN</title><link>http://blogs.msdn.com/mpuleio/archive/2008/04/25/smart-client-software-factory-april-2008-release-is-available-on-msdn.aspx</link><pubDate>Sat, 26 Apr 2008 03:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8425078</guid><dc:creator>mpuleio</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8425078.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8425078</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8425078</wfw:comment><description>&lt;P&gt;The April 2008 release of the Smart Client Software Factory is now available at &lt;A href="http://msdn2.microsoft.com/en-us/library/aa480482.aspx" target=_blank&gt;&lt;FONT color=#0000ff&gt;http://msdn2.microsoft.com/en-us/library/aa480482.aspx&lt;/FONT&gt;&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This is a port of the last release&amp;nbsp;(May 2007,&amp;nbsp;if I recall&amp;nbsp;correctly)&amp;nbsp;to VS2008.&amp;nbsp; No new features were added.&amp;nbsp; A few bugs were fixed, and a number of work items from CodePlex were closed.&lt;/P&gt;
&lt;P&gt;This release supports Enterprise Library 3.1.&amp;nbsp; It does not support Enterprise Library 4.0.&amp;nbsp; If you want EntLib 4.0 (once it is released) you have the source code, and should be able to get it to work, if you really need to.&amp;nbsp; I would not recommend it, as you will end up with two containers (Unity and the CAB container), which means code bloat and challenges deciding where objects should go.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8425078" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Example+Driven+Design+_2800_Formerly+TDD_2900_/default.aspx">Example Driven Design (Formerly TDD)</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Smart+Client+Software+Factory/default.aspx">Smart Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Windows+Forms/default.aspx">Windows Forms</category></item><item><title>Converting the Composite Web Application Block to Unity - Ummmm...Oooops.</title><link>http://blogs.msdn.com/mpuleio/archive/2008/04/22/converting-the-composite-web-application-block-to-unity-ummmm-oooops.aspx</link><pubDate>Wed, 23 Apr 2008 02:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8417509</guid><dc:creator>mpuleio</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8417509.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8417509</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8417509</wfw:comment><description>&lt;P&gt;This is the forth post in a series. The other post include 
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-intro.aspx" mce_href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-intro.aspx"&gt;Converting the Composite Web Application Block to Unity - Intro&lt;/A&gt;. 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-adding-an-icompositioncontainer.aspx" target=_blank mce_href="http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-adding-an-icompositioncontainer.aspx"&gt;Converting the Composite Web Application Block to Unity - Adding an ICompositionContainer&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mpuleio/archive/2008/04/09/converting-the-composite-web-application-block-to-unity-clean-up-icompositioncontainer.aspx" mce_href="http://blogs.msdn.com/mpuleio/archive/2008/04/09/converting-the-composite-web-application-block-to-unity-clean-up-icompositioncontainer.aspx"&gt;Converting the Composite Web Application Block to Unity - Clean Up ICompositionContainer&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you want background, go read the earlier posts. 
&lt;P&gt;Based upon feedback, I am making the source code available at &lt;A title=http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" target=_blank mce_href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity"&gt;CWAB and Unity&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In the last installment I wanted to remove the following from the ICompositionContainer:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRIKE&gt;static methods &lt;/STRIKE&gt;
&lt;LI&gt;&lt;STRIKE&gt;Builder &lt;/STRIKE&gt;
&lt;LI&gt;&lt;STRIKE&gt;Locator &lt;/STRIKE&gt;
&lt;LI&gt;&lt;STRIKE&gt;Containers &lt;/STRIKE&gt;
&lt;LI&gt;Services&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;We completed the first four. In this installment, we will remove the Services collection, replacing it with using RegisterInstance and Resolve. After that, we will compare our ICompositionContainer to IUnityContainer, see what else we need to do, and may even pull in Unity. 
&lt;H3&gt;Adding a few new methods&lt;/H3&gt;
&lt;P&gt;Before we do this, I want to add a generic overload to Resolve and one to RegisterInstance.&amp;nbsp; I like the way the generic calls on Unity look, compared to all the typeof() and casting we have done so far.&amp;nbsp; 
&lt;P&gt;I added the following tests, one at a time, and made them pass: 
&lt;BLOCKQUOTE&gt;&lt;PRE class=code&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;TestMethod&lt;/SPAN&gt;]
&lt;SPAN style="COLOR: blue"&gt;public void &lt;/SPAN&gt;CanRegisterInstanceViaGenericWithoutName()
{
    &lt;SPAN style="COLOR: #2b91af"&gt;ICompositionContainer &lt;/SPAN&gt;root = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TestableRootCompositionContainer&lt;/SPAN&gt;();
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;f1 = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;();
    root.RegisterInstance&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;&amp;gt;(f1);
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;returnedFoo = (&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;)root.Resolve(&lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;));
    &lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.AreEqual(f1, returnedFoo);
}

[&lt;SPAN style="COLOR: #2b91af"&gt;TestMethod&lt;/SPAN&gt;]
&lt;SPAN style="COLOR: blue"&gt;public void &lt;/SPAN&gt;CanRegisterInstanceViaGenericWithName()
{
    &lt;SPAN style="COLOR: #2b91af"&gt;ICompositionContainer &lt;/SPAN&gt;root = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TestableRootCompositionContainer&lt;/SPAN&gt;();
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;f1 = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;();
    root.RegisterInstance&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #a31515"&gt;"asdf"&lt;/SPAN&gt;, f1);
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;returnedFoo = (&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;)root.Resolve(&lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;), &lt;SPAN style="COLOR: #a31515"&gt;"asdf"&lt;/SPAN&gt;);
    &lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.AreEqual(f1, returnedFoo);
}


[&lt;SPAN style="COLOR: #2b91af"&gt;TestMethod&lt;/SPAN&gt;]
&lt;SPAN style="COLOR: blue"&gt;public void &lt;/SPAN&gt;CanResolveViaGenericWithoutName()
{
    &lt;SPAN style="COLOR: #2b91af"&gt;ICompositionContainer &lt;/SPAN&gt;root = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TestableRootCompositionContainer&lt;/SPAN&gt;();
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;f1 = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;();
    root.RegisterInstance&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;&amp;gt;(f1);
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;returnedFoo = root.Resolve&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;&amp;gt;();
    &lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.AreEqual(f1, returnedFoo);
}

[&lt;SPAN style="COLOR: #2b91af"&gt;TestMethod&lt;/SPAN&gt;]
&lt;SPAN style="COLOR: blue"&gt;public void &lt;/SPAN&gt;CanResolveInstanceViaGenericWithName()
{
    &lt;SPAN style="COLOR: #2b91af"&gt;ICompositionContainer &lt;/SPAN&gt;root = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TestableRootCompositionContainer&lt;/SPAN&gt;();
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;f1 = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;();
    root.RegisterInstance&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #a31515"&gt;"asdf"&lt;/SPAN&gt;, f1);
    &lt;SPAN style="COLOR: #2b91af"&gt;Foo &lt;/SPAN&gt;returnedFoo = root.Resolve&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Foo&lt;/SPAN&gt;&amp;gt;(&lt;SPAN style="COLOR: #a31515"&gt;"asdf"&lt;/SPAN&gt;);
    &lt;SPAN style="COLOR: #2b91af"&gt;Assert&lt;/SPAN&gt;.AreEqual(f1, returnedFoo);
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In making them pass, I added the following to the ICompositionContainer interface:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;PRE class=code&gt;T Resolve&amp;lt;T&amp;gt;();
T Resolve&amp;lt;T&amp;gt;(&lt;SPAN style="COLOR: blue"&gt;string &lt;/SPAN&gt;name);
&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;RegisterInstance&amp;lt;TInterface&amp;gt;(TInterface instance);
&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;RegisterInstance&amp;lt;TInterface&amp;gt;(&lt;SPAN style="COLOR: blue"&gt;string &lt;/SPAN&gt;name, TInterface instance);&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;This will help a bit with the look, feel, and style of the code, now for the real work.&lt;/P&gt;
&lt;H3&gt;Removing the Services Collection&lt;/H3&gt;
&lt;P&gt;Why do we want to remove the Services collection?&amp;nbsp; Since Unity handles this sort of functionality, we can offload it entirely to Unity.&amp;nbsp; This will cut a bit of code out of our implementation. 
&lt;P&gt;Let's do this the simple way, (I like to call it hack and slash development) and just remove the Services collection from the ICompositionContainer interface.&amp;nbsp; This will result in a number of build errors (twenty or so, in fact).&amp;nbsp; However, we can fix each of them easily.&amp;nbsp; Any call to add a service becomes a RegisterInstance call, and any call to get a service becomes a Resolve call.&amp;nbsp; So, we will hack each problem until we are in a green state again.&amp;nbsp; The other option, for the less daring, is to search for all uses of Services, change them one at a time, and make sure we are green at each step.&amp;nbsp; Today, I am feeling brave (read: reckless, or overly caffeinated), so I took the other approach.&amp;nbsp; If I were pairing with someone, they would probably stop me. :-) 
&lt;P&gt;Once CWAB compiles, we still need to get the unit test library to compile.&amp;nbsp; &amp;lt;click click click&amp;gt; &amp;lt;swear&amp;gt; &amp;lt;click click click&amp;gt;.&amp;nbsp; The biggest challenge here is that Services.AddNew&amp;lt;T, IT&amp;gt; and RegisterType&amp;lt;IT, T&amp;gt; have the generic parameters in reversed order.&amp;nbsp; Aaargh. 
&lt;P&gt;Everything compiles, but I have a problem: 34 unit tests are failing.&amp;nbsp; This is not optimal.&amp;nbsp; Now, why are they failing?&amp;nbsp; After looking at the first few, it looks like I removed Services from the interface, and forgot to remove it from the CompositionContainer.&amp;nbsp; The result is that some tests are still using the ServicesCollection.&amp;nbsp; Oooops. 
&lt;P&gt;After removing Services from CompostionContainer, and getting everything to compile again, the test results are..... 
&lt;P&gt;Ouch!&amp;nbsp; 40 failing unit tests.&amp;nbsp; That is not good. 
&lt;P&gt;However, after some investigation, I can remove a couple of classes from our solution, as they are no longer necessary, and are just causing problems. 
&lt;BLOCKQUOTE&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ServiceDependencyParameterResolver&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ProviderDependencyParameterResolver&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ProviderDependencyAttribute&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ServiceDependencyAttribute&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;After removing them, there is a bit of code cleanup required, to remove references.&amp;nbsp; All of the ServiceDependencyAttributes I replaced with ObjectBuilder DependencyAttributes.&amp;nbsp; The ProviderAttributes, I commented out for the moment.&lt;/P&gt;
&lt;P&gt;Wow. Progress. we are down to 37 failing tests. After looking at a few of them, where instances were not the same, I changed the SingletonPolicy in Resolve, and we are down to 24 failing tests. 
&lt;P&gt;Oh, gotta take a break. 
&lt;P&gt;&amp;lt;TimeWarp&amp;gt;Several Days Fly By&amp;lt;/TimeWarp&amp;gt; 
&lt;P&gt;I got interrupted from getting this working the other day.&amp;nbsp; Now, I am starting with broken tests.&amp;nbsp; I hate that.&amp;nbsp; I guess I was a bit too reckless.&amp;nbsp; Well, I have a few options: 
&lt;OL&gt;
&lt;LI&gt;I can continue and see this through 
&lt;LI&gt;I can timebox to a hour, and then roll back, and try again by taking smaller steps 
&lt;LI&gt;I can give up now and try again from the last known good state.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;I am going to opt for number 1.5: timebox to two hours, and depending on where I am, make a decision. 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;timewarp duration="1 hour" /&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;@#$%^%$#@#$!!! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;timewarp duration="a few days" reason="I needed to think about it" /&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have determined that I got a bit overzealous.&amp;nbsp; For the moment, the Services collection is necessary, and we can remove it once we have Unity in place to provide the necessary functionality.&amp;nbsp; It will stay as part of the interface, and will continue to provide functionality until we no longer need it.&amp;nbsp; However, it will eventually go away.&amp;nbsp; How did I arrive at this conclusion?&amp;nbsp; Well, I could not get the failing unit tests to pass in a reasonable amount of time.&amp;nbsp; Moving the functionality requires a lot more code than is really practical for throw-away code.&amp;nbsp; Oooops.&amp;nbsp; Everyone makes mistakes.&amp;nbsp; 
&lt;P&gt;As a result, I need to roll back a lot of changes.&amp;nbsp; Unfortunately, I did not back up everything (or do a check in) before starting down the path of removing the services collection.&amp;nbsp; Net result: I need to roll back everything, and then re-do the first half of this article. Double @#%$@%!&lt;/P&gt;
&lt;P&gt;I'll revert and then rework the code up to the section &lt;EM&gt;Removing the Services Collection&lt;/EM&gt;.&amp;nbsp; I'll get the code posted (&lt;A href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" target=_blank mce_href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity"&gt;with the other source code&lt;/A&gt;) before I start the next installment.&lt;/P&gt;
&lt;P&gt;However, I wanted to post this article sooner rather than later, so folks don't think I have dropped the series.&amp;nbsp; Enjoy.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8417509" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Example+Driven+Design+_2800_Formerly+TDD_2900_/default.aspx">Example Driven Design (Formerly TDD)</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Unity/default.aspx">Unity</category></item><item><title>Unity Shipped</title><link>http://blogs.msdn.com/mpuleio/archive/2008/04/08/unity-shipped.aspx</link><pubDate>Wed, 09 Apr 2008 02:06:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8370334</guid><dc:creator>mpuleio</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8370334.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8370334</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8370334</wfw:comment><description>&lt;p&gt;I am a little late to the party, but &lt;a href="http://www.codeplex.com/unity" target="_blank"&gt;Unity&lt;/a&gt; shipped last week.&lt;/p&gt; &lt;p&gt;Here are a few other posts about it:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Grigori: &lt;a href="http://blogs.msdn.com/agile/archive/2008/04/04/unity-di-container-1-0-shipped.aspx"&gt;Unity DI container 1.0 shipped!&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Chris: &lt;a href="http://www.tavaresstudios.com/Blog/post/Unity-10-is-released!.aspx"&gt;Unity 1.0 is released!&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I have used Unity in an internal project here at p&amp;amp;p, as well as a proof of concept re-write of CWAB using Unity.&amp;nbsp; The interface is clean and simple.&amp;nbsp; It does what you want.&amp;nbsp; Configuration is easy.&amp;nbsp; It makes unit testing simpler via de-coupling. &lt;strong&gt;&lt;em&gt;Unity rocks.&amp;nbsp; &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8370334" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Example+Driven+Design+_2800_Formerly+TDD_2900_/default.aspx">Example Driven Design (Formerly TDD)</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Converting the Composite Web Application Block to Unity - Intro</title><link>http://blogs.msdn.com/mpuleio/archive/2008/04/04/converting-the-composite-web-application-block-to-unity-intro.aspx</link><pubDate>Fri, 04 Apr 2008 23:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8358223</guid><dc:creator>mpuleio</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8358223.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8358223</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8358223</wfw:comment><description>&lt;P&gt;A few weeks ago, I decided I needed to play with the &lt;A href="http://www.codeplex.com/unity" target=_blank mce_href="http://www.codeplex.com/unity"&gt;Unity Dependency Injection container&lt;/A&gt;. I wanted to see how Chris and the rest of the team had designed it and see how usable the container was. I had seen requests on the &lt;A href="http://www.codeplex.com/websf" target=_blank mce_href="http://www.codeplex.com/websf"&gt;Web Client Software Factory&lt;/A&gt; project's CodePlex site asking for a Unity version of WCSF. Put the two together, and I have a side project, a proof of concept I can legitimately do at work. My eventual end goal is to have the Order Management RI working with a new, Unity-based version of CWAB. 
&lt;P&gt;So, I sat down a few Saturdays ago, with CWAB, an early drop of Unity, and started working. After about eight hours I had the basics of CWAB working: there was a container, and a module loader, global services, and module level services. About 3 hours was used figuring out Unity, the differences between it and the container we created for CWAB (CompositionContainer) , and how to get around them. The rest was work, finding bugs in Unity (I filed a few the next day), and quite a lot of fun. 
&lt;P&gt;Since then, I have added a few more features, made some forwards progress, and lost ground after being overly optimistic about the impact of a few changes. 
&lt;P&gt;Now that I have learned a bit, I wanted to share the information with folks who might be interested in doing this themselves. Rather than trying to remember what I did the first time around, I am going to start over, take a different approach, document what I do as I go, and make a few posts out of this. 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Please keep in mind, none of this is tested.&amp;nbsp; Use at your own risk.&amp;nbsp; No Support Available.&amp;nbsp; Danger, Will Robinson!&amp;nbsp; Danger!&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a proof of concept that I am fairly certain will work, but I am not 100% certain. We will find out as we go. Oh, and I guarantee that there will be breaking changes. 
&lt;P&gt;My strategy will be to take the existing CWAB DLL and its unit tests, refactor the container behind an interface, modify the interface to nearly match Unity, and then drop Unity in replacing one implementation of the interface with another. After I get CWAB building and the unit tests passing with Unity, I will open up the code for the RI, replace references, and get it to work. 
&lt;P&gt;I will do all of this in an example-driven &lt;STRIKE&gt;test driven&lt;/STRIKE&gt; manner. I am sure I will cheat on occasion, but I will try to be honest and point it out when I do, as well as a reason why. &lt;/P&gt;
&lt;P&gt;EDIT: Based upon feedback, I am making the source code available at &lt;A title=http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity href="http://www.codeplex.com/websf/Wiki/View.aspx?title=CWAB%20and%20Unity" target=_blank&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;CWAB and Unity&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8358223" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Data-mining for Code Quality Metrics</title><link>http://blogs.msdn.com/mpuleio/archive/2008/04/02/data-mining-for-code-quality-metrics.aspx</link><pubDate>Thu, 03 Apr 2008 02:30:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8352663</guid><dc:creator>mpuleio</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8352663.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8352663</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8352663</wfw:comment><description>&lt;p&gt;I spent two weeks between full time projects (still working on the 2 part time projects I am on) looking back at the build logs from the past 6 months (or so) trying to figure out what metrics we have, what we should track going forward, and what goals we should have for these metrics.&amp;nbsp;&amp;nbsp; I came up with some interesting findings.&lt;/p&gt; &lt;p&gt;First, overall unit test code coverage was OK, but not as high as I would like on my projects.&amp;nbsp; Of course, these numbers included generated code, view code, and other things that I usually filter out.&amp;nbsp; Also coverage was fairly flat.&amp;nbsp; For the most part, as we added code, we added tests.&amp;nbsp; This, I think is much better than one of the alternatives, having coverage drop over the course of the project.&lt;/p&gt; &lt;p&gt;Here is coverage for the Application Blocks in WCSF, without axis labels.&amp;nbsp; The Y axis starts at 76% (not zero).&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mpuleio/WindowsLiveWriter/CodeQualityMetrics_BA15/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="589" alt="image" src="http://blogs.msdn.com/blogfiles/mpuleio/WindowsLiveWriter/CodeQualityMetrics_BA15/image_thumb_1.png" width="1028" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You will see that there was a noticeable drop in coverage part way through the project. That was when we added a new library of AJAX controls.&amp;nbsp; Before the change was made we knew this would happen and accepted the risk.&amp;nbsp; I also worked with the testers on my team to mitigate the risk via more acceptance tests and careful code reviews. And after the change, we trended up, slowly, over time.&lt;/p&gt; &lt;p&gt;In addition to watching coverage over time, I was able to come up with a few indices to watch going forward.&amp;nbsp; Thanks to &lt;a href="http://www.ndepend.com/" target="_blank"&gt;NDepend&lt;/a&gt;, a little bit of work parsing build logs, and Linq, I was able to create seven indices, three of which I will be watching closely on future projects:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Cyclomatic Complexity&lt;/li&gt; &lt;li&gt;Afferent Coupling&lt;/li&gt; &lt;li&gt;Efferent Coupling&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you want a definition for any of these, check out the NDepend site.&amp;nbsp; The index for each of these is the average of the top 10 worst values by type.&lt;/p&gt; &lt;p&gt;Here is a graph of these indices over time for another, un-named project (without the axis labels)&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mpuleio/WindowsLiveWriter/CodeQualityMetrics_BA15/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="772" alt="image" src="http://blogs.msdn.com/blogfiles/mpuleio/WindowsLiveWriter/CodeQualityMetrics_BA15/image_thumb.png" width="1021" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;You can see that the first few builds did not have NDepend hooked up properly.&amp;nbsp; Then everything tracks along, relatively stable until about 40% through the project.&amp;nbsp; The Dev Lead on the project was able to tell me what happened on the day that the Cyclomatic Complexity dropped drastically.&amp;nbsp; It was a big change to simplify things.&lt;/p&gt; &lt;p&gt;Do these graphs, numbers, and indices (and all the others that I pulled from the data, but did not share yet) tell me the whole story as far as code quality?&amp;nbsp; &lt;em&gt;&lt;strong&gt;Of course not&lt;/strong&gt;&lt;/em&gt;.&amp;nbsp; However, these can all be used as indicators.&amp;nbsp; If complexity trends sharply up over time, there may be a problem we need to investigate.&amp;nbsp; If it stays low, there can still be other problems hidden.&amp;nbsp; However, a little information is better than none.&lt;/p&gt; &lt;p&gt;Now, on to the next project...&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8352663" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Example+Driven+Design+_2800_Formerly+TDD_2900_/default.aspx">Example Driven Design (Formerly TDD)</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Agile/default.aspx">Agile</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Weird COM Exceptions in SCSF/CAB Unit Tests</title><link>http://blogs.msdn.com/mpuleio/archive/2008/03/19/weird-com-exceptions-in-scsf-cab-unit-tests.aspx</link><pubDate>Wed, 19 Mar 2008 22:17:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8326122</guid><dc:creator>mpuleio</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8326122.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8326122</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8326122</wfw:comment><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;The SCSF project was getting a weird error with the unit tests that were brought forward from VS2005 to VS2008. &lt;p&gt;All the unit tests would pass, however the test run would fail with the following error in a special log file: &lt;blockquote&gt; &lt;p&gt;&lt;font face="Consolas" color="#ff0000"&gt;One of the background threads threw exception: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.&lt;br&gt;at System.Windows.Input.TextServicesContext.StopTransitoryExtension()&lt;br&gt;at System.Windows.Input.TextServicesContext.Uninitialize(Boolean appDomainShutdown)&lt;br&gt;at System.Windows.Input.TextServicesContext.OnAppDomainUnloaded(Object sender, EventArgs args)&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Of course, we had hundreds of these messages, and no way to correlate them with a specific unit test. &lt;p&gt;After some work, I was able to find a single repro case.&amp;nbsp; After some research, it looks like &lt;b&gt;any&lt;/b&gt; unit test that creates a Window of any type will do this. The fix is to add a TestCleanup method to your fixture like this one: &lt;blockquote&gt; &lt;p&gt;&lt;font face="Consolas" color="#008000"&gt;// Added a TestCleanup method to deal with the fact that the code was throwing an InvalidComObjectException&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas" color="#008000"&gt;// with the information "COM object that has been separated from its underlying RCW cannot be used."&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas" color="#008000"&gt;// Fix is based on this bug logged on Connect.Microsoft.Com:&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#008000"&gt;// &lt;/font&gt;&lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=318333"&gt;&lt;font color="#008000"&gt;http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=318333&lt;/font&gt;&lt;/a&gt;&lt;font color="#008000"&gt;&amp;nbsp;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;[TestCleanup]&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;public void&lt;/font&gt; CleanUp()&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;{&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&amp;nbsp;&amp;nbsp; System.Windows.Threading.Dispatcher.CurrentDispatcher.InvokeShutdown();&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;I know that unit tests that create Windows are not ideal, but for things like CAB and SCSF ( code bases I inherited) it may be necessary. &lt;p&gt;I hope this helps anyone else who runs into this issue.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8326122" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Smart+Client+Software+Factory/default.aspx">Smart Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/WPF/default.aspx">WPF</category></item><item><title>The .NET Framework is a bit on the big side.</title><link>http://blogs.msdn.com/mpuleio/archive/2008/03/18/the-net-framework-is-a-bit-on-the-big-side.aspx</link><pubDate>Wed, 19 Mar 2008 07:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8324754</guid><dc:creator>mpuleio</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/8324754.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=8324754</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=8324754</wfw:comment><description>&lt;P&gt;As anyone who has ever tried to find docs on MSDN already knows, the .NET Framework is big.&amp;nbsp; Real big.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I can see the feedback already:&amp;nbsp; &lt;EM&gt;Thanks, Mike for stating the bloody obvious....&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Seriously, though, how big is this library that we&amp;nbsp;have been building applications, web sites, critical line-of-business apps, and other frameworks on top of?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/brada/default.aspx" mce_href="http://blogs.msdn.com/brada/default.aspx"&gt;Brad Abrams&lt;/A&gt; posted all about the &lt;A class="" href="http://blogs.msdn.com/brada/archive/2008/03/17/number-of-types-in-the-net-framework.aspx" mce_href="http://blogs.msdn.com/brada/archive/2008/03/17/number-of-types-in-the-net-framework.aspx"&gt;Number of Types in the .NET Framework&lt;/A&gt;. This includes&amp;nbsp;info about the different versions of the .NET Framework, and the numbers of assemblies, namespaces, types, and members.&lt;/P&gt;
&lt;P&gt;As a counterpoint, &lt;A class="" href="http://codebetter.com/blogs/patricksmacchia/default.aspx" mce_href="http://codebetter.com/blogs/patricksmacchia/default.aspx"&gt;Patrick Smacchia&lt;/A&gt; posted&amp;nbsp;&lt;A class="" href="http://codebetter.com/blogs/patricksmacchia/archive/2008/03/18/number-of-types-in-the-net-framework.aspx" mce_href="http://codebetter.com/blogs/patricksmacchia/archive/2008/03/18/number-of-types-in-the-net-framework.aspx"&gt;Number of Types in the .NET Framework.&lt;/A&gt;&amp;nbsp;using the numbers that he generated&amp;nbsp;with &lt;A class="" href="http://www.ndepend.com/" mce_href="http://www.ndepend.com/"&gt;nDepend&lt;/A&gt;. (&lt;FONT color=#ff0000&gt;Note from the lawyers: This is a link to an external Web site that provides software.&amp;nbsp;Please note that Microsoft is not responsible for the content of external Internet sites. )&amp;nbsp; &lt;/FONT&gt;These numbers are a little differnt than Brad's.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that in mind, it is no wonder that I forget how things in the framework work, every once in a while.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;As a personal aside: &amp;nbsp;I am a very happy, licensed user of nDepend, and it &lt;EM&gt;&lt;STRONG&gt;&lt;U&gt;rocks&lt;/U&gt;&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; I have used it to help simplify APIs and frameworks like the Composite Web Application Block in WCSF.&amp;nbsp; nDepend allowed me to file bugs against my team's code because methods were too big and complex, or types were too tightly coupled, or classes/interfaces needed to be moved from one assembly to another.&amp;nbsp; &amp;nbsp; One of my current projects is to data mine all the p&amp;amp;p build logs&amp;nbsp;from the past 6 months+ to glean information about our code and improvements we should be making.&amp;nbsp; nDepend results in those build logs&amp;nbsp;provide a lot of data.&amp;nbsp; I may post more about that project later.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Enjoy.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8324754" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Web Client Software Factory February 2008 Ships!</title><link>http://blogs.msdn.com/mpuleio/archive/2008/02/28/web-client-software-factory-february-2008-ships.aspx</link><pubDate>Thu, 28 Feb 2008 22:25:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7937016</guid><dc:creator>mpuleio</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/7937016.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=7937016</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=7937016</wfw:comment><description>&lt;p&gt;I know that folks have been reading about the Web Client Software Factory on Blaine's blog and on Glenn's blog.&amp;nbsp; Blaine posted about what we planned to include, back in December with &lt;a href="http://blogs.msdn.com/blaine/archive/2007/12/13/next-version-of-web-client-software-factory-wcsf.aspx"&gt;Next version of Web Client Software Factory (WCSF)&lt;/a&gt;.&amp;nbsp; Glenn had the post at the end of January, &lt;a href="http://blogs.msdn.com/gblock/archive/2008/01/31/web-client-2-0-closer-than-you-think.aspx"&gt;Web Client 2.0 closer than you think&lt;/a&gt;, and &lt;a href="http://blogs.msdn.com/gblock/archive/2008/02/22/web-client-2-0-what-s-the-hold-up.aspx"&gt;Web Client 2.0, what's the hold up?&lt;/a&gt;&amp;nbsp; &lt;/p&gt; &lt;h2&gt;So, what is in the latest version of the Web Client Software Factory?&lt;/h2&gt; &lt;p&gt;Here is a quick blurb from the front page of our docs, with my comments in &lt;font color="#0000ff"&gt;Blue&lt;/font&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;The February 2008 release of the Web Client Software Factory is an update to the June 2007 release. The following are the major changes:  &lt;ul&gt; &lt;li&gt;&lt;b&gt;Added user interface responsiveness guidance&lt;/b&gt;. The guidance includes documentation, Web controls, QuickStarts, and a new reference implementation that demonstrate how to incorporate Microsoft ASP.NET AJAX technologies in your Web applications to provide a richer user interface experience.  &lt;li&gt;&lt;b&gt;Added support for &lt;/b&gt;&lt;b&gt;the &lt;/b&gt;&lt;b&gt;Model-View-Presenter pattern &lt;/b&gt;&lt;b&gt;in&lt;/b&gt; &lt;b&gt;user controls and master pages&lt;/b&gt;. The Composite Web Application Block includes a new Dependency Injection mechanism that facilitates the implementation of the Model-View-Presenter pattern in Web controls and master pages. The guidance package also includes new recipes that help developers create master pages and user controls that implement the Model-View-Presenter pattern. By using the Model-View-Presenter, developers can extend the testability surface to user controls and master pages. &lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Dependency Injection also works in ASMX Web Services hosted in a WCSF web application project&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;User controls can be&lt;/b&gt; &lt;b&gt;reused across modules&lt;/b&gt;. Developers can build Web pages made up of user controls from different modules. &lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;There is an example of this in the Order Management Reference Implementation&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;Updated the Composite Web Application Block&lt;/b&gt;. The main changes include the following:  &lt;ul&gt; &lt;li&gt;Improved performance  &lt;li&gt;Support for services registration through configuration  &lt;li&gt;Support for type mapping for dependency injection &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Type mapping was a no-brainer to add.&amp;nbsp; We also needed it to show a few of the deeper concepts around MVP.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;The performance improvements are the part of how the new &lt;a href="http://www.codeplex.com/unity"&gt;Unity project&lt;/a&gt; works &lt;em&gt;deep&lt;/em&gt; under the hood.&amp;nbsp; &lt;a href="http://www.tavaresstudios.com/Blog/"&gt;Chris Tavares&lt;/a&gt; and worked with the WCSF team on the performance enhancements.&amp;nbsp; Later, Chris went to start the Unity project, which has evolved into a great tool from what I have seen.&amp;nbsp; I know the next question is "When will WCSF support Unity?"&amp;nbsp; My answer is as soon as we can do a complete re-write.&amp;nbsp; Out of the box, Unity provides a lot of functionality that CWAB provides.&amp;nbsp; To properly use Unity, we would need to throw out a lot of the CWAB code, and re-do it.&amp;nbsp; &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;The ability to add a service via config was requested by the community, and is shown in the Order Management Reference Implementation.&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;Updates to the &lt;/b&gt;&lt;b&gt;Add Business Module and Add Foundational Module recipes&lt;/b&gt;. These recipes now include a new option to create a separate project for the modules’ public interface.  &lt;li&gt;&lt;b&gt;Updated the patterns &lt;/b&gt;&lt;b&gt;documentation &lt;/b&gt;&lt;b&gt;topics&lt;/b&gt;. The main changes include two new pattern description topics, Inversion of Control and Module Interface Separation, and it updates to the Model-View-Presenter topic.  &lt;li&gt;&lt;b&gt;Included additional guidance for &lt;/b&gt;&lt;b&gt;several&lt;/b&gt; &lt;b&gt;technical concepts&lt;/b&gt;. The technical concepts covered are views testability, modularity, autocomplete, validation, and search. The guidance consists of documentation, QuickStarts, Web controls, and How-to topics. &lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;These concepts were shipped previously as "Bundles" on our CodePlex community.&amp;nbsp; We will be releasing new, updated VS2008 versions of these bundles on MSDN in the near future, but all the content is in the factory.&amp;nbsp; The bundles are so folks can get a small taste and look at a single feature or concept in isolation.&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;Added support for Visual Studio 2008 to the guidance package&lt;/b&gt;. &lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;VS2008 and and .NET 3.5 support was asked for very loudly by customers.&lt;/font&gt;&lt;/p&gt; &lt;h2&gt;Testing Guidance&lt;/h2&gt; &lt;p&gt;Something we do not talk about enough is the fact that we are releasing some guidance on how to test web applications.&amp;nbsp; First, since we do most development via &lt;strike&gt;TDD&lt;/strike&gt; EDD (Example Driven Development), we have quite a bit in the way of unit tests.&amp;nbsp; There are a few exceptions, where we intentionally do not include unit tests as we do not want to clutter a QuickStart example with another concept that may hinder understanding of what the QuickStart is about. &lt;/p&gt; &lt;p&gt;We are also shipping acceptance tests.&amp;nbsp; In a few projects, these acceptance tests are manual test scripts in the form of a Visual Studio Manual Test.&amp;nbsp; In others, we have completely automated the acceptance tests using &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;lt;TheLawyersMadeMeSayIt&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;Note: this is a link to an external Web site that provides software that can be used to write acceptance tests. Please note that Microsoft is not responsible for the content of external Internet sites. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;lt;/TheLawyersMadeMeSayIt&amp;gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the &lt;a href="http://watin.sourceforge.net/"&gt;WatiN (Web Application Testing in .NET)&lt;/a&gt;.&amp;nbsp; &lt;/p&gt; &lt;p&gt;To compile the test projects and run the tests, you will need VS2008 Professional or Team System, and to download the WatiN binaries, and copy the DLLs to the Lib folder (which our help describes with more info).&amp;nbsp; The upside is that anyone can see how we are doing functional/acceptance testing&amp;nbsp; of our sample applications.&amp;nbsp; Of course, there is a lot more to testing than just acceptance testing, but it is a start.&lt;/p&gt; &lt;h2&gt;Other resources&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;The &lt;a href="http://msdn.com/webclientfactory"&gt;WCSF page on MSDN&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.codeplex.com/websf"&gt;The WCSF Community on CodePlex&lt;/a&gt; &lt;/li&gt; &lt;li&gt;If you just want to peruse the docs, check out the &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=websf&amp;amp;ReleaseId=1563"&gt;WCSF Documentation download page&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;You will also want to check out what Blaine and Glenn say about the release:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Blaine's post: &lt;a href="http://blogs.msdn.com/blaine/archive/2008/02/28/web-client-software-factory-shipped.aspx"&gt;Web Client Software Factory Shipped&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Glenn's post: &lt;a href="http://blogs.msdn.com/gblock/archive/2008/02/28/web-client-software-factory-2-0-shipped.aspx"&gt;Web Client Software Factory 2.0 Shipped&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7937016" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Example+Driven+Design+_2800_Formerly+TDD_2900_/default.aspx">Example Driven Design (Formerly TDD)</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Developing a ASP .NET Control with client capabilities</title><link>http://blogs.msdn.com/mpuleio/archive/2007/10/31/developing-a-asp-net-control-with-client-capabilities.aspx</link><pubDate>Wed, 31 Oct 2007 20:16:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5801289</guid><dc:creator>mpuleio</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/5801289.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=5801289</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=5801289</wfw:comment><description>&lt;p&gt;Brian J. Cardiff ( from Clarius Consulting) is one of the developers on the Web Client team.&amp;#xA0; He has asked me to post an article for him, since he does not have a blog (yet).&lt;/p&gt;  &lt;p&gt;Here it is (with some re-formatting):&lt;/p&gt;  &lt;blockquote&gt;   &lt;h2&gt;Developing a ASP .NET Control with client capabilities (using ASP .NET Ajax Extensions support)&lt;/h2&gt;    &lt;p&gt;Since the &lt;a href="http://www.asp.net/ajax/ajaxcontroltoolkit/"&gt;AjaxControlToolkit&lt;/a&gt; appears, creating extenders control like &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoComplete.aspx"&gt;Autocomplete&lt;/a&gt; (&lt;a href="http://www.asp.net/ajax/ajaxcontroltoolkit/"&gt;AjaxControlToolkit&lt;/a&gt;) or &lt;a href="http://www.codeplex.com/websf/Wiki/View.aspx?title=Autocomplete_landing_page&amp;amp;referringTitle=Home"&gt;Contextual Autocomplete&lt;/a&gt; (&lt;a href="http://www.codeplex.com/websf"&gt;Web Software Factory&lt;/a&gt;) is a task that involves more work in JavaScript and Metadata that classic .NET programming. &lt;/p&gt;    &lt;p&gt;In this post I will point out some of the key aspects to create, a Control that takes advance of the &lt;a href="http://www.asp.net/ajax/"&gt;ASP .NET Ajax Extensions&lt;/a&gt;. The post is based on the &lt;b&gt;RealTimeSearchMonitor&lt;/b&gt; control located inside the &lt;a href="http://www.codeplex.com/websf/Wiki/View.aspx?title=bundles&amp;amp;referringTitle=Home"&gt;Search Bundle&lt;/a&gt; of the &lt;a href="http://www.codeplex.com/websf"&gt;Web Software Factory&lt;/a&gt;. So I suggest downloading and opening it while you read the post, just to take a quick look at it.&lt;/p&gt;    &lt;p&gt;When you want to create a control that will reside on client side, what would you need? (and where it is implemented in &lt;b&gt;RealTimeSearch&lt;/b&gt; project)&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;ASP.NET Control that implements &lt;b&gt;IScriptControl&lt;/b&gt;&lt;/li&gt;      &lt;li&gt;RealTimeSearchMonitor.cs&lt;/li&gt;      &lt;li&gt;A JavaScript file that will define classes and/or function for the control.&lt;/li&gt;      &lt;li&gt;RealTimeSearchBehavior.js&lt;/li&gt;      &lt;li&gt;Some lines of JavaScript code to instantiate a client side object.&lt;/li&gt;      &lt;li&gt;These are generated from GetRealTimeSearchMonitorScriptDescriptor protected method.&lt;/li&gt;      &lt;li&gt;(Optional) ASP .NET Control Designer&lt;/li&gt;      &lt;li&gt;RealTimeSearchDesigner.cs, metadata all around and type converter.&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;The &lt;b&gt;IScriptControl&lt;/b&gt; interface defines two method:&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;IEnumerable&amp;lt;ScriptReference&amp;gt; GetScriptReferences()&lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;This indicates that a reference to RealTimeSearchBehavior.js file should be included&lt;/p&gt;    &lt;p&gt;In the response you will have: &lt;/p&gt;    &lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ScriptResource.axd?d=&lt;i&gt;&amp;#x2026;(some identifier)&amp;#x2026;&amp;quot;&lt;/i&gt; &amp;gt;&amp;lt;/script &amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;ul&gt;     &lt;li&gt;IEnumerable&amp;lt;ScriptDescriptor&amp;gt; GetScriptDescriptors()&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;This calls GetRealTimeSearchMonitorScriptDescriptor protected method.&lt;/p&gt;    &lt;p&gt;In the response you will have: &lt;/p&gt;    &lt;p&gt;Sys.Application.add_init(function() {&lt;/p&gt;    &lt;p&gt;$create(&lt;/p&gt;    &lt;p&gt;RealTimeSearch.RealTimeSearchBehavior, &lt;/p&gt;    &lt;p&gt;{&amp;quot;controlsToMonitor&amp;quot;:[&lt;/p&gt;    &lt;p&gt;{&amp;quot;TargetId&amp;quot;:&amp;quot;ctl00_DefaultContent_CompanyNameTextBox&amp;quot;,&lt;/p&gt;    &lt;p&gt;&amp;quot;Callback&amp;quot;:&amp;quot;javascript:__doPostBack(\u0027ctl00$DefaultContent$CompanyNameTextBox\u0027,\u0027\u0027)&amp;quot;,&lt;/p&gt;    &lt;p&gt;&amp;quot;Validators&amp;quot;:[&amp;quot;ctl00_DefaultContent_CompanyNameRegexValidator&amp;quot;]}, &lt;/p&gt;    &lt;p&gt;&lt;i&gt;&amp;#x2026;(more controlsToMonitor elements)&amp;#x2026;&lt;/i&gt;}],&lt;/p&gt;    &lt;p&gt;&amp;quot;interval&amp;quot;:700}, null, null, &lt;/p&gt;    &lt;p&gt;$get(&amp;quot;ctl00_DefaultContent_CustomerRealTimeSearchMonitor&amp;quot;));&lt;/p&gt;    &lt;p&gt;});&lt;/p&gt;    &lt;h3&gt;What does the GetRealTimeSearchMonitorScriptDescriptor method do?&lt;/h3&gt;    &lt;p&gt;Using properties of the &lt;b&gt;RealTimeSearchMonitor&lt;/b&gt; it generates the info that the control will need in the client side. In this case: resolving control's ClientID, Callback for the specified event and related validators to each controls (see ResolveControlMonitorParameter method). It's no magic but &lt;b&gt;a very important point where all get wired&lt;/b&gt;.&lt;/p&gt;    &lt;p&gt;The &lt;b&gt;ScriptComponentDescriptor&lt;/b&gt; has to be related with a DOM element in the client side, so our control will also generate an empty DIV, this is done in the Render method.&lt;/p&gt;    &lt;h3&gt;&lt;b&gt;Although IScriptControl interface is implemented&lt;/b&gt;&lt;/h3&gt;    &lt;p&gt;Although &lt;b&gt;IScriptControl&lt;/b&gt; interface is implemented you have to call RegisterScriptControl and RegisterScriptDescriptors methods in the &lt;b&gt;ScriptManager&lt;/b&gt; of the page in order to get our GetScriptReferences and GetScriptDescriptors called respectively. The former is done in the PreRender and the later in the Render method.&lt;/p&gt;    &lt;h3&gt;Conclusions&lt;/h3&gt;    &lt;p&gt;It's good to have a simple (but useful) example of a control with client capabilities using ASP .NET Ajax Extensions. There is quite a good infrastructure to develop your own controls, go ahead and give you a chance to know it and use it!&lt;/p&gt;    &lt;p&gt;Brian J. Cardiff (Clarius Consulting)&lt;/p&gt;    &lt;p&gt;&lt;a href="mailto:brian.cardiff@clariusconsulting.net"&gt;brian.cardiff@clariusconsulting.net&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Please feel free to leave comments here, or email Brian directly.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5801289" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Web+Client+Software+Factory/default.aspx">Web Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category></item><item><title>The future of WPF Guidance</title><link>http://blogs.msdn.com/mpuleio/archive/2007/10/29/the-future-of-wpf-guidance.aspx</link><pubDate>Mon, 29 Oct 2007 22:53:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5770196</guid><dc:creator>mpuleio</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mpuleio/comments/5770196.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpuleio/commentrss.aspx?PostID=5770196</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mpuleio/rsscomments.aspx?PostID=5770196</wfw:comment><description>&lt;p&gt;There is a lot of new information, all announced today, about the future of Acropolis, CAB, and WPF guidance from &lt;a href="http://www.msdn.com/practices" target="_blank"&gt;patterns &amp;amp; practices&lt;/a&gt;.&amp;#xA0; This comes about after a lot of internal discussions between the patterns &amp;amp; practices Client / User Experience team and the Acropolis team.&lt;/p&gt;  &lt;p&gt;If you want to know what is going on, start with the &lt;a href="http://blogs.msdn.com/acropolis" target="_blank"&gt;Acropolis team blog&lt;/a&gt;, and their article &lt;a href="http://blogs.msdn.com/acropolis/archive/2007/10/29/An-Acropolis-Update.aspx" target="_blank"&gt;A new phase for the Acropolis project.&lt;/a&gt;&amp;#xA0; Then read &lt;a href="http://blogs.msdn.com/gblock" target="_blank"&gt;Glenn&lt;/a&gt;'s post, &lt;a href="http://blogs.msdn.com/gblock/archive/2007/10/26/wpf-composite-client-guidance-it-s-coming.aspx" target="_blank"&gt;WPF Composite Client, it's coming!&lt;/a&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Between the two, there is a lot of information: how things have changed with Acropolis, a little bit of guidance about what to do now with apps you are developing, and the future plans of p&amp;amp;p and Acropolis.&lt;/p&gt;  &lt;p&gt;If you have feedback, either post comments here, add comments to Glenn's post, or send email to Glenn (his address is at the end of his post).&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;[Note: &lt;a href="http://blogs.msdn.com/blaine" target="_blank"&gt;Blaine&lt;/a&gt; also is linking to these articles in &lt;a href="http://blogs.msdn.com/blaine/archive/2007/10/29/wpf-composite-client.aspx" target="_blank"&gt;his own post&lt;/a&gt;.]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5770196" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/Smart+Client+Software+Factory/default.aspx">Smart Client Software Factory</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/mpuleio/archive/tags/WPF/default.aspx">WPF</category></item></channel></rss>