I am new to this IoC and DI business. I feel like I understand the concept if you are passing through objects that have a global scope, but I donβt understand how this works when you need to go through an object that has a specific logical state. So, for example, if I wanted to insert a human object into a command object of a recording file, how would I dynamically select the correct human object? From what I saw, I could build an object by default, but my disconnect is that you will not use the default object for a person, it must be dynamic. I suppose that an IoC container might just maintain the state of an object for you as it goes through, but then that means that you are dealing with only one person, because there would be no thread safety, would it? I know that I have something missing (maybe something like a factory class), but I need a little more information on how this will work.
dependency-injection ioc-container
mytwocents
source share