Closed hoesler closed 6 years ago
Cool! I'll take a closer look at this soon, and see how I want to incorporate it.
@Sam-Burns have you taken a look at this yet? What do you think?
@hoesler Mind, providing a usage example?
Hi, thanks for considering my proposal. Basically, the ContainerChain has the same use cases as the CompositeContainer, don't you think.
This similar to a composite container, but uses a chain-of-reponsibility pattern to implement composition. Why? The main benefit is that it's not using iteration to find the container responsible for the given id. The chain is also able to replace the FailoverOnMissContainer if has() works as expected. Using exceptions for for control flow is an anti-pattern.