<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>ALT.NET</title>
        <link>http://geekswithblogs.net/Podwysocki/category/7412.aspx</link>
        <description>ALT.NET</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>ALT.NET Open Spaces Closing Day Recap</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/24/121604.aspx</link>
            <description>In my previous post, I talked about some of the happenings from the day two experience.  Day three was only a half day with only two sessions.  So, it was best to make the best of times anyhow.  Once again, it snowed again, rather heavily at times, so nature's cruel joke on ALT.NET.&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;Impromptu Sessions&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One of the best sessions was an impromptu session with &lt;a href="http://codebetter.com/blogs/jeremy.miller/"&gt;Jeremy Miller&lt;/a&gt; on the &lt;a href="http://storyteller.tigris.org/"&gt;StoryTeller&lt;/a&gt; tool and his future plans for it.  If you're not familiar with it, it is a tool used to manage and create automated testing over the &lt;a href="http://www.syterra.com/FitnesseDotNet.html"&gt;FitNesse Dot Net&lt;/a&gt; libraries and helps in an acceptance test driven development environment.  Anyhow, a number of us managed to corner him at one point during the day and sure enough he had his laptop available.  From there, we were able to encourage him to work on it some more as well as learn about where to go from where it is right now.  Jeremy covers more about it &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/04/23/structuremap-and-storyteller-plans.aspx"&gt;here&lt;/a&gt;.  Sometimes these impromtu sessions are some of the more valuable interactions to be had at events such as these.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;More Video To Be Had&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It seems that almost everyone had a camera at the event.  &lt;a href="http://codebetter.com/blogs/gregyoung"&gt;Greg Young&lt;/a&gt; and &lt;a href="http://codebetter.com/blogs/david_laribee/"&gt;Dave Laribee&lt;/a&gt; managed to capture a bit of the sessions on video.  That's a great thing because I honestly wish I could have cloned myself and gone to more sessions.  Hopefully more of this will be forthcoming.  Dave posted Greg Young's &lt;a href="http://en.wikipedia.org/wiki/Fishbowl_%28conversation%29"&gt;fishbowl conversation&lt;/a&gt; on Architecture Futures which you can see &lt;a href="http://codebetter.com/blogs/david_laribee/archive/2008/04/23/future-architectures-fishbowl.aspx"&gt;here&lt;/a&gt;.  &lt;br /&gt;
&lt;br /&gt;
Other videos that are on this list are from &lt;a href="http://iunknown.com"&gt;John Lam's&lt;/a&gt; &lt;a href="http://www.ironruby.net/"&gt;IronRuby&lt;/a&gt; session, &lt;a href="http://udidahan.weblogs.us"&gt;Udi Dahan&lt;/a&gt; with &lt;a href="http://weblogs.asp.net/scottgu"&gt;ScottGu&lt;/a&gt; and &lt;a href="http://www.lostechies.com/blogs/chad_myers/"&gt;Chad Myers&lt;/a&gt; talking about Microsoft and Open Source Software and so on.  You can find them at the end of Greg's video.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Software Design Has Failed, What Can We Do About It?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Scott Koon, aka &lt;a href="http://www.lazycoder.com"&gt;LazyCoder&lt;/a&gt;, convened with &lt;a href="http://www.jpboodhoo.com/blog/"&gt;JP Boodhoo&lt;/a&gt; a session on how software design has failed us.  This turned into a fishbowl conversation as well since there was a lot to be said.  The basic points revolved around the large amount of software failures.  What causes them?  Are they technological issues?  People issues?  Politics?  Many people brought their opinions to bear, and it was interesting that the point that I brought is that at the end of the day, customer satisfaction is the metric that matters.  Are we listening to them?  In the Agile methodology world, customer satisfaction is the only metric.  Yes, we can talk about TDD/BDD, DDD and so on, but are we actually putting software into the hands of the user that they actually want?&lt;br /&gt;
&lt;br /&gt;
I'm not forgetting of course the ideals around mentoring and helping make the team stronger.  Those issues are important as well.  Do we do pair programming?  Do we hold brown bag sessions?  All of those suggestions are key to helping grow a stronger team.  But, also it helps grow the team as a more cohesive unit that's not afraid to ask questions, pair up and avoid flailing.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;F# and Concurrency&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Roy Osherove convened a session on concurrency and functional programming as the last topic I was going to attend.  When we start to deal with multi-core environments, threading issues come to bear more frequently.  Are we utilizing the CPUs to the maximum or are we still just sitting on that one thread, and barely using the machine to its capacity?  Those are many of the issues we face.  In &lt;a href="http://se-radio.net/podcast/2006-05/episode-14-interview-ted-neward"&gt;Software Engineering Radio Episode 14&lt;/a&gt;, &lt;a href="http://blogs.tedneward.com/"&gt;Ted Neward&lt;/a&gt; talks to this very point quite frankly that multi-threaded programming is hard.  There are no two ways about it.  But, when we talk about functional programming, some of that is solved.  Why?  Immutability by default is one of the key strong points of FP.  Instead, you have to go out of your way to make a value to be mutable.  Is this something we'll see in C# 4.0?  Spec# has something to say about it.  And once again, another topic for discussion.  I keep putting these things on my plate...&lt;br /&gt;
&lt;br /&gt;
Anyhow, Harry Pierson and I helped run this session.  Harry had some of his parsing code that he has posted on his blog to show off.  I think that did the trick well to show some advanced things such as &lt;a href="http://en.wikipedia.org/wiki/Higher-order_function"&gt;high order functions&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Pattern_matching"&gt;pattern matching&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Anonymous_functions"&gt;anonymous functions&lt;/a&gt; and so on.  Instead, if you wish to learn more, I'll probably cover it here in some detail, but you can check chapter 13 of Don Syme's "Expert F#" book to learn more in the mean time.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Action Items&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Some action items came up from this event that I think are rather important.  Because ALT.NET is a community looking to improve itself, there are naturally some things that help.  Here are a few that I can think of:&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;Keep the conversation going&lt;br /&gt;
    Just because the conference ended doesn't mean the conversations that started there have to.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Start a local group&lt;br /&gt;
    After the session was done, the &lt;a href="http://tech.groups.yahoo.com/group/altdotnet/"&gt;altdotnet mailing list &lt;/a&gt;came alive with people wanting to create that ALT.NET groups like I did in &lt;a href="http://altnet.ent0.com"&gt;DC&lt;/a&gt;, &lt;a href="http://persistall.com"&gt;Brian Donahue&lt;/a&gt; did in &lt;a href="http://phillyalt.net/"&gt;Philly&lt;/a&gt; and &lt;a href="http://jeremyjarrell.com/"&gt;Jeremy Jarrell&lt;/a&gt; did in &lt;a href="http://www.pittsburghalt.net/"&gt;Pittsburgh&lt;/a&gt;.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Support the community&lt;br /&gt;
    &lt;a href="http://www.lostechies.com/blogs/rhouston/archive/2008/04/22/funding-open-source-with-donations.aspx"&gt;Ray Houston&lt;/a&gt; laid out a challenge for those who use Open Source products to donate to them.  This doesn't mean only money, but time as well.  Many projects are in need of some assistance, and all it takes is for someone to ask.&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Challenge Assumptions and Bring Change&lt;br /&gt;
    It was said best during the conference "If you can't change your job, change your job".  Don't let these discussions that happened here just stay there.  Bring them to your work place, bring change for the better.  Question why things are done the way they are.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Wrapping it Up&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I'm glad to have been a part of this event in Seattle.  It couldn't have been with a better bunch of people who are willing to better themselves, challenge themselves and their assumptions and bring change to the developer community.  There was a lot to learn this past weekend and each conversation brought up a new angle.  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/24/121604.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/24/121604.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=121604"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121604" 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/121604.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/24/121604.aspx</guid>
            <pubDate>Thu, 24 Apr 2008 06:20:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121604.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/24/121604.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121604.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121604.aspx</trackback:ping>
        </item>
        <item>
            <title>ALT.NET Open Spaces, Seattle Day 2 Recap</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121513.aspx</link>
            <description>In my previous installment of recapping the events from ALT.NET Open Spaces, Seattle, I covered pretty much the opening ceremonies as it were.  The weather was definitely interesting the entire weekend.  Who would believe that we had snow, hail and rain for most of the time we were there in the latter half of April?  Mind you it didn't stick, but if you believe in God, there is something to be said of ALT.NET coming to town.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Coverage Galore&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://codebetter.com/blogs/jeffrey.palermo/default.aspx"&gt;Jeffrey Palermo&lt;/a&gt; was gracious enough to capture the opening ceremonies on video for all to see.  Here are some of the videos and they are well worth watching.  Really gives you an idea of how to run a good Open Spaces.  Doc did a wonderful job as a facilitator for the event.  And yes, that's me in the black coat in the background setting up for the event.&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://youtube.com/watch?v=kjzzQwOKMNA"&gt;ALT.NET Open Spaces, Seattle - Part 1&lt;/a&gt;&lt;br /&gt;
    An introduction by Doc on the meaning of Open Spaces&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://youtube.com/watch?v=kjzzQwOKMNA"&gt;ALT.NET Open Spaces, Seattle - Part 2&lt;/a&gt;&lt;br /&gt;
    More introduction and the suggestion of topics.  Everyone who submitted topics had to get in the middle of the room and declare their topic of interest.&lt;br /&gt;
    &lt;a href="http://youtube.com/watch?v=YuCGaBxjJhI&amp;amp;feature=related"&gt;&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="javascript:void(0);/*1208901273499*/"&gt;ALT.NET Attendees - Why Did You Come to ALT.NET?&lt;/a&gt;&lt;br /&gt;
    Jeffrey interviews various attendees such as the some Microsofties (&lt;a href="http://weblogs.asp.net/scottgu"&gt;Scott Guthrie&lt;/a&gt;, &lt;a href="http://devhawk.net"&gt;Harry Pierson&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/gblock"&gt;Glenn Block&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/donsmith/"&gt;Don Smith&lt;/a&gt;), &lt;a href="http://codebetter.com/"&gt;CodeBetter guys&lt;/a&gt; (Greg, Jeremy, JP Boodhoo, Ian Cooper), Scott Bellware, the Israelis (Udi, Roy, Justin and Ayende), &lt;a href="http://www.martinfowler.com/"&gt;Martin Fowler&lt;/a&gt;, &lt;a href="http://www.oreillynet.com/pub/au/468"&gt;John Osborn&lt;/a&gt;, &lt;a href="http://jamesshore.com/"&gt;Jim Shore&lt;/a&gt;, etc on what ALT.NET means to them and why they came.&lt;/li&gt;
&lt;/ul&gt;
&lt;a href="http://codebetter.com/blogs/david_laribee"&gt;Dave Laribee&lt;/a&gt; also has a ton of video as well.  Most recently, the &lt;a href="http://en.wikipedia.org/wiki/Fishbowl_%28conversation%29"&gt;Fishbowl conversation&lt;/a&gt; about the &lt;a href="http://en.wikipedia.org/wiki/Polyglot_%28computing%29"&gt;polyglot programmer&lt;/a&gt; has been posted &lt;a href="http://codebetter.com/blogs/david_laribee/archive/2008/04/22/polyglot-programmer-fishbowl.aspx"&gt;here&lt;/a&gt;.  The debate starts with &lt;a href="http://codebetter.com/blogs/jeremy.miller/default.aspx"&gt;Jeremy Miller&lt;/a&gt;, &lt;a href="http://blogs.tedneward.com/"&gt;Ted Neward&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/charlie/"&gt;Charlie Calvert&lt;/a&gt;, &lt;a href="http://hanselman.com"&gt;Scott Hanselman&lt;/a&gt; and others.  Really good conversation posted.&lt;br /&gt;
So, as you can see from the videos it was a pretty diverse crowd.  And, hey, we managed to get all of 5 women there too!  &lt;a href="http://blogs.msdn.com/peterlau/"&gt;Peter Laudati&lt;/a&gt; posted the schedule &lt;a href="http://blogs.msdn.com/peterlau/archive/2008/04/19/alt-net-open-space-seattle-schedule-grid.aspx"&gt;here&lt;/a&gt; which was initialed by all who wanted to see that particular discussion.&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;IronRuby Session&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Since &lt;a href="http://iunknown.com"&gt;John Lam&lt;/a&gt; wasn't around on Friday for the topic submittal, I so graciously put his name in for him.  Luckily he agreed so we were good to go for the first session.  We didn't have any canned presentations which is nice.  Instead, John focused more on how far &lt;a href="http://www.ironruby.net/"&gt;IronRuby&lt;/a&gt; has yet to go.  It was interesting that he is using the &lt;a href="http://rubini.us/"&gt;Rubinius&lt;/a&gt; &lt;a href="http://rubinius.lighthouseapp.com/projects/5089/specs-overview"&gt;specs&lt;/a&gt; in order to validate IronRuby.  Also of note, it was pretty cool to see that Spec# has been used for the IronRuby compiler.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Covering Spec#&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the functional programming talk that I planned with Dustin Campbell was put right along side the Spec# talk, so I had to make a choice.  I picked Spec# as it was the first Open Spaces they had done.  As I said before, one of the major things I wanted to talk about was &lt;a href="http://research.microsoft.com/specsharp/"&gt;Spec#&lt;/a&gt; at ALT.NET.  Both Greg Young and I were pretty interested in getting &lt;a href="http://research.microsoft.com/~leino/"&gt;Rustan Leino&lt;/a&gt; and &lt;a href="http://research.microsoft.com/~mbarnett/"&gt;Mike Barnett&lt;/a&gt; to show off the technology to the masses.  And what better way than to show a bunch of geeks like us this technology.  Anyhow, Mike and Rustan did a really good presentation to show off Spec# to a mass audience.  For those not familiar with Spec#, I did a whole series on this on my old blog &lt;a href="http://geekswithblogs.net/Podwysocki/archive/2008/01/07/118360.aspx"&gt;here&lt;/a&gt;.  Basically, the intent of Spec# is to provide &lt;a href="http://en.wikipedia.org/wiki/Design_by_contract"&gt;Design by Contract&lt;/a&gt; specifications in your classes and have that exposed to the outside world.  So, no more guessing about the preconditions, postconditions and invariants of your system, instead, we can be pretty explicit about it.&lt;br /&gt;
&lt;br /&gt;
The problem that they are facing is that Spec# is not just an additive to the C# compiler, instead it's a separate compiler that is compliant with the C# 2.0 specification.  The problem is that C# 3.0 introduces a few more items, albeit mostly syntactic sugar for the most part, and yet Mike is really one of the only guys doing the Spec# compiler.  So, making it C# 3.0 compliant is a pretty daunting task.  Instead, a future focus is on making language neutral pieces available to all .NET languages just as we saw briefly in the System.Core.dll assembly under the Microsoft.Contracts namespace.  The point of inviting them was to help bring their cause to a wider audience.  &lt;a href="http://www.microsoft.com/presspass/exec/techfellow/Hejlsberg/default.mspx"&gt;Anders Hejlsberg&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/madst/"&gt;Mads Torgersen&lt;/a&gt; need to put this on their mind as to how to incorporate, and I'll make sure it's widely known.&lt;br /&gt;
&lt;br /&gt;
It was great to see &lt;a href="http://hanselman.com"&gt;Scott Hanselman&lt;/a&gt; quite excited about the technology and hopefully you'll see more of it from him soon.  Also, stay tuned to &lt;a href="http://infoq.com"&gt;InfoQ&lt;/a&gt; for more Spec# related items as well.  I intend to cover things again shortly to talk about some other new things in Spec# as well as the new release.  Stay tuned for that...&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;ASP.NET MVC&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://haacked.com"&gt;Phil Haack&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/brada/"&gt;Brad Abrams&lt;/a&gt; hosted a discussion on &lt;a href="http://asp.net/mvc"&gt;ASP.NET MVC&lt;/a&gt; which was pretty positive overall.  There has been a number, around 5% that Microsoft has been throwing out there as a number of people that would be adopting ASP.NET MVC over traditional web forms.  The audience was rightly skeptical of such a number and wish that they would cut it out.  Instead, it could have the effect of scaring away people from adopting this framework as their choice for ASP.NET web applications.  I can totally understand that the numbers could be there due to the ISV market which make controls for ASP.NET web forms which is something that the MVC framework doesn't support.  Another request was to support open source javascript frameworks better.  But overall, Phil and Brad were pretty receptive and it was an overall positive experience.&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;Are We Innovating?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Scott Hanselman convened a talk asking "Are We Innovating or Are We Just Porting?" in which that very question was asked.  If you look at the open source frameworks that exist within the .NET space, it's not hard to see what he's talking about:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;JUnit =&amp;gt; NUnit, MbUnit, xUnit.net&lt;/li&gt;
    &lt;li&gt;Hibernate =&amp;gt; NHibernate&lt;/li&gt;
    &lt;li&gt;Spring =&amp;gt; Spring.NET&lt;/li&gt;
    &lt;li&gt;Ruby on Rails =&amp;gt; MonoRail&lt;/li&gt;
    &lt;li&gt;jMock =&amp;gt; NMock, Rhino Mocks, Moq&lt;/li&gt;
    &lt;li&gt;And the list goes on...&lt;/li&gt;
&lt;/ul&gt;
But when you look at the list the other way around, we really don't see it going the other way.  Is it because that in the Java world, frameworks weren't provided by Sun as they were for Microsoft?  Or was it something else?  The answer of course isn't easy and maybe it's not in the frameworks area that we need to look.  For example such applications as Paint.NET is truly innovative in my opinion.  I wouldn't have half the picture content on this blog as easily without it.  Also, some open source blogging engines work quite well as well.  So, there is innovation, but if you look to recent times, have we caught up?&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;To Be Continued...&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121513.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121513.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=121513"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121513" 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/121513.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121513.aspx</guid>
            <pubDate>Tue, 22 Apr 2008 23:14:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121513.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121513.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121513.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121513.aspx</trackback:ping>
        </item>
        <item>
            <title>DC ALT.NET Meeting 4/23/2008 - Jay Flowers and CI Factory</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121487.aspx</link>
            <description>Now that we've somewhat recovered from &lt;a href="http://altdotnet.org/events/seattle"&gt;ALT.NET Open Spaces, Seattle&lt;/a&gt;, it's time for another DC ALT.NET meeting.  I'm currently finishing up my wrapups for Seattle still and I'm sure I have months worth of material from there.  Anyhow, this time &lt;a href="http://jayflowers.com/joomla/"&gt;Jay Flowers&lt;/a&gt; will be talking to us about &lt;a href="http://en.wikipedia.org/wiki/Continuous_Integration"&gt;Continuous Integration&lt;/a&gt; and &lt;a href="http://www.cifactory.com/"&gt;CI Factory&lt;/a&gt; which was postponed from last month due to schedule conflicts.  As always we have the first hour or whenever the conversation ends for our main topic and the rest is Open Spaces.  Food will be served as well.&lt;br /&gt;
&lt;br /&gt;
Below are the details for the meeting:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt; Time: &lt;/span&gt;&lt;br /&gt;
4/23/2008 - 7PM-9PM&lt;br /&gt;
&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt; Location:&lt;/span&gt;&lt;br /&gt;
2201 Wilson Blvd&lt;br /&gt;
Arlington, VA 22201&lt;a href="http://www.archstoneapartments.com/Apartments/Virginia/Clarendon-Ballston-Rosslyn/2201_Wilson_Boulevard/"&gt;Archstone Aparaments&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt; Parking/Metro:&lt;/span&gt;&lt;br /&gt;
Best parking on N. Veitch St&lt;br /&gt;
Courthouse Metro the best bet &lt;br /&gt;
&lt;br /&gt;
As always you can find out more by joining the mailing list here.  Hope to see a great crowd there and to continue some of the great discussions that were held in Seattle.  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/22/121487.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/04/22/121487.aspx" /&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121487"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121487" 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/121487.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121487.aspx</guid>
            <pubDate>Tue, 22 Apr 2008 04:38:51 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121487.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/22/121487.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121487.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121487.aspx</trackback:ping>
        </item>
        <item>
            <title>ALT.NET Open Spaces, Seattle Day 1 Recap</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/20/121439.aspx</link>
            <description>&lt;a href="http://altdotnet.org/events/seattle"&gt;ALT.NET Open Spaces, Seattle&lt;/a&gt; has come to a close.  What a great time it was and it met every expectation if not exceeded them.  Currently I'm in the Seattle airport waiting for my flight home which just got re-arranged.  Anyhow, I'd like to wrap up my thoughts for the first day of the event.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Setting It Up&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I arrived one day early for the event to make sure we were set up appropriately.  I was able to meet up with &lt;a href="http://codebetter.com/blogs/david_laribee/default.aspx"&gt;Dave Laribee&lt;/a&gt;, &lt;a href="http://codebetter.com/blogs/glenn.block/default.aspx"&gt;Glenn Block&lt;/a&gt;, Scott Bellware, &lt;a href="http://codebetter.com/blogs/jeremy.miller/default.aspx"&gt;Jeremy Miller&lt;/a&gt;, &lt;a href="http://codebetter.com/blogs/gregyoung/default.aspx"&gt;Greg Young&lt;/a&gt;, &lt;a href="http://scottcreynolds.com"&gt;Scott C Reynolds&lt;/a&gt;, &lt;a href="http://codebetter.com/blogs/raymond.lewallen/default.aspx"&gt;Ray Lewallen&lt;/a&gt;, &lt;a href="http://codebetter.com/blogs/patricksmacchia/default.aspx"&gt;Patrick Smacchia&lt;/a&gt; and others.  Everyone was already burned out from the MVP Summit, so I wasn't sure how well people would be for the event.  But it was great to talk to &lt;a href="http://samgentile.com/blogs/samgentile/"&gt;Sam Gentile&lt;/a&gt; and I'm glad he's back in the fold with ALT.NET as he announced earlier last week &lt;a href="http://samgentile.com/blogs/samgentile/archive/2008/04/18/building-bridges.aspx"&gt;here&lt;/a&gt;.  &lt;br /&gt;
&lt;br /&gt;
Even though a lot of people were tired, we had plenty of help to set up for the event.  Of course the joke is that "How many ALT.NETers does it take to go to Costco?"...&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Kicking It Off&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One couldn't ask for a more prepared and outstanding facilitator in &lt;a href="http://www.stevenlist.com/"&gt;Steven "Doc" List&lt;/a&gt;.  What an amazing job he did to bring the Open Spaces together.  The event started with a description of &lt;a href="http://en.wikipedia.org/wiki/Open_Space_Technology"&gt;Open Spaces Technology&lt;/a&gt;.  if you're not familiar with the Open Spaces, Technology Format, here are the four basic principles:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;Whoever comes are the right people&lt;/li&gt;
    &lt;li&gt;Whatever happens is the only thing that could have&lt;/li&gt;
    &lt;li&gt;Whenever it starts is the right time&lt;/li&gt;
    &lt;li&gt;When it's over, it's over&lt;/li&gt;
&lt;/ul&gt;
With that getting kicked off, we then laid out the pens and sticky paper to write the sessions.  The idea is to write down your idea on the sticky paper and then get to the middle of the room and announce your talk that you will facilitate.  Of course some subjects may be very similar and can be combined, which happened quite a bit actually.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;The Sessions&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I met with &lt;a href="http://research.microsoft.com/~mbarnett/"&gt;Mike Barnett&lt;/a&gt; from the &lt;a href="http://research.microsoft.com/specsharp"&gt;Spec#&lt;/a&gt; team who was one of the many people I had invited to this event.  Spec# as you may have figured from my blog is a passion of mine.  It is one of my goals to publicize it enough and to make sure that people are aware of this wonderful technology that the product teams such as &lt;a href="http://blogs.msdn.com/madst/"&gt;Mads Torgersen&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg"&gt;Anders Hejlsberg&lt;/a&gt; notice.  Anyhow, Mike went up and announced a session on Spec# and static verification.  I'll cover more of that in subsequent posts again.  Start your letter writing campaigns now!&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://diditwith.net/"&gt;Dustin Campbell&lt;/a&gt; also was in attendance and he and I chatted about F# and doing a session on functional programming and F#.  It was going to be a great session, but unfortunately when the schedule was finalized, I couldn't possibly attend the Spec# and functional programming and F# talk.  I was a little disappointed by that, but luckily &lt;a href="http://weblogs.asp.net/rosherove/"&gt;Roy Osherove&lt;/a&gt; suggested a talk about "Concurrency and Functional Programming" which I was more than willing and able to help out on. I also pulled &lt;a href="http://devhawk.net/"&gt;Harry Pierson&lt;/a&gt;, the new Program Manager for &lt;a href="http://www.codeplex.com/IronPython"&gt;IronPython&lt;/a&gt; to help in such a session.&lt;br /&gt;
&lt;br /&gt;
Since &lt;a href="http://www.iunknown.com/"&gt;John Lam&lt;/a&gt; wasn't in attendance that night, I volunteered him for a session on &lt;a href="http://www.ironruby.net/"&gt;IronRuby&lt;/a&gt; and the DLR which he was more than happy to oblige.  We scheduled that for the first session on Saturday.  I'll cover each of these in detail in subsequent posts.  &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;The Fishbowl&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
From there, we went to a fishbowl style conversation in which there are a number of chairs in the middle of the room.  There must be all but one of the chairs filled at any given time.  Any person may in turn come and take a seat and another person must leave to keep the balance.  The discussion started with &lt;a href="http://hanselman.com"&gt;Scott Hanselman&lt;/a&gt;, &lt;a href="http://www.tedneward.com"&gt;Ted Neward&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/charlie/"&gt;Charlie Calvert&lt;/a&gt; and &lt;a href="http://martinfowler.com/bliki"&gt;Martin Fowler&lt;/a&gt; talking about the Polyglot Programmer.  Ted Neward couldn't be there for the whole event, unfortunately as he was also doing &lt;a href="http://www.nofluffjuststuff.com/"&gt;No Fluff Just Stuff&lt;/a&gt; this weekend as well with &lt;a href="http://www.agiledeveloper.com/blog/"&gt;Venkat Subramaniam&lt;/a&gt;, Neal Ford and others.  Luckily I got some time to talk to Ted about some F# related items as well as his upcoming trip to Reston, VA for No Fluff Just Stuff next weekend.  So, if you're in the area and interested in seeing Ted and Venkat, that's the place to go!  But anyways, the event was great and a lot of people pitched in.  There are so many to name, I'd just run out of space.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;To Be Continued....&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/20/121439.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/20/121439.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=121439"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121439" 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/121439.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/20/121439.aspx</guid>
            <pubDate>Mon, 21 Apr 2008 02:56:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121439.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/20/121439.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121439.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121439.aspx</trackback:ping>
        </item>
        <item>
            <title>Off to Seattle and ALT.NET Open Spaces, Seattle</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/17/121314.aspx</link>
            <description>Well, the day has finally come where I'm heading to &lt;a href="http://altdotnet.org/events/seattle"&gt;ALT.NET Open Spaces, Seattle&lt;/a&gt;.  It's been a long time of planning for this day with all the other guys mentioned on the site.  The weather's not looking so great with a possibility of snow on Saturday.  Not looking forward to that part as I'm leaving sunny, beautiful Washington DC where it is around 75F or so right now.&lt;br /&gt;
&lt;br /&gt;
I hope to be live blogging much of the event, well as much as I can.  I you're on &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt;, you can follow me at &lt;a href="http://twitter.com/mattpodwysocki"&gt;mattpodwysocki&lt;/a&gt;.  Looking forward to seeing everyone there!&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121314"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121314" 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/121314.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/17/121314.aspx</guid>
            <pubDate>Thu, 17 Apr 2008 15:53:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121314.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/17/121314.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121314.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121314.aspx</trackback:ping>
        </item>
        <item>
            <title>Adventures in F# - F# 101 Part 8 (Mutables and Reference Cells)</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121272.aspx</link>
            <description>Time for another adventure in F#, covering some of the basics of functional programming and F# in particular.  Today we'll manage to look more at regular .NET integration and .NET programming.  With the previous efforts, we've looked more at &lt;a href="http://en.wikipedia.org/wiki/Functional_programming"&gt;functional programming&lt;/a&gt; and in turn F# specific things, but want to show that you can do anything normally in F# that you can in C#.  To me, F# is the perfect all-purpose language because it can do a lot of the things C# can do, but in turn, F# can do things much more elegantly than C# can, such as &lt;a href="http://en.wikipedia.org/wiki/Pattern_matching"&gt;Pattern Matching&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt; Where We Are&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Before we begin today, let's catch up to where we are today:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a mce_href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-1.aspx" href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-1.aspx"&gt;Part 1 - Basic functional programming&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a mce_href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-2.aspx" href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-2.aspx"&gt;Part 2 - Currying and Tuples&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a mce_href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-3.aspx" href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-3.aspx"&gt;Part 3 - Scope, Recursion and Anonymous Functions&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a mce_href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-4.aspx" href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-4.aspx"&gt;Part 4 - History of F#, Operators and Lists&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a mce_href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-5-pattern-matching.aspx" href="http://weblogs.asp.net/podwysocki/archive/2008/03/17/adventures-in-f-f-101-part-5-pattern-matching.aspx"&gt;Part 5 - Pattern Matching&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/03/21/adventures-in-f-f-101-part-6-lazy-evaluation.aspx"&gt;Part 6 - Lazy Evaluation&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://weblogs.asp.net/podwysocki/archive/2008/04/02/adventures-in-f-f-101-part-7-creating-types.aspx"&gt;Part 7 - Creating Types&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Today's topic will be covering imperative and object oriented programming in F#.  There is a lot to cover, so let's get started.  But there are a few administrative things to get out of the way first.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Learning F# ala Ted Neward?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.tedneward.com/"&gt;Ted Neward&lt;/a&gt; recently announced on &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=332"&gt;DotNetRocks Episode 332&lt;/a&gt;  that he's in the process of creating a class for F# for &lt;a href="http://www.pluralsight.com/"&gt;Pluralsight&lt;/a&gt;.  That should be interesting to those who are interested in this series, as well as F# in general.  Right now the community is rather small, so efforts like this should be rather rewarding I would hope.  Ted's a pretty brilliant guy, so I'd imagine only the best.  I'm hoping more details come out soon.  &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Pattern Matching in C#&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Part of this series is intended to bring such concepts as Pattern Matching, &lt;a href="http://en.wikipedia.org/wiki/Currying"&gt;Currying&lt;/a&gt; and other Functional Programming concepts to the C# developer.  After all, the more C# language evolves, the more it seems to fall into the Functional Programming category.  In previous posts, I showed how to relate currying to C# and it was less elegant than F# to say the least.&lt;br /&gt;
&lt;br /&gt;
But, let's look at Pattern Matching.  &lt;a href="http://community.bartdesmet.net/blogs/bart/"&gt;Bart De Smet&lt;/a&gt; has been posting recently on his blog about bringing the beauty of pattern matching to C#.  So far it's been a good six posts into it and I urge you to go ahead and take a look at this series.  &lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/06/pattern-matching-in-c-part-0.aspx"&gt;Pattern Matching in C# - Part 0&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/07/pattern-matching-in-c-part-1.aspx"&gt;Pattern Matching in C# - Part 1&lt;/a&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/06/pattern-matching-in-c-part-0.aspx"&gt;&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/08/pattern-matching-in-c-part-2.aspx"&gt;Pattern Matching in C# - Part 2&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/09/pattern-matching-in-c-part-3.aspx"&gt;Pattern Matching in C# - Part 3&lt;/a&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/06/pattern-matching-in-c-part-0.aspx"&gt;&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/10/pattern-matching-in-c-part-4.aspx"&gt;Pattern Matching in C# - Part 4&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/11/pattern-matching-in-c-part-5.aspx"&gt;Pattern Matching in C# - Part 5&lt;br /&gt;
    &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/14/pattern-matching-in-c-part-6.aspx"&gt;Pattern Matching in C# - Part 6&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/04/15/pattern-matching-in-c-part-7.aspx"&gt;Pattern Matching in C# - Part 7&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
But when you read the series, it's all about getting into the low level and compiling expression trees to make the same simple beauty that is F#.  Sure, it can be done in C#, but nowhere near as elegant.  Performance is another issue that comes to mind with these.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Imperative Programming in F#&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This section I'll lay out some of the basics of imperative style programming before I get into the full object oriented approach to programming.  So, we'll cover just a few topics and then I'll feel comfortable moving onto the real parts of creating classes and such.  We'll cover such things as void types and mutability in this section.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;The unit Type&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One of the first things I forgot to mention when describing F# functions and values in the unit type.  Think of this as the void type in C# that you are used to.  It's the type that doesn't accept or return a value.  First, let's look at the typical C# program with the void type for Hello World.&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     \cf3 class\cf1  \cf4 Program\par ??\cf1     \{\par ??        \cf3 static\cf1  \cf3 void\cf1  Main(\cf3 string\cf1 [] args)\par ??        \{\par ??            \cf4 Console\cf1 .WriteLine(\cf5 "Hello World"\cf1 );\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;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;Console&lt;/span&gt;.WriteLine(&lt;span style="color: lime;"&gt;"Hello World"&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;
Now, let's go ahead and look at it from the F# perspective. &lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;}??\fs16 \cf1\cb2\highlight2 #light\par ??\par ??\cf3 let\cf1  \cf3 rec\cf1  fib n = \par ??  \cf3 match\cf1  n \cf3 with\par ??\cf1   | 0 \cf3 -&amp;gt;\cf1  1\par ??  | 1 \cf3 -&amp;gt;\cf1  1\par ??  | x \cf3 -&amp;gt;\cf1  fib(n - 2) + fib(n - 1)\par ??  \par ??print_any (fib (-1))}
--&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;#light&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 128, 0);"&gt;let&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;&lt;/span&gt;&lt;/span&gt;main() =&lt;br /&gt;
  printfn &lt;span style="color: rgb(0, 255, 0);"&gt;"Hello World"&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
As you will see when you hover over our code is that it is a unit type.  That in itself isn't all that interesting.   But, what we'll run into is problems when functions return a value, but we're not all that interested in them.  What happens?  Well, F# will complain that your return value isn't compatible with the unit type, which is essentially true.  So, how do you get around that?  Let's walk through a simple unit test of a Stack written in F# and unit testing with the &lt;a href="http://codeplex.com/xunit"&gt;xUnit.net&lt;/a&gt; framework.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;}??\fs16 \cf1\cb2\highlight2 #light\par ??\par ??\cf3 let\cf1  \cf3 rec\cf1  fib n = \par ??  \cf3 match\cf1  n \cf3 with\par ??\cf1   | 0 \cf3 -&amp;gt;\cf1  1\par ??  | 1 \cf3 -&amp;gt;\cf1  1\par ??  | x \cf3 -&amp;gt;\cf1  fib(n - 2) + fib(n - 1)\par ??  \par ??print_any (fib (-1))}
--&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;#light&lt;br /&gt;
&lt;br /&gt;
#R &lt;span style="color: rgb(0, 255, 0);"&gt;@"D:\Tools\xunit-build-1252\xunit.dll"&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;open &lt;/span&gt;System&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;open &lt;/span&gt;System.Collections.Generic&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;open &lt;/span&gt;Xunit&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;type &lt;/span&gt;Stack&amp;lt;'t&amp;gt; = &lt;span style="color: rgb(255, 153, 0);"&gt;class&lt;/span&gt;&lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;val &lt;/span&gt;elements : LinkedList&amp;lt;'t&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;new&lt;/span&gt;() = { elements = &lt;span style="color: rgb(255, 153, 0);"&gt;new &lt;/span&gt;LinkedList&amp;lt;'t&amp;gt;() }&lt;br /&gt;
 &lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;member &lt;/span&gt;x.IsEmpty&lt;br /&gt;
    &lt;span style="color: rgb(255, 153, 0);"&gt;with &lt;/span&gt;get() = x.elements.Count = 0&lt;br /&gt;
   &lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;member &lt;/span&gt;x.Push element =&lt;br /&gt;
    x.elements.AddFirst(element:'t)&lt;br /&gt;
   &lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;member &lt;/span&gt;x.Top&lt;br /&gt;
    &lt;span style="color: rgb(255, 153, 0);"&gt;with &lt;/span&gt;get() =&lt;br /&gt;
      &lt;span style="color: rgb(255, 153, 0);"&gt;if &lt;/span&gt;x.elements.Count = 0 &lt;span style="color: rgb(255, 153, 0);"&gt;then&lt;/span&gt;&lt;br /&gt;
        raise (InvalidOperationException("cannot top an empty stack"))&lt;br /&gt;
      x.elements.First.Value&lt;br /&gt;
     &lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;member &lt;/span&gt;x.Pop() =&lt;br /&gt;
    let top = x.Top&lt;br /&gt;
    x.elements.RemoveFirst()&lt;br /&gt;
    top&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
[&amp;lt;Fact&amp;gt;]  &lt;br /&gt;
&lt;span style="color: rgb(255, 128, 0);"&gt;let&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;&lt;/span&gt;&lt;/span&gt;PopEmpty () =&lt;br /&gt;
  &lt;span style="color: rgb(255, 128, 0);"&gt;let&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;&lt;/span&gt;&lt;/span&gt;stack = &lt;span style="color: rgb(255, 153, 0);"&gt;new&lt;/span&gt; Stack&amp;lt;string&amp;gt;()&lt;br /&gt;
  Assert.Throws&amp;lt;InvalidOperationException&amp;gt;(&lt;span style="color: rgb(255, 153, 0);"&gt;fun &lt;/span&gt;() -&amp;gt; stack.Pop() |&amp;gt; ignore )&lt;br /&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
The real interesting part you should pay attention to is the last line.  As you can see, I am using the forward operator to indicate that I really don't care what the function returns, just that I'm interested in that it executes.  This is most likely during such functions that have some sort of side effect to them.  I could also use the ignore function instead of the forward operator such as this:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;}??\fs16 \cf1\cb2\highlight2 #light\par ??\par ??\cf3 let\cf1  \cf3 rec\cf1  fib n = \par ??  \cf3 match\cf1  n \cf3 with\par ??\cf1   | 0 \cf3 -&amp;gt;\cf1  1\par ??  | 1 \cf3 -&amp;gt;\cf1  1\par ??  | x \cf3 -&amp;gt;\cf1  fib(n - 2) + fib(n - 1)\par ??  \par ??print_any (fib (-1))}
--&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;Fact&amp;gt;]  &lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;let &lt;/span&gt;PopEmpty () =&lt;br /&gt;
  &lt;span style="color: rgb(255, 153, 0);"&gt;let &lt;/span&gt;stack &lt;span style="color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;=&lt;/span&gt; new &lt;/span&gt;Stack&amp;lt;string&amp;gt;()&lt;br /&gt;
  Assert.Throws&amp;lt;InvalidOperationException&amp;gt;(&lt;span style="color: rgb(255, 153, 0);"&gt;fun &lt;/span&gt;() -&amp;gt; ignore(stack.Pop()) )&lt;br /&gt;
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
This is very helpful in these cases where we really don't care about the return value, instead want to mutate the state of our given object, such as removing a value from a collection and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Mutables&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
As I said in many posts before, by default all "variables" by which I mean values in F# are immutable.  This is a standard in functional programming and all in the ML family.  You can easily redefine a value by using the let keyword, but not actually mutate its state.  But, since F# is a multi-purpose language on the .NET platform, mutable state can be had.  To take advantage of this, mark your value as mutable.  Then to change the value, just use the &amp;lt;- operator to reassign the value.  Below is a simple example of this:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;}??\fs16 \cf1\cb2\highlight2 #light\par ??\par ??\cf3 let\cf1  \cf3 rec\cf1  fib n = \par ??  \cf3 match\cf1  n \cf3 with\par ??\cf1   | 0 \cf3 -&amp;gt;\cf1  1\par ??  | 1 \cf3 -&amp;gt;\cf1  1\par ??  | x \cf3 -&amp;gt;\cf1  fib(n - 2) + fib(n - 1)\par ??  \par ??print_any (fib (-1))}
--&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;#light&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;let mutable&lt;/span&gt; answer = 42&lt;br /&gt;
printfn &lt;span style="color: rgb(0, 255, 0);"&gt;"Answer is %i"&lt;/span&gt; answer&lt;br /&gt;
answer &amp;lt;- 8&lt;br /&gt;
printfn &lt;span style="color: rgb(0, 255, 0);"&gt;"Answer is %i"&lt;/span&gt; answer&lt;br /&gt;
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
A key difference from the reassignment is that you cannot change the value type.  Whereas I can redefine answer by keep using the let keyword, I can only keep my answer in this above example of the int type.  &lt;br /&gt;
&lt;br /&gt;
This can also apply to record types as well where you can change the fields.  In the last installment, we talked about record types.  Well, by default there as well, the fields for the record type are immutable.  But, as with before, that can be changed.  I of course like to caution people that mutable state takes a lot of the value proposition away from the side effect free programming that you gain with F# by default.  But, nevertheless, you can still do it as noted below:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;}??\fs16 \cf1\cb2\highlight2 #light\par ??\par ??\cf3 let\cf1  \cf3 rec\cf1  fib n = \par ??  \cf3 match\cf1  n \cf3 with\par ??\cf1   | 0 \cf3 -&amp;gt;\cf1  1\par ??  | 1 \cf3 -&amp;gt;\cf1  1\par ??  | x \cf3 -&amp;gt;\cf1  fib(n - 2) + fib(n - 1)\par ??  \par ??print_any (fib (-1))}
--&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;#light&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;type &lt;/span&gt;Person = { FirstName : string; &lt;span style="color: rgb(255, 153, 0);"&gt;mutable &lt;/span&gt;LastName : string; &lt;span style="color: rgb(255, 153, 0);"&gt;mutable &lt;/span&gt;IsMarried : bool }&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;let &lt;/span&gt;friend = { FirstName = "Courtney"; LastName = "Cox"; IsMarried = &lt;span style="color: rgb(255, 153, 0);"&gt;false &lt;/span&gt;}&lt;br /&gt;
friend.LastName &amp;lt;- "Cox-Arquette"&lt;br /&gt;
friend.IsMarried &amp;lt;- true &lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
What I was able to do was define a Person record and change a couple of fields while using the &amp;lt;- operator and defining the fields as mutable.  Yes, I could have used some scientific calculation or something, but this was easy.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Reference Cells&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The last thing I want to touch on in this post is reference cells.  You can think of these much as pointers in other languages or reference types.  These of course can be of any type.  The idea behind using these is to make updating fields as easy as possible.  As with mutable fields, you cannot change the type once it has been assigned.  To use these, you need to remember three basic operators&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="font-weight: bold;"&gt;ref &lt;/span&gt;- Allocates a reference cell&lt;/li&gt;
    &lt;li&gt;&lt;span style="font-weight: bold;"&gt;:=&lt;/span&gt; - Mutates a reference cell&lt;/li&gt;
    &lt;li&gt;&lt;span style="font-weight: bold;"&gt;!&lt;/span&gt; - Reads the reference cell&lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
Below is a quick example of mutation through reference cells:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;??\red255\green255\blue255;\red40\green40\blue40;\red255\green128\blue0;}??\fs16 \cf1\cb2\highlight2 #light\par ??\par ??\cf3 let\cf1  \cf3 rec\cf1  fib n = \par ??  \cf3 match\cf1  n \cf3 with\par ??\cf1   | 0 \cf3 -&amp;gt;\cf1  1\par ??  | 1 \cf3 -&amp;gt;\cf1  1\par ??  | x \cf3 -&amp;gt;\cf1  fib(n - 2) + fib(n - 1)\par ??  \par ??print_any (fib (-1))}
--&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;#light&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 153, 0);"&gt;let &lt;/span&gt;x = ref 2&lt;br /&gt;
x := !x + 25&lt;br /&gt;
printfn &lt;span style="color: rgb(0, 255, 0);"&gt;"%i"&lt;/span&gt; !x&lt;br /&gt;
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
What the code example above lets me do is define a reference to the number 2.  Then I can change that reference by reading the current x value and adding 25.  Then I mutate the existing x value with the result.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This is just meant to be a brief overview to some imperative programming constructs that you might see in .NET, Java, C, C++ and so on.  F# is a first class language all the way with constructs that support these things as well as your normal functional programming constructs.  I hope we get to cover some of this at &lt;a href="http://altdotnet.org/events/seattle"&gt;ALT.NET Open Spaces, Seattle&lt;/a&gt; at some point because I'm sure a lot of people will be interested.  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/15/121272.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121272.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=121272"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121272" 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/121272.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121272.aspx</guid>
            <pubDate>Tue, 15 Apr 2008 23:08:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121272.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121272.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121272.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121272.aspx</trackback:ping>
        </item>
        <item>
            <title>ALT.NET on DotNetRocks and the Community</title>
            <link>http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121261.aspx</link>
            <description>&lt;a href="http://codebetter.com/blogs/david_laribee/default.aspx"&gt;Dave Laribee&lt;/a&gt; and &lt;a href="http://codebetter.com/blogs/jeremy.miller/default.aspx"&gt;Jeremy Miller&lt;/a&gt; recently recorded an episode on &lt;a href="http://www.dotnetrocks.com"&gt;DotNetRocks&lt;/a&gt; and was just posted today.  Episode 333 "It's the ALT.NET Show" can be found &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=333"&gt;here&lt;/a&gt;.  It's a great show that explains &lt;a href="http://altdotnet.org/"&gt;ALT.NET&lt;/a&gt; for those who may not really know what it is outside of some of the arguments on the &lt;a href="http://tech.groups.yahoo.com/group/altdotnet/"&gt;altdotnet mailing list&lt;/a&gt;.  This includes discussions on open source frameworks, agile practices, refactoring and so on.  &lt;br /&gt;
&lt;br /&gt;
It's great to see the reaction from this show at least from my perspective.  To see the job we're doing from &lt;a href="http://joshholmes.com/"&gt;Josh Holmes&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/gblock/"&gt;Glenn Block&lt;/a&gt;, me and others from within to reach out and also present ideas and bridge the gaps.  It's been very rewarding to be a part of that.&lt;br /&gt;
&lt;br /&gt;
We're only just a few days away from &lt;a href="http://altdotnet.org/events/seattle"&gt;ALT.NET Open Spaces, Seattle&lt;/a&gt;.  All of those who are attending should have received a notice of such this morning.  I'll be arriving in Seattle on Thursday afternoon to help set up for the event so if anyone wants to hang out beforehand let me know.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Bringing It To The Community&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Anyhow, this weekend I did my best to bring some of those ALT.NET practices to the &lt;a href="http://www.cmap-online.org/CodeCamp/"&gt;CMAP Code Camp&lt;/a&gt; and we had a pretty good turnout.  This time I talked about refactoring to patterns, dependency injection and inversion of control containers.  I'm hoping to do the same for the Northern Virginia Code Camp coming up on May 17th.  &lt;a href="http://persistall.com/"&gt;Brian Donahue&lt;/a&gt; has been rather successful doing so with the &lt;a href="http://phillydotnet.org/"&gt;Philly Code Camps&lt;/a&gt; as well.  That reminds me that I'm coming up there in mid-May to do an F# session.  Should be a fun time. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121261.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/04/15/121261.aspx" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121261"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121261" 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/121261.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matthew Podwysocki</dc:creator>
            <guid>http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121261.aspx</guid>
            <pubDate>Tue, 15 Apr 2008 18:12:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Podwysocki/comments/121261.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Podwysocki/archive/2008/04/15/121261.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Podwysocki/comments/commentRss/121261.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Podwysocki/services/trackbacks/121261.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>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