<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Enterprise Architecture</title>
        <link>http://geekswithblogs.net/Podwysocki/category/4473.aspx</link>
        <description>Enterprise Architecture</description>
        <language>en-US</language>
        <copyright>Matthew Podwysocki</copyright>
        <managingEditor>matthew.podwysocki@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>CMAP Code Camp Wrap Up - Dependency Injection and IoC Containers</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/13/121219.aspx</link>
            <description>I really enjoyed speaking at this past weekend's CMAP Code Camp.  I hope you all enjoyed my presentation on "Loosen Your Dependencies with Dependency Injection and Inversion of Control Containers".  It was a great discussion to have with everyone and I like to learn there as much as I teach.  &lt;br /&gt;
&lt;br /&gt;
I also enjoyed teaming up with &lt;a href="http://odetocode.com/blogs/scott/"&gt;Scott Allen&lt;/a&gt; on his "A Gentle Introduction to Mocking" where we talked about mocks versus stubs, test pattens and mock frameworks such as &lt;a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx"&gt;Rhino Mocks&lt;/a&gt; and &lt;a href="http://code.google.com/p/moq/"&gt;Moq&lt;/a&gt;.  Hopefully we'll be doing some more ping-pong sessions in the future.&lt;br /&gt;
&lt;br /&gt;
Once again, I'd like to plug my &lt;a href="http://altnet.ent0.com/MainPage.ashx"&gt;DC ALT.NET&lt;/a&gt; group that I run.  Our next meeting is scheduled for April 23rd and the topic will be Continuous Integration with &lt;a href="http://jayflowers.com/joomla/"&gt;Jay Flowers&lt;/a&gt;.  We'll announce the location shortly for our group.  You can go ahead and sign up for our mailing list &lt;a href="http://tech.groups.yahoo.com/group/dcaltnet/"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Anyhow, here are some resources that can help point you in the right direction.  This includes articles, blogs and such that I find will be useful in your journey to better understand these things:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Articles
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.objectmentor.com/resources/articles/dip.pdf"&gt;The Dependency Inversion Principle&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/architecture/introducingcastle.aspx"&gt;Introducing Castle - Part I&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://martinfowler.com/eaaDev/PassiveScreen.html"&gt;Model View Presenter - Passive View&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://martinfowler.com/eaaDev/SupervisingPresenter.html"&gt;Model View Presenter - Supervising Controller&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Blogs
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;Inversion of Control Containers and the Dependency Injection pattern&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://martinfowler.com/bliki/InversionOfControl.html"&gt;MF Bliki - Inversion of Control&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx"&gt;List of .NET Dependency Injection Containers (IOC)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Books
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Principles-Patterns-Practices-Robert-Martin/dp/0131857258/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1207865320&amp;amp;sr=1-1"&gt;Agile Principles, Patterns and Practices in C#&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=pd_sim_b_title_5"&gt;Patterns of Enterprise Application Architecture&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
My presentation materials have just been uploaded to my &lt;a href="http://skydrive.live.com"&gt;SkyDrive&lt;/a&gt;.  The PowerPoint presentation can be found &lt;a href="http://cid-102e0d11b5a19652.skydrive.live.com/self.aspx/Public/IoC_Container_Training.pptx"&gt;here&lt;/a&gt; and the code samples can be found &lt;a href="http://cid-102e0d11b5a19652.skydrive.live.com/self.aspx/Public/Samples.rar"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
If you note, I my code uses the following products in order to get it to run:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://asp.net/mvc/"&gt;ASP.NET MVC Preview 2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://codeplex.com/xunit"&gt;xUnit.net&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://castleproject.org/"&gt;Castle Windsor&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://structuremap.sourceforge.net/"&gt;StructureMap&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://codeplex.com/unity"&gt;Unity Application Block&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.codeplex.com/unitycontributions"&gt;Unity Community Contributions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Feedback is always appreciated.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/13/121219.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/13/121219.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121219"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121219" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/121219.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/13/121219.aspx</guid>
            <pubDate>Mon, 14 Apr 2008 03:45:14 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121219.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/13/121219.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121219.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121219.aspx</trackback:ping>
        </item>
        <item>
            <title>Unity Community Contributions and Interception</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/11/121194.aspx</link>
            <description>Now that Unity has been released into the wild, there has definitely been a bit of interest swirling around it.  One of my key wants for a good IoC container is basic interception capabilities.  My criteria for evaluating a container usually comes down to the following:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Configurability (XML, DSL, Code)&lt;/li&gt;
    &lt;li&gt;Dependency Resolution, usually opinionated&lt;/li&gt;
    &lt;li&gt;Lifetime Management (Per Thread, Pooled, Singleton, Transient, etc)&lt;/li&gt;
    &lt;li&gt;Extensibility for Interception&lt;/li&gt;
&lt;/ul&gt;
So, I realized that Unity was missing some of these things in the first go around.  Since Unity was built on top of ObjectBuilder2, a next generation version of the often maligned ObjectBuilder which also included some sample DI containers and a flexible interception model.  Today's post will cover that and a bit more.  I realize that I still am working on a post of AOP in the Enterprise and Spring.NET which is coming soon.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;
&lt;br /&gt;
Where We Are&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
But, before we begin today, let's see what we've already covered in the past:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/04/07/unity-1-0-released-into-the-wild.aspx"&gt;Unity 1.0 Released into the Wild&lt;/a&gt;&lt;br /&gt;
    Unity 1.0 released and available on MSDN.  Unfortunately, registration is required...&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/03/27/ioc-and-unity-configuration-changes-for-the-better.aspx"&gt;IoC and Unity - Configuration Changes for the Better&lt;/a&gt;&lt;br /&gt;
    Covers the configuration changes to allow for better parameterization for constructors&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/03/25/ioc-and-unity-the-basics-and-interception.aspx"&gt;IoC and Unity - The Basics and Interception&lt;/a&gt;&lt;br /&gt;
    Talking about the basics of IoC containers and the interception models&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/03/07/ioc-container-unity-and-breaking-changes-galore.aspx"&gt;IoC Container, Unity and Breaking Changes Galore&lt;/a&gt;&lt;br /&gt;
    Covers the breaking changes made from the old Unity drop to the new one&lt;br /&gt;
    &lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/03/04/ioc-containers-unity-and-objectbuilder2-the-saga-continues.aspx"&gt;&lt;br /&gt;
    &lt;/a&gt;     &lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0);/*1206509408817*/"&gt;IoC Containers, Unity and ObjectBuilder2 - The Saga Continues&lt;/a&gt;&lt;br /&gt;
    Managing instances and parameter mapping resolution&lt;br /&gt;
    &lt;a href="http://geekswithblogs.net/Podwysocki/archive/2008/02/26/120002.aspx"&gt;&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/02/26/ioc-and-the-unity-application-block-once-again.aspx"&gt;IoC and the Unity Application Block Once Again&lt;/a&gt;&lt;br /&gt;
    Setter Injection versus Constructor Injection and PostSharp4Unity&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/02/22/ioc-and-the-unity-application-block-going-deeper.aspx"&gt;IoC and the Unity Application Block - Going Deeper&lt;/a&gt;&lt;br /&gt;
    Constructor Injection and comparing Unity with Castle Windsor&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/02/18/ioc-and-the-unity-application-block.aspx"&gt;IoC and the Unity Application Block&lt;/a&gt;&lt;br /&gt;
    Covering ObjectBuilder and Unity Application Block&lt;/li&gt;
&lt;/ul&gt;
Now that we've look at the history of this series, let's go ahead and get started.&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;Unity Contributions&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Since Unity was released last Friday, there has been a community effort much like the ASP.NET MVC Contributions, &lt;a href="http://www.codeplex.com/MVCContrib"&gt;MVCContrib&lt;/a&gt;, called &lt;a href="http://www.codeplex.com/unitycontributions"&gt;Unity Community Contributions&lt;/a&gt;.  This project is intended to fill in the gaps where the community feels that Unity can be extended, much like most other IoC containers.  As I stated above, one of those crucial things that I thought was missing was taking the ObjectBuilder2 Interception model and applying it towards Unity.  I wasn't interested as much in the Policy Injection Application Block, although nice, is a bit heavyweight for the basic operations I would like.  Instead, the OB2 would suffice for most things that I'd want with a container.  So, that led me to another topic...&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;ObjectBuilder2 Interception == Unity Interception?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Since I was particularly motivated to see the OB2 Interception model pushed into Unity, I decided to give it a go myself.  For the most part, I was successful in a way, but I wasn't using the right extensibility model.  From that point, I got in contact with&lt;a href="http://blogs.msdn.com/scottdensmore/"&gt; Scott Densmore&lt;/a&gt;, a PM within the Patterns &amp;amp; Practices group and one of the authors of ObjectBuilder2 along with &lt;a href="http://bradwilson.typepad.com/"&gt;Brad Wilson&lt;/a&gt;.  From that point, he was able to take the original OB2 Interception model and fit it nicely into the Unity extensibility model.  The code is now available on the Unity Community Contributions and you can find those commits by Scott &lt;a href="http://www.codeplex.com/unitycontributions/SourceControl/ListDownloadableCommits.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
So, let's take a look at what it entails.  As I tell most people, you learn the most about the software with good unit, I mean behavioral tests where I can really grok the intent of the code much better than most documentation.  I encourage most people to do the same.  I'd rather stay away from those projects that don't have tests to back up their work.&lt;br /&gt;
&lt;br /&gt;
Like I said before, ObjectBuilder2 had several ways of intercepting calls.  There are several interception strategies worth mentioning:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Virtual Method interception&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Interface Method interception&lt;/li&gt;
    &lt;li&gt;.NET Remoting interception (MarshalByRefObject)&lt;/li&gt;
&lt;/ul&gt;
From that, you have two ways of registering your interest for interception:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Intercept via code&lt;/li&gt;
    &lt;li&gt;Intercept via attributes&lt;/li&gt;
&lt;/ul&gt;
Now that we've laid down the basics, let's take a look at some of the unit tests.  You'll notice that &lt;a href="http://codeplex.com/xunit"&gt;xUnit.net&lt;/a&gt; was used for the unit tests.  Yes, I know, I've mentioned it a few times lately.  Anyhow, let's look first at virtual method interception.&lt;br /&gt;
&lt;br /&gt;
Before we get started on that, in order to perform interception, we need to implement the IInterceptionHandler interface.  For the unit tests, this will be used to record the various actions that happened during the interception process.  But you can imagine it to do any number of things such as logging, transaction management, security and so on.  Any of those cross cutting concerns, really.&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 static\cf3  \cf1 class\cf3  \cf4 IoC\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf1 static\cf3  \cf5 IDependencyResolver\cf3  resolver;\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  \cf1 void\cf3  Initialize(\cf5 IDependencyResolver\cf3  resolver)\par ??        \{\par ??            \cf4 IoC\cf3 .resolver = resolver;\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;()\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;();\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;(\cf1 string\cf3  name)\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;(name);\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;&lt;br /&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 153, 0);"&gt;public delegate&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IMethodReturn&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;InovkeHandlerDelegate&lt;/span&gt;&lt;span style="color: rgb(0, 204, 255);"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IMethodInvocation&lt;/span&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;call,&lt;/span&gt;&lt;br /&gt;
                                                        &lt;span style="color: rgb(43, 145, 175);"&gt;GetNextHandlerDelegate&lt;/span&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;getNext);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
    &lt;span style="color: rgb(255, 153, 0);"&gt;public delegate&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;InovkeHandlerDelegate&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;GetNextHandlerDelegate&lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
    &lt;span style="color: rgb(255, 153, 0);"&gt;public interface&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IInterceptionHandler&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(255, 255, 255);"&gt;     {&lt;/span&gt;&lt;br /&gt;
        &lt;span style="color: rgb(43, 145, 175);"&gt;IMethodReturn &lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Invoke(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IMethodInvocation&lt;/span&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;call,&lt;/span&gt;&lt;br /&gt;
                             &lt;span style="color: rgb(43, 145, 175);"&gt;GetNextHandlerDelegate&lt;/span&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;getNext);&lt;/span&gt;&lt;br style="color: rgb(255, 255, 255);" /&gt;
&lt;span style="color: rgb(255, 255, 255);"&gt;     }&lt;/span&gt;&lt;br style="color: rgb(255, 255, 255);" /&gt;
&lt;span style="color: rgb(255, 255, 255);"&gt; } &lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;   &lt;span style="color: rgb(255, 153, 0);"&gt;public class&lt;/span&gt; &lt;span style="color: rgb(255, 255, 0);"&gt;RecordingHandler &lt;/span&gt;: &lt;span style="color: rgb(43, 145, 175);"&gt;IInterceptionHandler&lt;/span&gt;&lt;br /&gt;
    {&lt;br /&gt;
        &lt;span style="color: rgb(255, 153, 0);"&gt;readonly string &lt;/span&gt;message;&lt;br /&gt;
&lt;br /&gt;
        [&lt;span style="color: rgb(255, 255, 0);"&gt;InjectionConstructor&lt;/span&gt;]&lt;br /&gt;
        &lt;span style="color: rgb(255, 153, 0);"&gt;public &lt;/span&gt;RecordingHandler()&lt;br /&gt;
        {&lt;br /&gt;
            message = &lt;span style="color: rgb(0, 255, 0);"&gt;""&lt;/span&gt;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        &lt;span style="color: rgb(255, 153, 0);"&gt;public &lt;/span&gt;RecordingHandler(&lt;span style="color: rgb(255, 153, 0);"&gt;string &lt;/span&gt;message)&lt;br /&gt;
        {&lt;br /&gt;
            &lt;span style="color: rgb(255, 153, 0);"&gt;this&lt;/span&gt;.message = &lt;span style="color: rgb(255, 153, 0);"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(0, 255, 0);"&gt;" ({0})"&lt;/span&gt;, message);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        &lt;span style="color: rgb(255, 153, 0);"&gt;public &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IMethodReturn&lt;/span&gt; Invoke(&lt;span style="color: rgb(43, 145, 175);"&gt;IMethodInvocation&lt;/span&gt; call,&lt;br /&gt;
                                    &lt;span style="color: rgb(43, 145, 175);"&gt;GetNextHandlerDelegate&lt;/span&gt; getNext)&lt;br /&gt;
        {&lt;br /&gt;
            &lt;span style="color: rgb(255, 255, 0);"&gt;Recorder&lt;/span&gt;.Records.Add(&lt;span style="color: rgb(0, 255, 0);"&gt;"Before Method"&lt;/span&gt; + message);&lt;br /&gt;
            &lt;span style="color: rgb(43, 145, 175);"&gt;IMethodReturn &lt;/span&gt;result = getNext().Invoke(call, getNext);&lt;br /&gt;
            &lt;span style="color: rgb(255, 255, 0);"&gt;Recorder&lt;/span&gt;.Records.Add(&lt;span style="color: rgb(0, 255, 0);"&gt;"After Method" &lt;/span&gt;+ message);&lt;br /&gt;
            &lt;span style="color: rgb(255, 153, 0);"&gt;return &lt;/span&gt;result;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
We have the ability through the Invoke method to do things before the method as well as after.  Should we need to modify values before the method is called, we can go ahead and do so.  Now that we looked at that, let's get to some unit tests.  First off, let's look at interception through just code.  I like this approach as opposed to attributes due to not cluttering the domain model and making it more configurable at run time.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 static\cf3  \cf1 class\cf3  \cf4 IoC\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf1 static\cf3  \cf5 IDependencyResolver\cf3  resolver;\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  \cf1 void\cf3  Initialize(\cf5 IDependencyResolver\cf3  resolver)\par ??        \{\par ??            \cf4 IoC\cf3 .resolver = resolver;\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;()\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;();\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;(\cf1 string\cf3  name)\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;(name);\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;            [&lt;span style="color: yellow;"&gt;Fact&lt;/span&gt;]&lt;br /&gt;
            &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;void&lt;/span&gt; InterceptViaCode()&lt;br /&gt;
            {&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;Recorder&lt;/span&gt;.Records.Clear();&lt;br /&gt;
                &lt;span style="color: rgb(43, 145, 175);"&gt;IUnityContainer&lt;/span&gt; container = &lt;span style="color: rgb(255, 128, 0);"&gt;new&lt;/span&gt; &lt;span style="color: yellow;"&gt;UnityContainer&lt;/span&gt;();&lt;br /&gt;
                container.AddNewExtension&amp;lt;&lt;span style="color: rgb(255, 255, 0);"&gt;InterceptionExtension&lt;/span&gt;&amp;gt;();&lt;br /&gt;
               container.Configure&lt;span style="color: rgb(255, 255, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IInterceptionConfiguration&lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;&amp;gt;().&lt;/span&gt;InterceptVirtual&amp;lt;&lt;span style="color: rgb(255, 255, 0);"&gt;SpyVirtual&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                   (&lt;span style="color: rgb(255, 153, 0);"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(255, 255, 0);"&gt;SpyVirtual&lt;/span&gt;).GetMethod(&lt;span style="color: rgb(0, 255, 0);"&gt;"InterceptedMethod"&lt;/span&gt;), &lt;span style="color: rgb(255, 153, 0);"&gt;new &lt;/span&gt;&lt;span style="color: rgb(255, 255, 0);"&gt;RecordingHandler&lt;/span&gt;());&lt;br /&gt;
&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;SpyVirtual&lt;/span&gt; obj = container.Resolve&amp;lt;&lt;span style="color: yellow;"&gt;SpyVirtual&lt;/span&gt;&amp;gt;();&lt;br /&gt;
                obj.InterceptedMethod();&lt;br /&gt;
                obj.NonInterceptedMethod();&lt;br /&gt;
&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;Assert&lt;/span&gt;.Equal(4, &lt;span style="color: yellow;"&gt;Recorder&lt;/span&gt;.Records.Count);&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;Assert&lt;/span&gt;.Equal(&lt;span style="color: rgb(0, 255, 0);"&gt;"Before Method"&lt;/span&gt;, &lt;span style="color: yellow;"&gt;Recorder&lt;/span&gt;.Records[0]);&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;Assert&lt;/span&gt;.Equal(&lt;span style="color: rgb(0, 255, 0);"&gt;"In Method"&lt;/span&gt;, &lt;span style="color: yellow;"&gt;Recorder&lt;/span&gt;.Records[1]);&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;Assert&lt;/span&gt;.Equal(&lt;span style="color: rgb(0, 255, 0);"&gt;"After Method"&lt;/span&gt;, &lt;span style="color: yellow;"&gt;Recorder&lt;/span&gt;.Records[2]);&lt;br /&gt;
                &lt;span style="color: yellow;"&gt;Assert&lt;/span&gt;.Equal(&lt;span style="color: rgb(0, 255, 0);"&gt;"In Non-Intercepted Method"&lt;/span&gt;, &lt;span style="color: yellow;"&gt;Recorder&lt;/span&gt;.Records[3]);&lt;br /&gt;
            }&lt;span style="color: rgb(255, 128, 0);"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;br /&gt;
            &lt;span style="color: rgb(255, 153, 0);"&gt;public class&lt;/span&gt; &lt;span style="color: rgb(255, 255, 0);"&gt;SpyVirtual&lt;/span&gt;&lt;br /&gt;
            {&lt;br /&gt;
                &lt;span style="color: rgb(255, 153, 0);"&gt;public virtual void&lt;/span&gt; InterceptedMethod()&lt;br /&gt;
                {&lt;br /&gt;
                    &lt;span style="color: rgb(255, 255, 0);"&gt;Recorder&lt;/span&gt;.Records.Add(&lt;span style="color: rgb(0, 255, 0);"&gt;"In Method"&lt;/span&gt;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                &lt;span style="color: rgb(255, 153, 0);"&gt;public void&lt;/span&gt; NonInterceptedMethod()&lt;br /&gt;
                {&lt;br /&gt;
                    &lt;span style="color: rgb(255, 255, 0);"&gt;Recorder&lt;/span&gt;.Records.Add(&lt;span style="color: rgb(0, 255, 0);"&gt;"In Non-Intercepted Method"&lt;/span&gt;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                &lt;span style="color: rgb(255, 153, 0);"&gt;public virtual void&lt;/span&gt; ThrowsException()&lt;br /&gt;
                {&lt;br /&gt;
                    &lt;span style="color: rgb(255, 255, 0);"&gt;Recorder&lt;/span&gt;.Records.Add(&lt;span style="color: rgb(0, 255, 0);"&gt;"In Method"&lt;/span&gt;);&lt;br /&gt;
                    &lt;span style="color: rgb(255, 153, 0);"&gt;throw new&lt;/span&gt; Exception(&lt;span style="color: rgb(0, 255, 0);"&gt;"This is my exception!"&lt;/span&gt;);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
As you see above, we can simply register our interest through the registration of the InterceptionExtension and then set up the configuration through the IInterceptionConfiguration.  From that point, we then say which kind of interception we want whether it be virtual, remoting or interfaces.  We specify the method we want to intercept by name.&lt;br /&gt;
&lt;br /&gt;
You can also do the interception through the use of attributes.  From this point, we need to decorate our methods with the attribute and the particular interception handler we want to use.  We need to be aware of which interception strategy we're using as well when we decorate our classes.  You can intercept methods as well as property accessors by decorating the get or set.  Below is a simple example of a virtual interceptor registration.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 static\cf3  \cf1 class\cf3  \cf4 IoC\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf1 static\cf3  \cf5 IDependencyResolver\cf3  resolver;\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  \cf1 void\cf3  Initialize(\cf5 IDependencyResolver\cf3  resolver)\par ??        \{\par ??            \cf4 IoC\cf3 .resolver = resolver;\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;()\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;();\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;(\cf1 string\cf3  name)\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;(name);\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;             &lt;span style="color: rgb(255, 153, 0);"&gt;public class&lt;/span&gt; &lt;span style="color: rgb(255, 255, 0);"&gt;SpyVirtualAttributes&lt;/span&gt;&lt;br /&gt;
            {&lt;br /&gt;
                [&lt;span style="color: rgb(255, 255, 0);"&gt;VirtualIntercept&lt;/span&gt;(&lt;span style="color: rgb(255, 153, 0);"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(255, 255, 0);"&gt;RecordingHandler&lt;/span&gt;))]&lt;br /&gt;
                &lt;span style="color: rgb(255, 153, 0);"&gt;public virtual void&lt;/span&gt; InterceptedMethod()&lt;br /&gt;
                {&lt;br /&gt;
                    &lt;span style="color: rgb(255, 255, 0);"&gt;Recorder&lt;/span&gt;.Records.Add(&lt;span style="color: rgb(0, 255, 0);"&gt;"In Method"&lt;/span&gt;);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;/p&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
I'm not going to post all of the tests, but I want to give you an idea of the power of this.  It's still early in the process and there is some cleanup still going on.  But, I encourage you to pick up the source, read it, grok it, give it a try and give feedback. &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt; Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the extensibility model of Unity works in that we can add interception to Unity.  So, we can start thinking about moving our cross cutting concerns to these layers should we so choose if Unity is your container of choice.  There are plenty of containers out there to choose from, so it's best to give them all a try and pick one based upon features, programming style, and heck, maybe even licensing.  I'll be showing some of this stuff off tomorrow at the CMAP Code Camp, so if you'll be at my 1PM session, be prepared.  Until next time... &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/11/121194.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/11/121194.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121194"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121194" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/121194.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/11/121194.aspx</guid>
            <pubDate>Fri, 11 Apr 2008 23:35:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121194.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/11/121194.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121194.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121194.aspx</trackback:ping>
        </item>
        <item>
            <title>RockNUG IoC Container Presentation Wrapup</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/10/121175.aspx</link>
            <description>I want to thank the fine folks at the &lt;a href="http://rocknug.org/"&gt;Rockville .NET Users Group (RockNUG)&lt;/a&gt; and &lt;a href="http://www.vpsw.com/blogbaby/default.aspx"&gt;Dean Fiala&lt;/a&gt; for giving me the opportunity to speak last night.  It was a record crowd last night, so I'm glad that people were interested in Loose Coupling, Design Patterns, Test Driven Development, Behavior Driven Development and Inversion of Control containers.  I hope everyone got some good information, and if not interested in using containers, design patterns and such, at least know they exist and have their use.  Based on the feedback I've already received, it was warming and why I like presenting at user groups, so that both of us can learn.&lt;br /&gt;
&lt;br /&gt;
Once again, I'd like to plug my &lt;a href="http://altnet.ent0.com/MainPage.ashx"&gt;DC ALT.NET&lt;/a&gt; group that I run.  Our next meeting is scheduled for April 23rd and the topic will be Continuous Integration with &lt;a href="http://jayflowers.com/joomla/"&gt;Jay Flowers&lt;/a&gt;.  We'll announce the location shortly for our group.  You can go ahead and sign up for our mailing list &lt;a href="http://tech.groups.yahoo.com/group/dcaltnet/"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Anyhow, here are some resources that can help point you in the right direction.  This includes articles, blogs and such that I find will be useful in your journey to better understand these things:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Articles
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.objectmentor.com/resources/articles/dip.pdf"&gt;The Dependency Inversion Principle&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/architecture/introducingcastle.aspx"&gt;Introducing Castle - Part I&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Blogs
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;Inversion of Control Containers and the Dependency Injection pattern&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://martinfowler.com/bliki/InversionOfControl.html"&gt;MF Bliki - Inversion of Control&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx"&gt;List of .NET Dependency Injection Containers (IOC)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Books
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Principles-Patterns-Practices-Robert-Martin/dp/0131857258/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1207865320&amp;amp;sr=1-1"&gt;Agile Principles, Patterns and Practices in C#&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=pd_sim_b_title_5"&gt;Patterns of Enterprise Application Architecture&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
After my &lt;a href="http://www.cmap-online.org/CodeCamp/"&gt;CMAP Code Camp&lt;/a&gt; session over the weekend, I will go ahead and post my slides and code samples for your enjoyment.  So, if you're in the Columbia, MD area this weekend and haven't signed up, go ahead and do so.  Hope to see a great crowd there! &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/10/121175.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/10/121175.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121175"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121175" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/121175.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/10/121175.aspx</guid>
            <pubDate>Thu, 10 Apr 2008 22:10:21 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121175.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/10/121175.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121175.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121175.aspx</trackback:ping>
        </item>
        <item>
            <title>Understanding AOP in .NET</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/03/28/120836.aspx</link>
            <description>In my previous posts I have talked a bit about Inversion of Control (IoC) containers with respect to Interception and Aspect Oriented Programming (AOP).  It's not only important to understand the uses and strategies for implementing your solutions using it, but also how interception and AOP works deep down in .NET.  Instead of a long, drawn out post, I think I'll just include some articles and posts that do a very good job of explaining some of the ideas behind it.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Articles and Posts&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I think it'd be good if we just start out with some basic MSDN articles and such regarding AOP and interception.  Some of them may be older but the concepts will still apply to this day:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.ayende.com/Blog/archive/2007/07/02/7-Approaches-for-AOP-in-.Net.aspx"&gt;7 Approaches for AOP in .NET&lt;/a&gt;&lt;br /&gt;
    &lt;a href="http://www.ayende.com/"&gt;Ayende&lt;/a&gt; covers a few ways of doing AOP in .NET using existing frameworks&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/magazine/cc164165.aspx"&gt;Decouple Components by Injecting Custom Services into Your Object's Interception Chain&lt;/a&gt;&lt;br /&gt;
    &lt;a href="http://www.idesign.net/idesign/DesktopDefault.aspx?tabid=5&amp;amp;tabindex=3"&gt;Juval Lowy&lt;/a&gt;, in the March 2003 MSDN magazine, writes about using contexts for an object's execution scope and intercepting calls to and from that object.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa288717(vs.71).aspx"&gt;Aspect Oriented Programming (September 2005 Technical article)&lt;br /&gt;
    &lt;/a&gt;&lt;a href="http://www.theagiledeveloper.com/"&gt;Matthew Deiters&lt;/a&gt; describes aspect oriented programming and covers joinpoints, pointcuts, advice and mixins with regards to a simple example using VB.NET.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/magazine/cc301356.aspx"&gt;AOP: Apsect Oriented Programming Enables Better Code Encapsulation and Reuse&lt;/a&gt;&lt;br /&gt;
    &lt;a href="http://www.dharmashukla.com/"&gt;Dharma Shukla&lt;/a&gt;, &lt;a href="http://www.pocketsoap.com/weblog/"&gt;Simon Fell&lt;/a&gt; and &lt;a href="http://www.sellsbrothers.com/"&gt;Chris Sells&lt;/a&gt; write in the March 2002 MSDN Magazine with regards to the history to COM and AOP and then relate how it works in .NET.  Rather dated article but the foundations still apply.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/architecture/AOP_Injection_IL.aspx"&gt;AOP using System.Reflection.Emit&lt;/a&gt;&lt;br /&gt;
    Roberto Loreto writes on CodeProject how to intercept method calls of an external type and generating method proxies by using Intermediate Language (IL) injection.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Just Read the Code&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
There are many AOP frameworks out there in the wild right now for .NET.  To understand them pretty well, it's best if you just crack open the code and follow the unit tests.  Most of these are no longer active.  Let's cover some of the AOP frameworks out there:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.postsharp.org/"&gt;PostSharp&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://aspectsharpcomp.sourceforge.net/"&gt;NKalore &lt;/a&gt;(No longer active)&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.dcl.hpi.uni-potsdam.de/research/loom/gripper_loom.htm"&gt;Gripper LOOM.NET&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.dcl.hpi.uni-potsdam.de/research/loom/rapier_loom.htm"&gt;Rapier LOOM.NET&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://sourceforge.net/projects/aopnet/"&gt;AOP.NET&lt;/a&gt; (No longer active)&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.castleproject.org/aspectsharp/index.html"&gt;Aspect#&lt;/a&gt; (No longer active)&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://aspectdng.tigris.org/"&gt;AspectDNG&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Many containers also implement AOP through the IoC container such as:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.castleproject.org/container/"&gt;Castle Windsor&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.puzzleframework.com/wikiengine/wikipageviewer.aspx?page=home"&gt;Puzzle.NET&lt;/a&gt;&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.springframework.net/"&gt;Spring.NET&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://s2container.net.seasar.org/"&gt;S2Container&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/cs/LinFuPart1.aspx"&gt;LinFu&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.codeplex.com/ObjectBuilder/SourceControl/DownloadSourceCode.aspx?changeSetId=29957"&gt;ObjectBuilder2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
For those willing and able to go ahead and learn about AOP, it's actually quite interesting.  it's also quite a challenge especially when dealing with IL emitting.  Go ahead and look at the source code and samples and give some of it a try.  Next time we pick up, I'll be talking about AOP in the Enterprise and Spring.NET.  Until next time...
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/03/28/120836.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/03/28/120836.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120836"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120836" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/120836.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/03/28/120836.aspx</guid>
            <pubDate>Fri, 28 Mar 2008 23:45:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/120836.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/03/28/120836.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/120836.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/120836.aspx</trackback:ping>
        </item>
        <item>
            <title>IoC and Unity - Configuration Changes for the Better</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/03/27/120808.aspx</link>
            <description>In my &lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/03/25/ioc-and-unity-the-basics-and-interception.aspx"&gt;previous post&lt;/a&gt; about Unity and IoC containers, I made note of some changes in the latest drop of the Unity Application Block.  As &lt;a href="http://blogs.msdn.com/agile/"&gt;Grigori Melnik&lt;/a&gt;, the PM of the Unity and Enterprise Library team noted, &lt;a href="http://blogs.msdn.com/agile/archive/2008/03/20/unity-release-date-changes-to-april-7.aspx"&gt;Unity should be released&lt;/a&gt; in its final form on April 7th, so stay tuned.  In the mean time, the &lt;a href="http://www.codeplex.com/unity/Release/ProjectReleases.aspx?ReleaseId=11956"&gt;latest drop of Unity&lt;/a&gt; was on March 24th, so go ahead and it pick it up.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Configuration Changes&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
As I noted from above, the public APIs really haven't changed all that much.  Instead, most of the efforts recently have been around performance improvements in the ObjectBuilder base and the configuration of the container itself.  I must admit that previous efforts left me a little cold with having to decorate my classes with the DependencyAttribute.  Well, you shouldn't have to do that anymore, now that the TypeInjectionElement has been added so that you can map your constructor arguments and so on.  Let's walk through a simple example of doing so.&lt;br /&gt;
&lt;br /&gt;
First, let's go through my basic anti-corruption container that I use for Unity and any other container that I use for registration and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 static\cf3  \cf1 class\cf3  \cf4 IoC\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf1 static\cf3  \cf5 IDependencyResolver\cf3  resolver;\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  \cf1 void\cf3  Initialize(\cf5 IDependencyResolver\cf3  resolver)\par ??        \{\par ??            \cf4 IoC\cf3 .resolver = resolver;\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;()\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;();\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 static\cf3  T Resolve&amp;lt;T&amp;gt;(\cf1 string\cf3  name)\par ??        \{\par ??            \cf1 return\cf3  resolver.Resolve&amp;lt;T&amp;gt;(name);\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;class&lt;/span&gt; &lt;span style="color: yellow;"&gt;IoC&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IDependencyResolver&lt;/span&gt; resolver;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;void&lt;/span&gt; Initialize(&lt;span style="color: rgb(43, 145, 175);"&gt;IDependencyResolver&lt;/span&gt; resolver)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: yellow;"&gt;IoC&lt;/span&gt;.resolver = resolver;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;static&lt;/span&gt; T Resolve&amp;lt;T&amp;gt;()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;return&lt;/span&gt; resolver.Resolve&amp;lt;T&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;static&lt;/span&gt; T Resolve&amp;lt;T&amp;gt;(&lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; name)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;return&lt;/span&gt; resolver.Resolve&amp;lt;T&amp;gt;(name);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
Remember this is just a quick spike sample of my anti-corruption container which was taken from Ayende.  And then in order to configure my UnityContainer through the implementation of my IDependencyResolver interface.  Let's take a brief look at that:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 interface\cf3  \cf4 IDependencyResolver\par ??\cf3     \{\par ??        T Resolve&amp;lt;T&amp;gt;(\cf1 string\cf3  name);\par ??\par ??        T Resolve&amp;lt;T&amp;gt;();\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;interface&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IDependencyResolver&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        T Resolve&amp;lt;T&amp;gt;(&lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; name);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        T Resolve&amp;lt;T&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
And then the implementation of the interface for Unity would look like:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;\red0\green255\blue0;}??\fs16 \cf1\cb2\highlight2 using\cf3  System.Configuration;\par ??\cf1 using\cf3  Microsoft.Practices.Unity;\par ??\cf1 using\cf3  Microsoft.Practices.Unity.Configuration;\par ??\par ??\cf1 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 class\cf3  \cf4 UnityDependencyResolver\cf3 : \cf5 IDependencyResolver\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf5 IUnityContainer\cf3  container;\par ??\par ??        \cf1 public\cf3  UnityDependencyResolver()\par ??        \{\par ??            container = \cf1 new\cf3  \cf4 UnityContainer\cf3 ();\par ??            \cf4 UnityConfigurationSection\cf3  section = (\cf4 UnityConfigurationSection\cf3 )\cf4 ConfigurationManager\cf3 .GetSection(\cf6 "unity"\cf3 );\par ??            section.Containers.Default.Configure(container);\par ??        \}\par ??\par ??        \cf1 public\cf3  T Resolve&amp;lt;T&amp;gt;()\par ??        \{\par ??            \cf1 return\cf3  container.Resolve&amp;lt;T&amp;gt;();\par ??        \}\par ??\par ??        \cf1 public\cf3  T Resolve&amp;lt;T&amp;gt;(\cf1 string\cf3  name)\par ??        \{\par ??            \cf1 return\cf3  container.Resolve&amp;lt;T&amp;gt;(name);\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;using&lt;/span&gt; System.Configuration;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;using&lt;/span&gt; Microsoft.Practices.Unity;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;using&lt;/span&gt; Microsoft.Practices.Unity.Configuration;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;class&lt;/span&gt; &lt;span style="color: yellow;"&gt;UnityDependencyResolver&lt;/span&gt;: &lt;span style="color: rgb(43, 145, 175);"&gt;IDependencyResolver&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IUnityContainer&lt;/span&gt; container;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; UnityDependencyResolver()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            container = &lt;span style="color: rgb(255, 128, 0);"&gt;new&lt;/span&gt; &lt;span style="color: yellow;"&gt;UnityContainer&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: yellow;"&gt;UnityConfigurationSection&lt;/span&gt; section = (&lt;span style="color: yellow;"&gt;UnityConfigurationSection&lt;/span&gt;)&lt;span style="color: yellow;"&gt;ConfigurationManager&lt;/span&gt;.GetSection(&lt;span style="color: lime;"&gt;"unity"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            section.Containers.Default.Configure(container);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; T Resolve&amp;lt;T&amp;gt;()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;return&lt;/span&gt; container.Resolve&amp;lt;T&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; T Resolve&amp;lt;T&amp;gt;(&lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; name)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;return&lt;/span&gt; container.Resolve&amp;lt;T&amp;gt;(name);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
Now, if you look at the constructor for the UnityDependencyResolver above, I am using the default container in order to configure my container.  But, I have the option of specifying a name for it as well or even just an index.  I could just easily change that code to this and it would work if I name my container default.  This is a little bit of a change from before when I had to use the GetConfigCommand() method in order to configure the container which was a bit too chatty for my tastes. &lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;\red255\green255\blue0;\red0\green255\blue0;}??\fs16 \cf1\cb2\highlight2             container = \cf3 new\cf1  \cf4 UnityContainer\cf1 ();\par ??            \cf4 UnityConfigurationSection\cf1  section = (\cf4 UnityConfigurationSection\cf1 )\cf4 ConfigurationManager\cf1 .GetSection(\cf5 "unity"\cf1 );\par ??            section.Containers[\cf5 "default"\cf1 ].Configure(container);}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;            container = &lt;span style="color: rgb(255, 128, 0);"&gt;new&lt;/span&gt; &lt;span style="color: yellow;"&gt;UnityContainer&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: yellow;"&gt;UnityConfigurationSection&lt;/span&gt; section = (&lt;span style="color: yellow;"&gt;UnityConfigurationSection&lt;/span&gt;)&lt;span style="color: yellow;"&gt;ConfigurationManager&lt;/span&gt;.GetSection(&lt;span style="color: lime;"&gt;"unity"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            section.Containers[&lt;span style="color: lime;"&gt;"default"&lt;/span&gt;].Configure(container);&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
So, the idea that I want to do is create an object graph so that I have classes with dependencies that have dependencies.  Without doing AOP and some basic interception, we could take the approach of keeping around something like an IContext which would have our cross-cutting concerns in one location such as logging and whatnot in one area so your objects don't sit there with 16 constructor parameters, and instead has a context from which it can pull.  This approach has worked for me in the past, so let's just go through that one right now.&lt;br /&gt;
&lt;br /&gt;
First, let's look at the context that has those cross-cutting concerns and the actual implementation:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 interface\cf3  \cf4 IContext\par ??\cf3     \{\par ??        \cf4 ILogger\cf3  Logger \{ \cf1 get\cf3 ; \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;interface&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IContext&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;ILogger&lt;/span&gt; Logger { &lt;span style="color: rgb(255, 128, 0);"&gt;get&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
And then the concrete implementation might look something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 class\cf3  \cf4 UnityContext\cf3  : \cf5 IContext\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf1 readonly\cf3  \cf5 ILogger\cf3  logger;\par ??\par ??        \cf1 public\cf3  UnityContext(\cf5 ILogger\cf3  logger)\par ??        \{\par ??            \cf1 this\cf3 .logger = logger;\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf5 ILogger\cf3  Logger\par ??        \{\par ??            \cf1 get\cf3  \{ \cf1 return\cf3  logger; \}\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;class&lt;/span&gt; &lt;span style="color: yellow;"&gt;UnityContext&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;IContext&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;readonly&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ILogger&lt;/span&gt; logger;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; UnityContext(&lt;span style="color: rgb(43, 145, 175);"&gt;ILogger&lt;/span&gt; logger)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;this&lt;/span&gt;.logger = logger;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ILogger&lt;/span&gt; Logger&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;get&lt;/span&gt; { &lt;span style="color: rgb(255, 128, 0);"&gt;return&lt;/span&gt; logger; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
So, what I do here is inject my logger into my context, and probably anything else that might be cross-cutting as well.  So, now in one of my classes, then I can accept the IContext in to do what I need it to do.  That would look something like this.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red43\green145\blue175;\red0\green255\blue0;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 public\cf3  \cf1 class\cf3  \cf4 Customer\par ??\cf3     \{\par ??        \cf1 public\cf3  \cf1 string\cf3  CustomerId \{ \cf1 get\cf3 ; \cf1 set\cf3 ; \}\par ??\par ??        \cf1 public\cf3  \cf1 string\cf3  FirstName \{ \cf1 get\cf3 ; \cf1 set\cf3 ; \}\par ??\par ??        \cf1 public\cf3  \cf1 string\cf3  MiddleName \{ \cf1 get\cf3 ; \cf1 set\cf3 ; \}\par ??\par ??        \cf1 public\cf3  \cf1 string\cf3  LastName \{ \cf1 get\cf3 ; \cf1 set\cf3 ; \}\par ??    \}\par ??\par ??    \cf1 public\cf3  \cf1 class\cf3  \cf4 CustomerTasks\par ??\cf3     \{\par ??        \cf1 private\cf3  \cf1 readonly\cf3  \cf5 IContext\cf3  context;\par ??\par ??        \cf1 public\cf3  CustomerTasks(\cf5 IContext\cf3  context)\par ??        \{\par ??            \cf1 this\cf3 .context = context;\par ??        \}\par ??\par ??        \cf1 public\cf3  \cf1 void\cf3  SaveCustomer(\cf4 Customer\cf3  customer)\par ??        \{\par ??            \cf6 // Save customer\par ??\cf3             context.Logger.LogEvent(\cf6 "Saving customer"\cf3 , \cf5 LogLevel\cf3 .Information);\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;class&lt;/span&gt; &lt;span style="color: yellow;"&gt;Customer&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; CustomerId { &lt;span style="color: rgb(255, 128, 0);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(255, 128, 0);"&gt;set&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; FirstName { &lt;span style="color: rgb(255, 128, 0);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(255, 128, 0);"&gt;set&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; MiddleName { &lt;span style="color: rgb(255, 128, 0);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(255, 128, 0);"&gt;set&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt; LastName { &lt;span style="color: rgb(255, 128, 0);"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(255, 128, 0);"&gt;set&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;class&lt;/span&gt; &lt;span style="color: yellow;"&gt;CustomerTasks&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;readonly&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;IContext&lt;/span&gt; context;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; CustomerTasks(&lt;span style="color: rgb(43, 145, 175);"&gt;IContext&lt;/span&gt; context)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(255, 128, 0);"&gt;this&lt;/span&gt;.context = context;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;void&lt;/span&gt; SaveCustomer(&lt;span style="color: yellow;"&gt;Customer&lt;/span&gt; customer)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: lime;"&gt;// Save customer&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            context.Logger.LogEvent(&lt;span style="color: lime;"&gt;"Saving customer"&lt;/span&gt;, &lt;span style="color: rgb(43, 145, 175);"&gt;LogLevel&lt;/span&gt;.Information);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
I'm not doing anything special, instead, just showing how this pattern might apply.  And then just tying it all together is my console application (sometimes my favorite UI for quick spikes).&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green128\blue0;\red40\green40\blue40;\red255\green255\blue255;\red255\green255\blue0;\red0\green255\blue0;}??\fs16 \cf1\cb2\highlight2 namespace\cf3  UnitySamples\par ??\{\par ??    \cf1 class\cf3  \cf4 Program\par ??\cf3     \{\par ??        \cf1 static\cf3  \cf1 void\cf3  Main(\cf1 string\cf3 [] args)\par ??        \{\par ??            \cf4 IoC\cf3 .Initialize(\cf1 new\cf3  \cf4 UnityDependencyResolver\cf3 ());\par ??            \cf4 CustomerTasks\cf3  tasks = \cf4 IoC\cf3 .Resolve&amp;lt;\cf4 CustomerTasks\cf3 &amp;gt;();\par ??            tasks.SaveCustomer(\cf1 new\cf3  \cf4 Customer\cf3 \{ CustomerId = \cf5 "12345"\cf3 , FirstName = \cf5 "Joe"\cf3 , LastName = \cf5 "Smith"\cf3 , MiddleName = \cf5 "Frank"\cf3 \});\par ??        \}\par ??    \}\par ??\}\par ??}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;namespace&lt;/span&gt; UnitySamples&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(255, 128, 0);"&gt;class&lt;/span&gt; &lt;span style="color: yellow;"&gt;Program&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(255, 128, 0);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(255, 128, 0);"&gt;void&lt;/span&gt; Main(&lt;span style="color: rgb(255, 128, 0);"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: yellow;"&gt;IoC&lt;/span&gt;.Initialize(&lt;span style="color: rgb(255, 128, 0);"&gt;new&lt;/span&gt; &lt;span style="color: yellow;"&gt;UnityDependencyResolver&lt;/span&gt;());&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: yellow;"&gt;CustomerTasks&lt;/span&gt; tasks = &lt;span style="color: yellow;"&gt;IoC&lt;/span&gt;.Resolve&amp;lt;&lt;span style="color: yellow;"&gt;CustomerTasks&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            tasks.SaveCustomer(&lt;span style="color: rgb(255, 128, 0);"&gt;new&lt;/span&gt; &lt;span style="color: yellow;"&gt;Customer&lt;/span&gt;{ CustomerId = &lt;span style="color: lime;"&gt;"12345"&lt;/span&gt;, FirstName = &lt;span style="color: lime;"&gt;"Joe"&lt;/span&gt;, LastName = &lt;span style="color: lime;"&gt;"Smith"&lt;/span&gt;, MiddleName = &lt;span style="color: lime;"&gt;"Frank"&lt;/span&gt;});&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
But the more interesting part about this is the XML configuration.  I know many people such as Ayende have declared war on XML configuration, but I think for this quick example it does quite well.  If we start talking about complex object graphs, then I'd certainly agree and I'd rather do it programmatically.  But, let's first look at how I'd wire up the whole thing in the app.config file.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;\red0\green255\blue0;}??\fs16 \cf1\cb2\highlight2 &amp;lt;?xml \cf3 version\cf1 ="\cf4 1.0\cf1 " \cf3 encoding\cf1 ="\cf4 utf-8\cf1 " ?&amp;gt;\par ??&amp;lt;configuration&amp;gt;\par ??\tab &amp;lt;configSections&amp;gt;\par ??\tab \tab &amp;lt;section \cf3 name\cf1 ="\cf4 unity\cf1 " \cf3 type\cf1 ="\cf4 Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration\cf1 " /&amp;gt;\par ??\tab &amp;lt;/configSections&amp;gt;\par ??\par ??\tab &amp;lt;unity&amp;gt;\par ??\tab \tab &amp;lt;typeAliases&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 string\cf1 " \cf3 type\cf1 ="\cf4 System.String, mscorlib\cf1 " /&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 ILogger\cf1 " \cf3 type\cf1 ="\cf4 UnitySamples.ILogger, UnitySamples\cf1 " /&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 ConsoleLogger\cf1 " \cf3 type\cf1 ="\cf4 UnitySamples.ConsoleLogger, UnitySamples\cf1 " /&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 DebugLogger\cf1 " \cf3 type\cf1 ="\cf4 UnitySamples.DebugLogger, UnitySamples\cf1 " /&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 IContext\cf1 " \cf3 type\cf1 ="\cf4 UnitySamples.IContext, UnitySamples\cf1 " /&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 UnityContext\cf1 " \cf3 type\cf1 ="\cf4 UnitySamples.UnityContext, UnitySamples\cf1 " /&amp;gt;\par ??\tab \tab \tab &amp;lt;typeAlias \cf3 alias\cf1 ="\cf4 CustomerTasks\cf1 " \cf3 type\cf1 ="\cf4 UnitySamples.CustomerTasks, UnitySamples\cf1 " /&amp;gt;\par ??\tab \tab &amp;lt;/typeAliases&amp;gt;\par ??\tab \tab &amp;lt;containers&amp;gt;\par ??\tab \tab \tab &amp;lt;container&amp;gt;\par ??\tab \tab \tab \tab &amp;lt;types&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;type \cf3 type\cf1 ="\cf4 ILogger\cf1 " \cf3 mapTo\cf1 ="\cf4 ConsoleLogger\cf1 " \cf3 name\cf1 ="\cf4 defaultLogger\cf1 "/&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;type \cf3 type\cf1 ="\cf4 ILogger\cf1 " \cf3 mapTo\cf1 ="\cf4 DebugLogger\cf1 " \cf3 name\cf1 ="\cf4 debugLogger\cf1 "/&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;type \cf3 type\cf1 ="\cf4 IContext\cf1 " \cf3 mapTo\cf1 ="\cf4 UnityContext\cf1 "&amp;gt;\par ??\tab \tab \tab \tab \tab \tab &amp;lt;typeConfig \cf3 extensionType\cf1 ="\cf4 Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration\cf1 "&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab &amp;lt;constructor&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab \tab &amp;lt;param \cf3 name\cf1 ="\cf4 logger\cf1 " \cf3 parameterType\cf1 ="\cf4 ILogger\cf1 "&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab \tab \tab &amp;lt;dependency \cf3 name\cf1 ="\cf4 debugLogger\cf1 "/&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab \tab &amp;lt;/param&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab &amp;lt;/constructor&amp;gt;\par ??\tab \tab \tab \tab \tab \tab &amp;lt;/typeConfig&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;/type&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;type \cf3 type\cf1 ="\cf4 CustomerTasks\cf1 "&amp;gt;\par ??\tab \tab \tab \tab \tab \tab &amp;lt;typeConfig \cf3 extensionType\cf1 ="\cf4 Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration\cf1 "&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab &amp;lt;constructor&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab \tab &amp;lt;param \cf3 name\cf1 ="\cf4 context\cf1 " \cf3 parameterType\cf1 ="\cf4 IContext\cf1 "&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab \tab \tab &amp;lt;dependency/&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab \tab &amp;lt;/param&amp;gt;\par ??\tab \tab \tab \tab \tab \tab \tab &amp;lt;/constructor&amp;gt;\par ??\tab \tab \tab \tab \tab \tab &amp;lt;/typeConfig&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;/type&amp;gt;\par ??\tab \tab \tab \tab &amp;lt;/types&amp;gt;\par ??\tab \tab \tab &amp;lt;/container&amp;gt;\par ??\tab \tab &amp;lt;/containers&amp;gt;\par ??\tab &amp;lt;/unity&amp;gt;\par ??&amp;lt;/configuration&amp;gt;}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;?xml &lt;span style="color: rgb(255, 128, 0);"&gt;version&lt;/span&gt;="&lt;span style="color: lime;"&gt;1.0&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;encoding&lt;/span&gt;="&lt;span style="color: lime;"&gt;utf-8&lt;/span&gt;" ?&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;configuration&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;configSections&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;section &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;unity&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;/configSections&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;unity&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;typeAliases&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;string&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;System.String, mscorlib&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;ILogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnitySamples.ILogger, UnitySamples&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;ConsoleLogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnitySamples.ConsoleLogger, UnitySamples&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;DebugLogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnitySamples.DebugLogger, UnitySamples&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;IContext&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnitySamples.IContext, UnitySamples&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnityContext&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnitySamples.UnityContext, UnitySamples&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;typeAlias &lt;span style="color: rgb(255, 128, 0);"&gt;alias&lt;/span&gt;="&lt;span style="color: lime;"&gt;CustomerTasks&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnitySamples.CustomerTasks, UnitySamples&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;/typeAliases&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;containers&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;container&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                &amp;lt;types&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &amp;lt;type &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;ILogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;mapTo&lt;/span&gt;="&lt;span style="color: lime;"&gt;ConsoleLogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;defaultLogger&lt;/span&gt;"/&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &amp;lt;type &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;ILogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;mapTo&lt;/span&gt;="&lt;span style="color: lime;"&gt;DebugLogger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;debugLogger&lt;/span&gt;"/&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &amp;lt;type &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;IContext&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;mapTo&lt;/span&gt;="&lt;span style="color: lime;"&gt;UnityContext&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                        &amp;lt;typeConfig &lt;span style="color: rgb(255, 128, 0);"&gt;extensionType&lt;/span&gt;="&lt;span style="color: lime;"&gt;Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                            &amp;lt;constructor&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                                &amp;lt;param &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;logger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;parameterType&lt;/span&gt;="&lt;span style="color: lime;"&gt;ILogger&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                                    &amp;lt;dependency &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;debugLogger&lt;/span&gt;"/&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                                &amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                            &amp;lt;/constructor&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                        &amp;lt;/typeConfig&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &amp;lt;/type&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &amp;lt;type &lt;span style="color: rgb(255, 128, 0);"&gt;type&lt;/span&gt;="&lt;span style="color: lime;"&gt;CustomerTasks&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                        &amp;lt;typeConfig &lt;span style="color: rgb(255, 128, 0);"&gt;extensionType&lt;/span&gt;="&lt;span style="color: lime;"&gt;Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                            &amp;lt;constructor&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                                &amp;lt;param &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;context&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;parameterType&lt;/span&gt;="&lt;span style="color: lime;"&gt;IContext&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                                    &amp;lt;dependency/&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                                &amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                            &amp;lt;/constructor&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                        &amp;lt;/typeConfig&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &amp;lt;/type&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                &amp;lt;/types&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &amp;lt;/container&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;/containers&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;/unity&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
As you may notice from above, Unity gives us the ability to give type aliases so that we can reference the short names instead of the long ugly fully qualified type names by using the &amp;lt;typeAliases&amp;gt;&amp;lt;typeAlias&amp;gt; nodes in the configuration.  Much as before, we still register our types with a name, type and so on.  &lt;br /&gt;
&lt;br /&gt;
But, what's interesting is that we now have the ability to do type injection through a Unity extension called the TypeInjectionElement.  This allows us to inject into the constructor and put in our parameters as need be.  But we could also replace that with &amp;lt;method&amp;gt; or &amp;lt;property&amp;gt; in order to do method injection and property setter injection respectively.  &lt;br /&gt;
Within the &amp;lt;param&amp;gt; element, we can specify our given injection element parameters.  This allows us to specify the name of our given parameter, the type, but also for the dependency check, we can specify the name and type to alias the other &amp;lt;type&amp;gt; elements that we wish to get a reference of.  We can also specify the values if we so desire of strings, integers and so on.  Below is a simple example of using both dependency references and values.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;\red0\green255\blue0;}??\fs16 \cf1\cb2\highlight2 &amp;lt;constructor&amp;gt;\par ??\tab &amp;lt;param \cf3 name\cf1 ="\cf4 logger\cf1 " \cf3 parameterType\cf1 ="\cf4 ILogger\cf1 "&amp;gt;\par ??\tab \tab &amp;lt;dependency \cf3 name\cf1 ="\cf4 debugLogger\cf1 "/&amp;gt;\par ??\tab &amp;lt;/param&amp;gt;\par ??\tab &amp;lt;param \cf3 name\cf1 ="\cf4 dbName\cf1 " \cf3 parameterType\cf1 ="\cf4 string\cf1 "&amp;gt;\par ??\tab \tab &amp;lt;value \cf3 value\cf1 ="\cf4 AdventureWorks\cf1 " /&amp;gt;\par ??\tab &amp;lt;/param&amp;gt;\par ??&amp;lt;/constructor&amp;gt;}
--&gt;
&lt;div style="background: rgb(40, 40, 40) none repeat scroll 0% 50%; font-family: Monaco; font-size: 8pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;constructor&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;param &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;logger&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;parameterType&lt;/span&gt;="&lt;span style="color: lime;"&gt;ILogger&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;dependency &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;debugLogger&lt;/span&gt;"/&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;param &lt;span style="color: rgb(255, 128, 0);"&gt;name&lt;/span&gt;="&lt;span style="color: lime;"&gt;dbName&lt;/span&gt;" &lt;span style="color: rgb(255, 128, 0);"&gt;parameterType&lt;/span&gt;="&lt;span style="color: lime;"&gt;string&lt;/span&gt;"&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &amp;lt;value &lt;span style="color: rgb(255, 128, 0);"&gt;value&lt;/span&gt;="&lt;span style="color: lime;"&gt;AdventureWorks&lt;/span&gt;" /&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;lt;/constructor&amp;gt;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
I find the best way to learn about these features usually isn't through documentation, although it's a nice thing to do, but instead the tests.  I look for the functionality that I'm interested in and go deep.  A project this size without good unit tests == &lt;span style="font-weight: bold;"&gt;FAIL &lt;/span&gt;in my opinion.  Anyhow, this is better looking than it used to be and much more intuitive.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt; Interception Revisited&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
As Chris Tavares, the developer of Unity noted on my blog before was the fact that he could easily put in the interceptors from the ObjectBuilder2 since ObjectBuilder2 is modular and Unity is built upon it.  It shouldn't have been news, because I've been working on that myself to get lightweight interception to work on it.  Maybe when I get it fully implemented I'll share it.  But in the mean time, it's just a spike.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt; Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I think this approach has helped in the XML configuration goo that had been a bit confusing.  I didn't want to clutter my domain models and processing code with excess attributes stating intent, and would rather keep it clean.  This makes a step in that direction.  In the next installation of looking at IoC will revolve around Spring.NET and AOP in the Enterprise, so stay tuned...  Until next time... &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/03/27/120808.aspx"&gt;&lt;img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/03/27/120808.aspx" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120808"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120808" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/120808.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/03/27/120808.aspx</guid>
            <pubDate>Thu, 27 Mar 2008 23:52:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/120808.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/03/27/120808.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/120808.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/120808.aspx</trackback:ping>
        </item>
        <item>
            <title>Starting Junior Programmers on the Right Agile Track Guidance</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/01/01/118125.aspx</link>
            <description>Part of my job is not only to design and implement solutions for my customers, but also to make my customer's developers stronger as well.  During these customer engagements, there are many times when junior developers are involved.  My job is to help those on the team to be stronger and then in turn help become leaders.&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;Where to start?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Well, I could start with a stack of point technology books (ASP.NET, SharePoint, BizTalk, etc) that become obsolete right during their printing, so that's not where I start.  You find that many times, the books were written during the beta phase of the product and sure enough, things change, rapidly...  But, I will mention a few that earn my admiration that form a basis for a good development background.&lt;br /&gt;
&lt;br /&gt;
So, first things first, surveys are always in order to find out the comfort level with such things as:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Agile_software_development"&gt;Agile Software Development &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)"&gt;Scrum&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Domain_driven_design"&gt;Domain Driven Design&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Test_Driven_Development"&gt;Test Driven Development&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Object_oriented_design"&gt;Object Oriented Design&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29"&gt;Enterprise Design Patterns&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Trustworthy_Computing_Security_Development_Lifecycle"&gt;Secure Development Lifecycle&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Point Technologies (ASP.NET/BizTalk/SharePoint/WCF/WPF/etc)&lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
So, as you can see, it's quite a list of things to cover.  But, no matter, we can come up with a list of things to know and teach and how to do it.&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;Topics to Know&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
When it comes to making stronger Agile Object Oriented Designers/Programmers, it's important that they know a few topics inside and out.  They can be found easily on the net and some books that I will feature later on.  Some of these include:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Separation_of_concerns"&gt;Separation of Concerns&lt;br /&gt;
    &lt;/a&gt;Breaking a program into distinct features that overlap in functionality as little as possible.  A concern is any interest or focus in a program.  Concerns are synonymous with features or behaviors.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.objectmentor.com/resources/articles/lsp.pdf"&gt;Liskov Substitution Principle&lt;/a&gt;&lt;br /&gt;
    Subtypes must be substitutable for their base types&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Law_of_Demeter"&gt;Law of Demeter&lt;/a&gt;&lt;br /&gt;
    A given object should assume as little as possible about the structure or properties of anything else, including its subcomponents.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Single_responsibility_principle"&gt;Single Responsibility Principle&lt;/a&gt;&lt;br /&gt;
    Every object should have a single responsibility, and that all its services should be narrowly aligned with that responsibility.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Open/closed_principle"&gt;Open/Close Principle&lt;/a&gt;&lt;br /&gt;
    Software entities should be open for extension, but closed for modification.  The entity can allows its behavior to be modified without modifying the source code.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.objectmentor.com/resources/articles/isp.pdf"&gt;Interface Segregation Principle&lt;/a&gt;&lt;br /&gt;
    Modules that encapsulate high level policy should not depend upon modules that implement details. Rather, both kinds of modules should depend upon abstractions. Abstract classes should not depend upon concrete classes and concrete classes should depend upon abstract classes.  Clients should not be forced to depend on methods that they do not use.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.objectmentor.com/resources/articles/dip.pdf"&gt;Dependency Inversion Principle&lt;/a&gt;&lt;br /&gt;
    Virtual member functions of derived classes must expect no more than the corresponding member functions of the base class; and should promise no less. It also means that virtual member functions that are present in base classes must also be present in the derived classes; and they must do useful work.&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="font-weight: bold;"&gt;Stocking the Library&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Knowing these fundamentals go a long way to making a stronger object oriented programmer.  Ok, so reading just an article or two doesn't always make things sink in.  Some books may be in order to help as well:  Let's walk through some fundamental books for solid developers.  Note that these do not include any point technologies, and instead focuses on gaining strong fundamental skills.  It's not enough to pick up an ASP.NET book, and boom, you're a solid developer.  So, let's go through some of them:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Agile/Development Principles
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670/ref=pd_bbs_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199233200&amp;amp;sr=1-1"&gt;Code Complete: A Practical Handbook of Software Construction (Steve McConnell)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199233133&amp;amp;sr=1-1"&gt;Agile Software Development, Principles, Patterns, and Practices (Robert C. Martin)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/gp/product/0131857258/ref=pd_cp_b_1?pf_rd_p=317711001&amp;amp;pf_rd_s=center-41&amp;amp;pf_rd_t=201&amp;amp;pf_rd_i=0135974445&amp;amp;pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_r=0HG2ECVVCNYSHN1FR7YZ"&gt; Agile Principles, Patterns, and Practices in C# (Robert C. Martin)&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Agile-Software-Development-SCRUM-Schwaber/dp/0130676349/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199233534&amp;amp;sr=1-1"&gt;Agile Software Development with SCRUM (Ken Schwaber)&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/User-Stories-Applied-Development-Addison-Wesley/dp/0321205685/ref=pd_sim_b_title_2"&gt;User Stories Applied: For Agile Software Development (Mike Cohn)&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Practices-Agile-Developer-Pragmatic-Programmers/dp/097451408X/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199236912&amp;amp;sr=1-1"&gt;Practices of an Agile Developer: Working in the Real World (Andrew Hunt)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;General Development
    &lt;ul&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Release-Production-Ready-Software-Pragmatic-Programmers/dp/0978739213/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199233841&amp;amp;sr=1-1"&gt;Release It!: Design and Deploy Production-Ready Software (Michael Nygard)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Practical-Guide-Successful-Software-Projects/dp/0974514047/ref=pd_sim_b_title_1"&gt;Ship it! A Practical Guide to Successful Software Projects (Jared Richardson)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X/ref=pd_bbs_sr_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199237108&amp;amp;sr=1-2"&gt;The Pragmatic Programmer: From Journeyman to Master (Andrew Hunt)&lt;/a&gt;&lt;br /&gt;
        &lt;/span&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Design Patterns
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Head-First-Object-Oriented-Analysis-Design/dp/0596008678/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199233726&amp;amp;sr=1-1"&gt;Head First Object-Oriented Analysis and Design (Brett McLaughlin)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=pd_sim_b_title_4"&gt;Patterns of Enterprise Application Architecture (Martin Fowler)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199232867&amp;amp;sr=1-1"&gt;Design Patterns: Elements of Reusable Object-Oriented Software (GoF)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;/span&gt;&lt;a href="http://www.amazon.com/gp/product/0596007124/ref=pd_cp_b_1?pf_rd_p=317711001&amp;amp;pf_rd_s=center-41&amp;amp;pf_rd_t=201&amp;amp;pf_rd_i=0131857258&amp;amp;pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_r=1K37N2EEDGV00EXDWS3N"&gt;Head First Design Patterns (Elisabeth Freeman)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Domain Driven Design
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215/ref=pd_bxgy_b_text_b"&gt;Domain-Driven Design: Tackling Complexity in the Heart of Software (Eric Evans)&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/gp/product/0321268202/ref=pd_cp_b_2?pf_rd_p=317711001&amp;amp;pf_rd_s=center-41&amp;amp;pf_rd_t=201&amp;amp;pf_rd_i=0131857258&amp;amp;pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_r=1K37N2EEDGV00EXDWS3N"&gt;Applying Domain-Driven Design and Patterns: With Examples in C# and .NET (Jimmy Nilsson)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Test Driven Development
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530/ref=pd_bxgy_b_text_b"&gt;&lt;span class="sans"&gt;Test Driven Development: By Example (Kent Beck)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Addison-Wesley/dp/0131495054/ref=pd_sim_b_title_4"&gt;xUnit Test Patterns: Refactoring Test Code (Gerard Meszaros)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Pragmatic-Unit-Testing-NUnit-2nd/dp/0977616673/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199237007&amp;amp;sr=1-1"&gt;Pragmatic Unit Testing in C# with NUnit, 2nd Edition (Andrew Hunt)&lt;/a&gt;&lt;br /&gt;
        &lt;/span&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span class="sans"&gt;Refactoring&lt;br /&gt;
    &lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/gp/product/0201485672/ref=pd_cp_b_2?pf_rd_p=317711001&amp;amp;pf_rd_s=center-41&amp;amp;pf_rd_t=201&amp;amp;pf_rd_i=0131495054&amp;amp;pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_r=1C6EE2KWZS34QERKHWY0"&gt;Refactoring: Improving the Design of Existing Code (Martin Fowler)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Refactoring-Patterns-Addison-Wesley-Signature-Kerievsky/dp/0321213351/ref=pd_sim_b_title_3"&gt;Refactoring to Patterns (Joshua Kerievsky)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;span class="sans"&gt;&lt;/span&gt;     &lt;span class="sans"&gt;&lt;/span&gt;     &lt;/li&gt;
    &lt;li&gt;&lt;span class="sans"&gt;Secure Development Lifecycle&lt;br /&gt;
    &lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Security-Development-Lifecycle-Michael-Howard/dp/0735622140/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199240336&amp;amp;sr=8-1"&gt;The Security Development Lifecycle (Michael Howard)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;span class="sans"&gt;&lt;a href="http://www.amazon.com/Writing-Secure-Second-Michael-Howard/dp/0735617228/ref=pd_sim_b_title_5"&gt;Writing Secure Code, Second Edition (Michael Howard)&lt;br /&gt;
        &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;span class="sans"&gt;&lt;/span&gt;     &lt;/li&gt;
&lt;/ul&gt;
But what about technical books diving into point technologies, well, there are some of them that come highly recommended:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;C#/.NET Framework
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/CLR-via-Second-Pro-Developer/dp/0735621632/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199236492&amp;amp;sr=8-1"&gt;CLR via C#, Second Edition (Jeffrey Richter)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.amazon.com/Framework-Design-Guidelines-Conventions-Development/dp/0321246756/ref=pd_bbs_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1199236492&amp;amp;sr=8-2"&gt;Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries (Krzysztof Cwalina)&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
This by no means is an exhaustive list, but a way to get started.  By no means should they read all these books at once and should be tailored for those who need work in those related areas.  These books will get the junior developer starting to think abstractly in a more agile mindset.  But, how do you reinforce these behaviors in the development environment.  It's not enough to read a few articles, a few books and call it a day.  &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Going to the next level&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In order for those developers to get to that next level, paired programming is the key.  This can reinforce what they have learned in a nuturing environment and even those who are more senior programmers can still learn a thing or two.  One great way to get this kick started is to do Test Driven Development between programmers.  Have the first programmer write a unit test and have it fail.  Hand the keyboard off to the next programmer and have them make the unit test succeed.  Then work on refactoring and move onto the next.  Simple things like these go a long way.&lt;br /&gt;
&lt;br /&gt;
Mentoring is also important.  Have a mentor assigned to check how the junior developer is doing with learning these new concepts.  Follow-up from the mentors is important as you track their progress.  Make time to answer questions and challenge them.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;What about Agile?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Many organizations in the software development world don't work in an Agile mindset, so what are some of the ways to get there?  An Agile Coach is a great way to start an organization on the right step.  No, they aren't the Agile Police, nor should they be.  The Agile Coach brings quite a few things to an organization.  These can include:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Ramping an organization up on agile processes and ways of thinking&lt;/li&gt;
    &lt;li&gt;Experience with the Agile Process&lt;/li&gt;
    &lt;li&gt;An effective agent of change&lt;/li&gt;
    &lt;li&gt;Environment assessment&lt;/li&gt;
    &lt;li&gt;Being a certified Scrum Master&lt;/li&gt;
&lt;/ul&gt;
Holding brown bag sessions is quite important in reinforcing learned ideas and learning new things.  Of course you must make it worth people's while to attend.  These can also get the junior developers more excited and involved and people can take turns creating these sessions and presenting.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this post gets you in the mindset of changing organizations for the better, getting junior developers to become stronger ones and creating a more dynamic atmosphere.  This of course is only the beginning on a lifetime or learning and being challenged.  Develop, mentor and inspire! &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/01/01/118125.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/01/01/118125.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118125"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118125" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/118125.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/01/01/118125.aspx</guid>
            <pubDate>Wed, 02 Jan 2008 00:53:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/118125.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/01/01/118125.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/118125.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/118125.aspx</trackback:ping>
        </item>
        <item>
            <title>Enterprise Service Bus on the Microsoft Platform Presentation</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2007/12/03/117320.aspx</link>
            <description>&lt;p&gt;Join us for the latest &lt;a href="http://groups.msn.com/MICSUG"&gt;Microsoft Integration and Connected Systems User Group (MICSUG)&lt;/a&gt; on December 17th at 7:00PM, where we will talk about the &lt;a href="http://www.codeplex.com/esb"&gt;Enterprise Service Bus Guidance&lt;/a&gt; provided by Microsoft on CodePlex.  Since &lt;a href="http://blogs.msdn.com/gsnowman/"&gt;Geoff Snowman&lt;/a&gt; will be out, I will be running the show that night, so I hope you come out and hope to have a great crowd.  As someone who is currently using this technology on a project, it's always great to see new ideas and perspectives on the technology.&lt;/p&gt;
&lt;p&gt;In case you don't know what ESB is, let's go over a few links:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb931189.aspx"&gt;MSDN Documentation for ESB&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://dev4net.com/practices/esb/MicrosoftEsbOverview.ppt"&gt;Microsoft ESB Overview PowerPoint presentation&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://dev4net.com/practices/esb/MicrosoftEsbTechnicalOverview.ppt"&gt;Microsoft ESB Technical Overview PowerPoint presentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;Enterprise Service Bus on the Microsoft Platform &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;The Microsoft ESB Guidance uses Microsoft BizTalk Server 2006 R2 to support a loosely coupled messaging architecture. BizTalk Server includes a powerful publish/subscribe mechanism for messaging applications that works by creating and filling subscriptions, which provides a highly efficient and scalable platform for service-oriented architecture (SOA) applications. The Microsoft ESB Guidance extends the functionality of BizTalk Server to provide a range of new capabilities focused on building robust, connected, service-oriented applications that incorporate itinerary-based service invocation for lightweight service composition, dynamic resolution of endpoints and maps, Web service and WS-* integration, fault management and reporting, and integration with third-party SOA governance solutions.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;em&gt;Scott McHugh, Principal Architect, &lt;a href="http://rdacorp.com/"&gt;RDA Corporation &lt;br /&gt;
&lt;/a&gt;Isaac Ferreira, Senior Software Engineer, &lt;a href="http://rdacorp.com/"&gt;RDA Corporation &lt;br /&gt;
&lt;/a&gt;December 17th, 7:00 PM&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font face="Arial"&gt;Location:&lt;/font&gt;&lt;br /&gt;
&lt;/em&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;em&gt;Microsoft Reston office address:&lt;br /&gt;
12012 Sunset Hills Rd.&lt;br /&gt;
Reston, VA 20190&lt;br /&gt;
Phone: (703) 673-7600&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117320"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117320" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/117320.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2007/12/03/117320.aspx</guid>
            <pubDate>Mon, 03 Dec 2007 19:15:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/117320.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2007/12/03/117320.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/117320.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/117320.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET MVC Roundup</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2007/11/26/117140.aspx</link>
            <description>Last month, &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx"&gt;Scott Guthrie announced the ASP.NET MVC&lt;/a&gt; framework which allows for built-in support for the &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;Model View Controller&lt;/a&gt; based architecture.  Since that time there has been a flurry of activity from Microsoft to demo the technology to the world and make demos readily available.  &lt;br /&gt;
&lt;br /&gt;
In case you missed it, here are some of the features:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Clean separation of concerns.  All core contracts of the MVC framework are testable and mockable&lt;/li&gt;
    &lt;li&gt;Highly pluggable to use NHibernate, Spring.NET, Windsor, and other great products&lt;/li&gt;
    &lt;li&gt;URL mapper to create clean URLs&lt;/li&gt;
    &lt;li&gt;Use existing ASPX, ASCX, .MASTER as view templates, but post-back and view-state are not supported&lt;/li&gt;
    &lt;li&gt;Supports ASP.NET features such as session-state, forms/windows authentication, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
In case you missed the ALT.NET conference in Austin, TX, Scott Guthrie (ScottGu) and Scott Hanselman (ScottHa) both gave presentations on the MVC framework and what it means to developers.  &lt;a href="http://www.hanselman.com/silverlight/ScottGuAtAltnetConf"&gt;ScottGu&lt;/a&gt; talked about the MVC architecture, what it is, what it supports and where it is going.  It's 60 minutes long, but well worth the view.  &lt;a href="http://www.hanselman.com/silverlight/ScottHaAtAltNetConf"&gt;ScottHa&lt;/a&gt; on the other hand spends about 30 minutes walking through an MVC sample with IronPython and the DLR also well worth viewing.  ScottHa has also made his slides from &lt;a href="http://www.hanselman.com/blog/content/binary/HanselmanLipton_ASPConnections_AMS304_MVC.pptx"&gt;DevConnections&lt;/a&gt; available on the web in PowerPoint 2007 Open XML format.&lt;br /&gt;
&lt;br /&gt;
More interesting demos and walkthroughs worth reading&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx"&gt;ScottGu&lt;/a&gt; demonstrates an end to end solution for an MVC products store.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://blogs.msdn.com/brada/archive/2007/11/14/rss-feed-with-the-new-asp-net-mvc-framework.aspx"&gt;Brad Abrams&lt;/a&gt; followed on with a demo of an RSS feed using the ASP.NET MVC framework and LINQ.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/fredriknormen/archive/2007/11/17/asp-net-mvc-framework-create-your-own-icontrollerfactory-and-use-spring-net.aspx"&gt;Fredrik Normen&lt;/a&gt; uses the ASP.NET MVC with Spring.NET as the controllers with Dependency Injection (DI).  Really cool stuff and it's great that the ASP.NET MVC is very pluggable&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.haacked.com/archive/2007/11/05/rhino-mocks-extension-methods-mvc-crazy-delicious.aspx"&gt;Phil Haack&lt;/a&gt; uses &lt;a href="http://www.ayende.com/projects/rhino-mocks.aspx"&gt;Rhino.Mocks&lt;/a&gt; to create very testable web applications.  Great post!&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.nikhilk.net/Entry.aspx?id=181"&gt;Nikhil Kothari &lt;/a&gt;demonstrates using ASP.NET MVC with AJAX to create a tasks list and demo source code is available &lt;a href="http://www.nikhilk.net/Content/Posts/AjaxMVC/TaskList.zip"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
So, now that we have this coming from Microsoft, where does this leave the great &lt;a href="http://www.castleproject.org/"&gt;Castle Project &lt;/a&gt;with &lt;a href="http://www.castleproject.org/monorail/index.html"&gt;MonoRail&lt;/a&gt;?  Well, &lt;a href="http://hammett.castleproject.org/?p=219"&gt;Hamilton Verissimo aka Hammett &lt;/a&gt;recently made a trek to Microsoft's Building 42 to meet with the MVC team and gives his impressions.  It's really great that Microsoft invited him out to show not only what they have, but where they are going, and where they can synergize.  This of course leaves MonoRail in the lurch until MVC comes around, but it will be interesting how this plays out.&lt;br /&gt;
&lt;br /&gt;
Either way, enjoy the demos as they come along and it will be fun to watch this evolve.  I'm still a big fan of Castle Project and will continue to use those frameworks as well.&lt;br /&gt;
&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117140"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117140" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Podwysocki/aggbug/117140.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysoc