<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Andrey Shchekin's Blog - Latest Comments in Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://ashmind.disqus.com/</link><description></description><language>en</language><lastBuildDate>Tue, 30 Dec 2008 19:02:18 -0000</lastBuildDate><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-4789385</link><description>Fantastic comparison. Thanks for sharing</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pavan Kulkarni</dc:creator><pubDate>Tue, 30 Dec 2008 19:02:18 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-4332046</link><description>Really like the overview and nice comparison too!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dewaji</dc:creator><pubDate>Thu, 11 Dec 2008 14:22:23 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2982644</link><description>Great review!  This is exactly what I was looking for to help clear things up for me.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric J. Smith</dc:creator><pubDate>Fri, 10 Oct 2008 12:24:10 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2622911</link><description>Good review, thanks for taking the time to do it.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Colin Jack</dc:creator><pubDate>Thu, 25 Sep 2008 05:26:16 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2621226</link><description>The use case is to create a factory which registers several factory-specific components without polluting the original container with these components and their local scope dependencies (such as connection data). I describe the problem in detail at  &lt;a href="http://blog.ashmind.com/index.php/2008/06/23/di-framework-challenges-1-simple-factories/" rel="nofollow"&gt;http://blog.ashmind.com/index.php/2008/06/23/di...&lt;/a&gt; .&lt;br&gt;&lt;br&gt;So, if I can create a container in place and then throw it away, it also solves the pollution problem.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Thu, 25 Sep 2008 02:29:47 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2589469</link><description>On IService[] - point taken, issue raised. In the meantime you can do:&lt;br&gt;&lt;br&gt;builder.Register(c =&amp;gt; c.Resolve&amp;lt;IEnumerable&amp;lt;X&amp;gt;&amp;gt;().ToArray());&lt;br&gt;&lt;br&gt;..in order to adapt the default collection type onto an array type.&lt;br&gt;&lt;br&gt;I'll look into the non-generic collection registrations - may look into that in the future if there is demand.&lt;br&gt;&lt;br&gt;Thanks for the feedback!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nicholas Blumhardt</dc:creator><pubDate>Wed, 24 Sep 2008 23:29:51 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2578161</link><description>The net effect is almost the same. RegisterTypesMatching() and RegisterTypesAssignableTo() are lazy - there is no scan of loaded assemblies, for instance.&lt;br&gt;&lt;br&gt;You could always create an extension method ResolveUnregistered() which could check/register first, too.&lt;br&gt;&lt;br&gt;Not sure what you mean about hierarchical containers relating to this use case - can you clarify a little?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nicholas Blumhardt</dc:creator><pubDate>Wed, 24 Sep 2008 17:12:26 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2541361</link><description>Definitely not all, I think I'll add a test for that at some point.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Tue, 23 Sep 2008 10:28:36 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2539357</link><description>Nice comparison! I didn't know that there where so many IoC frameworks :)&lt;br&gt;&lt;br&gt;Do you know if all containers support registering services/components at any given time?&lt;br&gt;I know Castle can do that, i'm abusing it a bit in my current project.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">alwin</dc:creator><pubDate>Tue, 23 Sep 2008 06:43:11 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2539227</link><description>Sure, I like the second approach much more.&lt;br&gt;&lt;br&gt;By the way, is it possible to resolve unregistered types in Autofac?&lt;br&gt;I do not feel that is very important, given hierarchical containers, but I am still interested.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Tue, 23 Sep 2008 06:11:07 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2539207</link><description>Thanks!&lt;br&gt;&lt;br&gt;You have a very interesting implementation.&lt;br&gt;I would prefer to have an automatic registration by default, since if I get into situation where I would need more than one ILogger collection, I would probably use some kind of contextual override for a requiring component anyway. But it is a question of preference.&lt;br&gt;&lt;br&gt;There are only two things that I feel are missing in your implementation -- support for IService[] (since it is simplest way to define collection dependency) and and ability to register collections using non-generic API.&lt;br&gt;&lt;br&gt;Due to the first one, I can not update tests to pass right now, however, I had fixed the chart and will fix the post text as well.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Tue, 23 Sep 2008 06:07:50 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2525027</link><description>Cool, great work!&lt;br&gt;&lt;br&gt;I think I can't update in-post chart, since it'll require me to update post text as well, and that would mean I have to consider and mention all other framework updates.&lt;br&gt;I am looking for a way to keep an up-to-date version of charts at the net-ioc-frameworks page of Google Code, I hope to do it soon enough.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Mon, 22 Sep 2008 16:50:55 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2520137</link><description>Aaah - and regarding automatic registration - you can always do:&lt;br&gt;&lt;br&gt;builder.RegisterTypesAssignableTo&amp;lt;object&amp;gt;();&lt;br&gt;&lt;br&gt;:) Not really recommendable though.&lt;br&gt;&lt;br&gt;I recently ported some Prism code from Unity to Autofac, and used something similar to:&lt;br&gt;&lt;br&gt;builder.RegisterTypesMatching(t =&amp;gt; t.Name.EndsWith("View"));&lt;br&gt;&lt;br&gt;--- just to illustrate that there is no need to use tagging interfaces or inheritance in order to work with this feature.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nicholas Blumhardt</dc:creator><pubDate>Mon, 22 Sep 2008 10:42:40 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2520060</link><description>Hi Andrey,&lt;br&gt;&lt;br&gt;Wow! It is very interesting to see a methodical approach to this comparison.&lt;br&gt;&lt;br&gt;Autofac does also support list registrations - but like 'resolve anything' you have to opt-in. See: &lt;a href="http://code.google.com/p/autofac/wiki/Collections" rel="nofollow"&gt;http://code.google.com/p/autofac/wiki/Collections&lt;/a&gt;.&lt;br&gt;&lt;br&gt;As you've hinted at - like most containers you can change this behaviour by writing custom extensions. In general, you'll find Autofac is very conservative about working absolutely predictably by default.&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;&lt;br&gt;Nick</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nicholas Blumhardt</dc:creator><pubDate>Mon, 22 Sep 2008 10:36:11 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2515363</link><description>Hi Andrey,&lt;br&gt;&lt;br&gt;If you take a look at the updated version of your test project, you'll notice that LinFu passes every test in both "MustHave" and "ShouldHave" categories--all from an assembly that is only about 94KB in size! :)&lt;br&gt;&lt;br&gt;If you can, please update your charts accordingly. Thanks!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philip Laureano</dc:creator><pubDate>Mon, 22 Sep 2008 02:34:52 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2506115</link><description>Good idea! I supposed that all frameworks that support list injection for constructors support them for properties as well.&lt;br&gt;But documenting assumptions this in a testable way is always a good idea. I'll do this.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Sun, 21 Sep 2008 05:39:20 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2506100</link><description>Thanks, Andrey! I went ahead and added the LinFuAdapter to the test suite.&lt;br&gt;&lt;br&gt;Btw, you might want to add property service list injection as one of the "should haves" for IoC container features. For example, if I have a service instance with a property such as:&lt;br&gt;&lt;br&gt;[SomeCustomPropertyInjectionAttribute] // This differs with every IoC container&lt;br&gt;public ISomeServices[] MyServices { get; set; }&lt;br&gt;&lt;br&gt;It would be nice to have the container automatically instantiate the existing list of ISomeService instances from the container and inject it to the MyServices property. What do you think?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philip Laureano</dc:creator><pubDate>Sun, 21 Sep 2008 05:35:47 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2506088</link><description>Sure, it's a thing I forgot to do correctly.&lt;br&gt;There is already a Create&amp;lt;T&amp;gt; method in the IFrameworkAdapter, but test did not use it.&lt;br&gt;I have just modified the test to use Create&amp;lt;T&amp;gt; instead of Resolve&amp;lt;T&amp;gt;.&lt;br&gt;&lt;br&gt;So get the latest version, then implement Create&amp;lt;T&amp;gt; using AutoCreate.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Sun, 21 Sep 2008 05:31:09 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2505974</link><description>&lt;i&gt;Unregistered Resolution is an ability to reuse container resolution logic for a given concrete type, without polluting the container itself with this type.&lt;/i&gt;&lt;br&gt;&lt;br&gt;Ahh, I see! Now that you've mentioned it, LinFu *does* support unregistered resolution, but its not implemented quite the same way as other contains would implement it. For example, if I had an unregistered class like:&lt;br&gt;&lt;br&gt;public class MyClass&lt;br&gt;{&lt;br&gt;     public MyClass(ISomeService service) &lt;br&gt;     {&lt;br&gt;         // ...&lt;br&gt;     }&lt;br&gt;}&lt;br&gt;&lt;br&gt;You can create the unregistered class in LinFu using the following code:&lt;br&gt;&lt;br&gt;// ...construct the container somewhere here&lt;br&gt;container.AddService&amp;lt;ISomeService&amp;gt;(new SomeService());&lt;br&gt;var myClass = (MyClass)container.AutoCreate(typeof(MyClass);&lt;br&gt;&lt;br&gt;Now the tricky part here is that I've been running LinFu through your battery of tests, and I can't seem to get it to pass the UnregisteredResolution test. Is there anyway to modify the logic so that each library has a way to implement their own unregistered resolution? Clumping it all under a single Adapter.Resolve() call doesn't seem to apply, in this case.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philip Laureano</dc:creator><pubDate>Sun, 21 Sep 2008 04:42:03 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2452339</link><description>Unregistered Resolution is an ability to reuse container resolution logic for a given concrete type, without polluting the container itself with this type.&lt;br&gt;It is very useful when framework also provides support for additional arguments -- then I can easily build a factory that reuses container dependency resolution.&lt;br&gt;See &lt;a href="http://blog.ashmind.com/index.php/2008/06/23/di-framework-challenges-1-simple-factories/" rel="nofollow"&gt;http://blog.ashmind.com/index.php/2008/06/23/di...&lt;/a&gt; for an example.&lt;br&gt;&lt;br&gt;I think other solution is to create a quick throwable-out child container like autofac provides, but I have not tried this yet (sounds like a much less performant solution).&lt;br&gt;&lt;br&gt;I have added you as a project member to the net-ioc-frameworks, so you now probably have access to upload LinFu adapter.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Sat, 20 Sep 2008 07:11:51 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2439469</link><description>Btw, what exactly is Unregistered Resolution? Is that the ability to arbitrarily return services from concrete types not registered in the container?&lt;br&gt;&lt;br&gt;I've been working on my own container (LinFu.IoC 2.0) and it passes all of the 'MustHave' tests, but I can't seem to figure out what the intent was behind the Unregistered Resolution feature. &lt;br&gt;&lt;br&gt;What makes it interesting is that I can even determine which services exist inside the container and I can instantiate them all at once, like so:&lt;br&gt;&lt;br&gt;// Instantiate all named services of type 'IMyService'&lt;br&gt;var services = from info in container.AvailableServices&lt;br&gt;                       where info.Name.Length &amp;gt; 0 &amp;&amp; &lt;br&gt;                       info.ServiceType == typeof(IMyService)&lt;br&gt;                       select container.GetService(info) as IMyService;&lt;br&gt;&lt;br&gt;You can check it out here:&lt;br&gt;&lt;br&gt;&lt;a href="http://code.google.com/p/linfu/wiki/BuildingLinFu2" rel="nofollow"&gt;http://code.google.com/p/linfu/wiki/BuildingLinFu2&lt;/a&gt;&lt;br&gt;&lt;br&gt;Right now, it's still under development, but I'm only two features away from making it available for production usage. Take a look! :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philip Laureano</dc:creator><pubDate>Fri, 19 Sep 2008 07:35:33 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2358647</link><description>Thanks. I thought the test adapters I did are too raw to be very useful -- no fluent interface, and probably not all basic features covered.&lt;br&gt;However it would be nice if it actually helps you.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Mon, 15 Sep 2008 09:15:00 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2353627</link><description>Great work!&lt;br&gt;&lt;br&gt;Btw, do you realize what you've just done? About a month ago, Jeremy Miller talked about an IOC container detente and how there should be a common interface among IoC frameworks:&lt;br&gt;&lt;br&gt;&lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/08/16/it-s-time-for-ioc-container-detente.aspx" rel="nofollow"&gt;http://codebetter.com/blogs/jeremy.miller/archi...&lt;/a&gt;&lt;br&gt;&lt;br&gt;I know you wrote the IOC adapters in your test project so that you can test the various IoC frameworks, but what you've effectively done here is unify the more common IoC frameworks under one set of interfaces! &lt;br&gt;&lt;br&gt;In theory, I could easily swap to and from any one of those frameworks without having to worry about which IoC container I'm actually using. Again, awesome job!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philip Laureano</dc:creator><pubDate>Sun, 14 Sep 2008 19:19:54 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2325126</link><description>Another great summary. Unity will have list injection (well, array injection specifically) in version 1.2. We're releasing the preview drop of this feature early next week.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Tavares</dc:creator><pubDate>Sat, 13 Sep 2008 01:56:59 -0000</pubDate></item><item><title>Re: Comparing .NET DI (IoC) Frameworks, Part 2</title><link>http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2/#comment-2303131</link><description>I have just fixed all relevant parts of the post.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmind</dc:creator><pubDate>Fri, 12 Sep 2008 12:28:56 -0000</pubDate></item></channel></rss>