Platinum Partner
dotnet,spring.net,.net & windows,ninject,ms unity

Spring.NET Superiority Over MS Unity and Ninject

I'm evaluating .NET-related technologies for the purpose of my latest project (desktop application for processing radiological and pathological images). Today I played with MS Unity and Ninject.

I was quite surprised that either MS Unity nor Ninject are unable to handle bi-directional references, like these:
class A
{
   B B { get; set; }
}

class B 
{
   A A { get; set; }
}
Both MS Unity and Ninject enter infinite loop (create default constructor and set a break point there).

Spring.NET resolves dependencies without any problems. A huge plus for Spring.NET.

cheers,
Łukasz

p.s.
In case someone would argue why I use bi-directional references: it's a desktop application where implementing MVC/MVP requires view to have a reference to controller/presenter and controller/presenter to have a reference to view.

p.s.2
I used latest versions of Unity and Ninject available in NuGet.

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}