Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm looking to start a new application and I want to use Dependency Injection. I have a lot of "Microsoft is the only way to go guys" in our shop so of course Unity is the way they wanted to go. However I am leaning more towards Autfac because of its speed and its Module feature. I found the speed results on this page.

If you use Autofac or Unity can you give me some solid reasons not to use Unity and to use Autofac over Unity? If not, can you point me into a good direction to do some research on bringing back to our next meeting?

share|improve this question
3  
Because you haven't heard of StructureMap? –  Mike Brown Mar 29 '11 at 14:59
    
Once you've got used to the power that something like StructureMap provides, Unity seems pretty pathetic. Unfortunately, I've been suck (for "its from MS" reasons) using Unity for 2 years. Yuck. –  Simon Mar 13 '12 at 16:13

2 Answers 2

up vote 4 down vote accepted

I think speed is a red herring here -- if the speed of your IoC container is make or break for your project, you probably should not be using an IoC container in the first place. Moreover, these days most containers are so close in terms of features there really isn't a difference there -- unless there is something very specific you need out of it and only one option is capable of handling that. Best way to decide is experience -- if anyone has successfully implemented something non-trivial using IoC, I'd run with that one as the devil is in the details and you will have funny bugs that require some intimate knowledge of the way your IoC functions.

share|improve this answer

I doubt you will get any solid reasons on why to use one over the other; it comes down to opinion, warm fuzzy feelings, etc...

The performance measurements you linked to are certainly data points but the argument is moot. Performance across the board is close enough to not warrant that as a consideration when choosing the framework; which was noted in your linked to article.

My conclusion is the same as after the first test, the performance difference is not significant to warrant consideration when choosing a IoC container. Unless you create a incredibly large amount of transient components (not recommended), then maybe use Autofac...

I currently use Unity within Prism and have enjoyed it thus far. It too has a module component as well as other application blocks you can leverage. Perhaps you should give Prism a look as it may contain other components which you may want to leverage downstream.

In addition Prism has a large community around it; which is always beneficial in understanding the framework and getting assistance when needed.

share|improve this answer
    
Thanks, I took a look at Prism and looks cool, if we go this way I will dig deep into that. –  Mark Mar 29 '11 at 19:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.