4
votes

I have been developing a new MVVM framework here.

It has some interesting concepts, but I'd like to support multiple IoC containers. Right now I'm supporting just MEF, because it comes with .Net 4.0.

What are some of the more common IoC/DI frameworks I should look into supporting from the start? I'm thinking maybe 3 or so.

Castle Windsor? Ninject?

EDIT:

Just to clarify, I'm asking which IoC/DI frameworks are commonly used today. I was hoping to also learn of some of the new hotness that's out there and I've not heard of yet.

3
How do you support them? Have you looked at CommonServiceLocator? Or my docs.griffinframework.net/specificationjgauffin
I haven't worked out the how yet. I was considering abstracting that out myself, but I'll check out your link.jonathanpeppers
Look at the way ASP.NET MVC uses a DI container: it does not. It has a DefaultControllerFactory implementation that works with Activator.CreateInstance and it is very easy to plug in your own controller factory that works with your own DI container.Steven
Yes, that's what I want to do. I want to provide a MEFFactory, WindsorFactory, NinjectFactory, etc. What are some commonly used containers I can support out of the box? (This is what my question is asking)jonathanpeppers

3 Answers

4
votes

Unity and Castle Windsor should be a must in my opinion, especially Unity since it's used in Prism and it is part of the Enterprise Library (for portability). And Castle windsor for its easy of use (for a broader community)

12
votes

A library or framework should not use a DI Container - only applications should use containers.

Libraries and frameworks should be designed so that they are friendly to any sort of DI, whether or not the user wants to use a container or Poor Man's DI.

Assume that the user will be using Poor Man's DI and you will automatically be container agnostic.

0
votes

An alternative would be to provide a simple IoC Container just like Mvvm Light does.