AcclimateContainer / acclimate-container

Adapters for PHP framework containers to an interoperable interface
MIT License
220 stars 16 forks source link

Added the possibility to create a container chain #18

Closed hoesler closed 6 years ago

hoesler commented 9 years ago

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.

jeremeamia commented 8 years ago

Cool! I'll take a closer look at this soon, and see how I want to incorporate it.

jeremeamia commented 8 years ago

@Sam-Burns have you taken a look at this yet? What do you think?

@hoesler Mind, providing a usage example?

hoesler commented 8 years ago

Hi, thanks for considering my proposal. Basically, the ContainerChain has the same use cases as the CompositeContainer, don't you think.