I am attempting to implement my own Container and have some questions about Inversion of Control patterns. I am attempting to create a Container that manages a single component type at a time. The contained components may be associated with other components held within other container instances. The Container should be responsible for resolving these dependencies within the ServiceManager for the component. Correct so far?
Now, the Container is also a component with associations to other components. Is it violating IOC if the Container-associated components are made available to the child components not within the ServiceManager but within the Context? After all, the Container-associated components are implicit services to the Contained components and therefore should not need to be declared as a dependency. What this really means that a child Context has indirect access to the contents of its parent's ServiceManager. Does this seem reasonable or am I missing the boat somewhere? I think a component's ServiceManager should only provide peer relationships and components related to a component's Container should be part of a component's Context. Any thoughts?