Hi,
My situation is essentially this: I have a class called Foo which has dependencies A and B, all of which are internal to a library. Instances of Foo will be created by user of the library, and they should not require knowledge of the dependencies.
Internally of course I would like Foo to remain decoupled from the concrete implementations of A and B. I had considered a simple static factory class, however it would be necessary to configure this somehow for the dependencies (say Factory::$_staticAttr = x) and this seems wrong as it would essentially mean my static class has a state.
I've also been thinking some XML or otherwise configured dependency injection container, however it then raises the question of how to make the configured DIC's instance accessible without something messy like having it in a registry object.
I'm striving for some trivial method for the end user to generate an instance of Foo with everything injected, while keeping all the details of dependencies etc hidden within the library.
I've read around and the solution has not really made itself obviously to me as yet, so I'd appreciate any input :).
Thanks in advance, James