I have been reading up on DI and it seems like a simple enough concept. What I don't get is the container. Let’s say for a moment that I want to create my own container. Verbs like "detect" are used and I don't get how the container "detects" that a new dependent object was created and know to inject it's dependencies. To me it seems like the container is a glorified factory.
Can any one explain how a container is actually implemented, or maybe point me to a resource?
Thank you!
This is taken from Windsor documentation
You might wanna read this book Dependency Injection In .NET... I have already read it, and I strongly recommend you reading it. It first gives a nice and insightful explanation on DI then shows code and patterns about real world applications of DI.
From this book, and in too few words...