Hi all,

The delegate lookup feature of Container Interop didn't get as much 
attention as I feel it deserves. Specifically, it is lacking formalization 
in PHP - an interface. I started this conversation , but was instructed 
that the mailing list is the better way to go.
It seems that many would agree with me in that it would be great to have 
the standard backed by an interface. There was talk of an interface 
<https://github.com/container-interop/container-interop/pull/8>, but the 
idea was shot down due to forcing the implementation to declare a setter. I 
completely agree that forcing a setter is a bad idea.
*But why not a getter?*

* <https://github.com/XedinUnknown/di>*
*XedinUnknown/di <https://github.com/XedinUnknown/di>* is an example of an 
implementation that would achieve lookup delegation while depending on one 
method of one interface. The rest is implementation details.
In short, the container that wishes to delegate must pass its parent (or, 
in my implementation, the "root" parent), if set, to the service definition 
callable. If the callable is a composite container, it will forward the 
call to the first child container that contains the definition. Please find 
a more expanded description in the repo's Readme.

Looking forward to your comments, questions, or suggestions.

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/0120b7be-bffc-4778-a42a-4eff7fb528db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to