tags:

views:

52

answers:

3

I have read this http://stackoverflow.com/questions/386535/code-your-own-ioc-container and searched the internet on creating an own ioc container. I don't understand any of the "simple" examples because it's flooded with jargons (why use "resolve" instead of just create method ?) and none shows an example without ioc and refactor it to iOC.

So can someone does something like that in less than 50 lines of code if possible ?

+1  A: 

Maybe you should read this article: http://martinfowler.com/articles/injection.html

ika
Martin Fowler is good. If only it wasn't in java I can write better c#
also it uses http://www.picocontainer.org/. I want to CREATE one not use one even small one.
+1  A: 

My suggestion is - don't build your own.

There are literally dozens of lightweight and popular containers out there with lots of support. If you build it yourself, you support it yourself. Personally I find Microsoft Unity more than enough for most of my needs, it's supported in both .NET and Silverlight, and quite importantly it's got "Microsoft" in front of it to make management happy.

Doobi
I want to REALLY understand a concept before using any framework that uses it.
@user310291: You don't have to build one to understand it.
Jason
+2  A: 

Here: Building an IoC container in 15 lines of code and Dependency Injection doesn't cut it anymore.

Jason
This would be great if the author would have shown the same example without IOC because I don't grasp it.