July 29, 2008
@ 01:28 PM

The type name that you need to use in config files, such as for IoC containers, can be quite complex. For me, it's easier just to spike them than to try to remember the format gobbledy-gook.

public class GenericsTypeSpikes
{
    [Fact]
    public void The_name_of_a_complex_type_can_be_found_in_Type_AssemblyQualifiedName()
    {
        Type t = typeof(IList<ISource>);

        Assert.Equal("System.Collections.Generic.IList`1[[Blah.Core.ISource, Blah.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", t.AssemblyQualifiedName);
    }
}

 
Kick it! Digg it!  Categories: .NET Framework | IoC

February 20, 2008
@ 06:27 PM

As I've said before, my organization does an awful lot of SharePoint work.  Since button-pushing really isn't my thing, I've got only a few options when it comes to coding most SharePoint projects:

I've started to duplicate this blog on our internal MOSS server, and there's something that I've missed about dasBlog that's not available in WSS or MOSS blogs - Tag Clouds.  That sounds like a good place to get my feet wet in Web Part development.  I know that there are already several web parts available that provide tag clouds for MOSS, but of course, they're "not invented here".  No, seriously, this is purely for my own educational purposes, so even if I do provide a solution to the general public, there's certainly no assumption that it would be any better than what's already available.  This project will let me explore several interesting technologies:

Technorati Tags: ,,

 
Kick it! Digg it!  Categories: Agile | Automated Testing | IoC | MOSS | SharePoint

February 20, 2008
@ 02:41 PM

I'm not dissing MS Unity, Microsoft's new IoC Container - I'm really going to give it a chance.  Rather, I'm talking about the reaction to it on the Yahoo! [altdotnet] group.

I have just spent most of the morning following a thread on the [altdotnet] mailing list titled "Unity" Ioc from Microsoft has been released in CTP...  And it has.  But in retrospect, based on the thread, "Unity" was a very ironic name choice for the tool.  This is a very long thread that is involving dozens of folks.  It started off by comparing the functionality in Unity to functionality in other IoC containers, mostly Castle Windsor & StructureMap.  The Spring.NET crowd has been strangely silent.

Later in the thread, however, the "altdotnet"ness of the list has begun to show its colors. Passions have arisen and tempered.  Staunch defenders of each "side" (and there are more than two sides to this polygon) have held their ground while alternately being gracious one minute and on-the-attack the next.  It's the ultimate Reality TV... except that it's not TV, of course.

I've wasted too much time trying to follow this thread and I declare that I am DONE with it.  Not that the task wasn't worth it.  I've learned a lot about IoC that I hadn't know before.  I'm familiar with Windsor, and I've downloaded Unity and played around with it as well.  The really great gem that I have just discovered is StructureMap.  I just love the "fluent interface" it has - much like is available in Rhino.Mocks.  Fun, geeky stuff.

I thought it would be a useful exercise to compare "Hello, World!" scenarios between the big-four (and, yes, I'm including Unity as part of that):

Function Castle Windsor StructureMap Unity Spring.NET

Putting an interface and concrete type into the IoC container

WindsorContainer. AddComponent() StructureMapConfiguration. BuildInstancesOf(). TheDefaultIsConcreteType() UnityContainer. Register() N/A - Spring doesn't support XMLless config (that I could find).  Those Java guys just have a love affair with XML, I guess
Getting a concrete type for a given interface Resolve() ObjectFactory. GetInstance() UnityContainer. Get()
Default items are Singleton separate instance separate instances

The fluent-interface of StructureMap is so nice.  Yes, it's longer to type, but hey, that's what IntelliSense is fore, and that will make it easier for new developers to discover.

Incidentally, Unity looks an awful lot like Windsor in its syntax, and it was mentioned in the aforementioned thread that the PM on the Unity project is a big Windsor fan.

Apology: I just couldn't resist the lolcats thing, it was just too apropos.  This is my one (1), lifetime, self-imposed limit.