I plan on digging into one of the open source IoC containers to really figure this out 100%, but I figured I would ask the general community also (after not being able to find a direct answer in any of the closely related questions).
As far as I understand the typical IoC implementation, it seems that it is a global class that acts as a singleton with a knowledge of all dependencies. It then uses that knowledge to supply constructor or property parameters where it knows how to fill them in? Maybe I am missing something, thus the question.
Can somebody definitively tell me how IoC works and/or if it is a singleton at its root?
UPDATE
I guess my question would be how do “magic” IoC things work like Ninject.MVC? Where the injection “just works”?
OK, after browsing even further online and talking to a co-worker, I believe that there is no way to implement IoC (at least in a stateful program..winforms/wpf) without it being a static singleton. So, I plan on using the Composition Root pattern and use the ninject kernel as a static singleton in a Service Locator way. I will still be calling kernel.Get, but I guess I at least lose the care for the dependencies within that item. I was just running myself in circles :).
Something like this:
If somebody knows a better way, then please let me know. Otherwise, this is what I have pieced together as the best way to do this.