lazy-container icon indicating copy to clipboard operation
lazy-container copied to clipboard

Support lazy-loading of internal dependencies

Open Ocramius opened this issue 9 years ago • 1 comments

This might be a really hard one to solve, but the idea is simple: lazy services are not necessarily the front-facing services inside your app.

Let's say you have a class:

class MyService
{
    public function __construct(SomethingSlow $iWantThisToBeLazy) {}
}

This kind of container currently only allows MyService to be fetched lazily, but doesn't allow the internal dependency to SomethingSlow to be replaced with a lazy instance.

This problem may not be solvable by the lib as-is, but it is a good scope for research, and it may spawn into further development of the container-interop standard.

Ocramius avatar Apr 12 '16 20:04 Ocramius

👍 I will write test for that

snapshotpl avatar Apr 14 '16 07:04 snapshotpl