Reputation: 38228
I have read this 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 ?
Upvotes: 0
Views: 540
Reputation: 241779
Here: Building an IoC container in 15 lines of code and Dependency Injection doesn't cut it anymore.
Upvotes: 2
Reputation: 4842
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.
Upvotes: 1