Arguments against Inversion of Control containers

There are certainly people who think that DI Containers add no benefit, and the question is valid. If you look at it purely from an object composition angle, the benefit of a container may seem negligible. Any third party can connect loosely coupled components. However, once you move beyond toy scenarios you should realize that … Read more

Proper Hub dependency lifetime management for SignalR and Castle Windsor

I’ve had a bit similar problem but with Unity instead of Castle Windsor. My requirements: I wanted to avoid singleton registrations on the container. All objects are resolved in Hub and should be disposed on Hub destruction. Registrations reused across Web Api and SignalR. Object lifetime is managed by HierarchicalLifetimeManager – child containers resolve and … Read more

MEF vs. any IoC

When boiled down, the main difference is that IoC containers are generally most useful with static dependencies (known at compile-time), and MEF is generally most useful with dynamic dependencies (known only at run-time). As such, they are both composition engines, but the emphasis is very different for each pattern. Design decisions thus vary wildly, as … Read more