Which Dependency Injection Tool Should I Use? [clo

2020-01-26 21:09发布

I am thinking about using Microsoft Unity for my Dependency Injection tool in our User Interface.

Our Middle Tier already uses Castle Windsor, but I am thinking I should stick with Microsoft.

Does anyone have any thoughts about what the best Dependency Injection tool is?

10条回答
欢心
2楼-- · 2020-01-26 21:45

Unless you already have experience and a personal preferance for a particular sub-technology utilized by one of the possible IoC container solutions, they all function well and I don't see any one in particular with a "killer function" that makes it stand out from the others. Unity is probably the best fit for solutions already utilizing the P&P Enterprise Library 4.x...

查看更多
欢心
3楼-- · 2020-01-26 21:47

IoC Container Benchmark - Performance comparison has performance and features comparison tables for 20+ products and keep them up-to-date.

The conclusion from the article:

SimpleInjector, Hiro, Funq, Munq and Dynamo offer the best performance, they are extremely fast. Give them a try!

Especially Simple Injector seems to be a good choice. It's very fast, has a good documentation and also supports advanced scenarios like interception and generic decorators.

查看更多
甜甜的少女心
4楼-- · 2020-01-26 21:52

I started using Autofac a year ago and haven't looked back since..

查看更多
家丑人穷心不美
5楼-- · 2020-01-26 21:55

I'm an Autofac fan, but both Windsor and Unity will do a good job (though Windsor is more capable than unity and doesn't require attributing your code). There's plenty of good non technical reasons for sticking to a single container in a system though.

查看更多
登录 后发表回答