Matthew Podwysocki's Blog
Architect, Develop, Inspire...
-
RockNUG IoC Container Presentation Wrapup
I want to thank the fine folks at the Rockville .NET Users Group (RockNUG) and Dean Fiala 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.
Once again, I'd like to plug my DC ALT.NET group that I run. Our next meeting is scheduled for April 23rd and the topic will be Continuous Integration with Jay Flowers. We'll announce the location shortly for our group. You can go ahead and sign up for our mailing list here.
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:
- Articles
- Blogs
- Books
-
NoVARUG Meeting April 16th - Dave Thomas (PragDave)
The Northern Virginia Ruby Users Group (NoVARUG) will be holding their next meeting next week with a special speaker in Dave Thomas (PragDave). Dave is in town teaching Advanced Rails Studio in Reston and will be kind enough to come talk about the Ruby Object model and how it facilitates metaprogramming.
The details are as follows:
Subject:
Dave Thomas - The Ruby Object Model and Metaprogramming
Date:
April 16th, 2008 - 7-9PM
Location:
FGM Inc
12021 Sunset Hills Road
Suite 400
Reston, VA 20190
Hope to see a good crowd there! I know I'm very interested in this subject and hope to dive deeper soon. That reminds me I need to do some of metaprogramming in F# as well.
-
Unity 1.0 Released into the Wild
As Chris Tavares mentioned in his blog, Unity 1.0 has been released a couple of days earlier than the April 7th release date mentioned by Grigori Melnik earlier. Scott Densmore also announced this as well as working on porting the inteception from ObjectBuilder2 which I talked about earlier in some of my Unity and IoC containers posts. Looking forward to that post as we've shared some emails on the subject.
Would You Like To Know More?
For those looking for my posts on the matter, I've covered it quite extensively with the comparison to other IoC containers as well as IoC containers in general:
- IoC and Unity - Configuration Changes for the Better
Covers the latest configuration changes to allow for better constructor injection
- IoC and Unity - The Basics and Inteception
Covers the basics of an IoC container and inteception techniques
- IoC Container, Unity and Breaking Changes Galore
Covers the breaking changes made from the old Unity drop to the new one
- IoC Containers, Unity and ObjectBuilder2 - The Saga Continues
Managing instances and parameter mapping resolution
- IoC and the Unity Application Block Once Again
Setter Injection versus Constructor Injection and PostSharp4Unity
- IoC and the Unity Application Block - Going Deeper
Constructor Injection and comparing Unity with Castle Windsor
- IoC and the Unity Application Block
Covering ObjectBuilder and Unity Application Block
Anyhow, if interesting in more Unity content, check out David Hayden's Unity IoC and MVC screencast as well as others on the subject here.
Speaking of which, I'm going to be a busy man indeed with my upcoming speaking schedule on IoC containers, not necessarily Unity in particular, but all of them, the background and decoupling your applications. Here is the complete schedule for this month:
- RockNUG - April 9th
- CMAP Code Camp - April 12th
- CMAP Architecture SIG - April 15th
- IoC and Unity - Configuration Changes for the Better
-
Relooking at xUnit.net RC2
using MVC_APPLICATION_NAMESPACE.Controllers; // This using directive needs to point to the namespace of your MVC project
-
Adventures in F# - F# 101 Part 7 (Creating Types)
#light
let coin = "heads", "tails"
let c1, _ = coin
let _, c2 = coin
print_string c1
print_string c2 -
Covering NUnit 2.4.7
#light
#R @"D:\Program Files\NUnit 2.4.7\bin\nunit.core.dll"
#R @"D:\Program Files\NUnit 2.4.7\bin\nunit.framework.dll"
open NUnit.Framework
let rec fib n =
match n with
| 0 | 1 -> 0
| n -> fib(n-2) + fib(n-1)
| n when n < 0 -> failwith "Cannot be less than zero"
[<TestFixture>]
let FibOfOneShouldReturnZero() =
let fibResult = fib(1)
Assert.AreEqual(fibResult, 0)
-
xUnit.net RC2 Released
public class DatabaseFixture : IDisposable
-
Understanding AOP in .NET
In my previous posts I have talked a bit about Inversion of Control (IoC) containers with respect to Interception and Aspect Oriented Programming (AOP). It's not only important to understand the uses and strategies for implementing your solutions using it, but also how interception and AOP works deep down in .NET. Instead of a long, drawn out post, I think I'll just include some articles and posts that do a very good job of explaining some of the ideas behind it.
Articles and Posts
I think it'd be good if we just start out with some basic MSDN articles and such regarding AOP and interception. Some of them may be older but the concepts will still apply to this day:
- 7 Approaches for AOP in .NET
Ayende covers a few ways of doing AOP in .NET using existing frameworks
- Decouple Components by Injecting Custom Services into Your Object's Interception Chain
Juval Lowy, in the March 2003 MSDN magazine, writes about using contexts for an object's execution scope and intercepting calls to and from that object.
- Aspect Oriented Programming (September 2005 Technical article)
Matthew Deiters describes aspect oriented programming and covers joinpoints, pointcuts, advice and mixins with regards to a simple example using VB.NET.
- AOP: Apsect Oriented Programming Enables Better Code Encapsulation and Reuse
Dharma Shukla, Simon Fell and Chris Sells write in the March 2002 MSDN Magazine with regards to the history to COM and AOP and then relate how it works in .NET. Rather dated article but the foundations still apply.
- AOP using System.Reflection.Emit
Roberto Loreto writes on CodeProject how to intercept method calls of an external type and generating method proxies by using Intermediate Language (IL) injection.
Just Read the Code
There are many AOP frameworks out there in the wild right now for .NET. To understand them pretty well, it's best if you just crack open the code and follow the unit tests. Most of these are no longer active. Let's cover some of the AOP frameworks out there:
- PostSharp
- NKalore (No longer active)
- Gripper LOOM.NET
- Rapier LOOM.NET
- AOP.NET (No longer active)
- Aspect# (No longer active)
- AspectDNG
Conclusion
For those willing and able to go ahead and learn about AOP, it's actually quite interesting. it's also quite a challenge especially when dealing with IL emitting. Go ahead and look at the source code and samples and give some of it a try. Next time we pick up, I'll be talking about AOP in the Enterprise and Spring.NET. Until next time...
- 7 Approaches for AOP in .NET
-
IoC and Unity - Configuration Changes for the Better
namespace UnitySamples
-
FringeDC March 2008 Video Now Online - Haskell and XMonad Extensibility
As I've discussed before with my dive into functional programming and F#, there is a user group of language geeks that specialize in Haskell, Lisp, Scheme, OCaml, Erlang and so on, within the Washington DC area called FringeDC. Brent Yorgey, well known in the Haskell community and contributor to XMonad, presented an introduction to Haskell and explained a bit about extending XMonad. Fortunately for those who couldn't attend like myself due to scheduling conflicts, Conrad Barski recorded this session and posted it to Google Video. The slides have also been made available as well here. For those not aware of XMonad, it's a tiling window manager for X that is extensible in Haskell. Unfortunately, the opening talk by Philip Fominykh on The Zipper, a purely functional data structure in Haskell for manipulating the location of structure instead of the data, was not recorded.
If you want to get your language geek on, come check it out for their next informal meeting on May 10th over a beer or two. More details on the site here. Until next time...