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:
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 Łukasz Budnik, author and DZone MVB. (source)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.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)




