Amr Elgarhy
Amr Elgarhy

Reputation: 68912

What are benefits of using a third party dependency injection container over using the one i built?

I Built an IoC container long time ago while watching this show http://www.dnrtv.com/default.aspx?showNum=126 few months ago, and did a small sample using it, and was working fine.

Now I am using unity as a dependency injection container in a project I am starting, and also tried NInject in a previous small MVC website.

But I am now asking my self, what these containers benefits over the one I created from the show, I just can see that it load from the config file, which I can do in mine, is there something else I am missing? I just want some one to tell me you must use these containers because of 1, 2 , 3 reasons which is better than yours.

Upvotes: 3

Views: 285

Answers (2)

OJ.
OJ.

Reputation: 29401

Other IoC containers would:

  • be more mature and most probably less buggy
  • have better performance
  • be maintained by someone else
  • have more features covering more scenarios than you would originally think of
  • have integration with other frameworks out of the box (such as MVC, WCF, etc)
  • have a community discussing the problems and how to get around them

With your own, you'd be a LONG way behind, and wouldn't have the support of all the things mentioned above.

If you're aiming to build something that competes with the players already out there (such as Autofac, Ninject, Unity, etc) then make that your product.

Upvotes: 4

Oded
Oded

Reputation: 499002

First off, these containers are widely used, hence well tested in real world situations - I don't know about yours.

They are also well documented and familiar to many developers, so if working in a team, there is no need to teach others about yours.

Some containers offer fluent configuration (that is, configuration in code), this gives you type safety during compile time vs run time.

However, if your container works for you and there are no other developers involved, why change?

Upvotes: 7

Related Questions