Currently, the delegation pattern used to resolve dependencies is not capable of seeing wether a component is fully resolved or not.
Therefore the order of registration may matter and may produce stack overflows, unresolved dependencies or crashes.
We need a way to see wether a component needs a certain resolver or not. And we need to detect wether a resolver is ready to use or not in order to follow the dependency graph.
My current idea to solve this problem: Extend the Resolver Interface by a new function resolutionpossible(on consumer:Component) -> Bool
With that function the Container can check wether a Resolver is needed by a certain component.
To know wether a certain Resolver is ready to use, the container can simply collect all resolvers in another collection once they're done resolving their own dependencies.
Currently, the delegation pattern used to resolve dependencies is not capable of seeing wether a component is fully resolved or not.
Therefore the order of registration may matter and may produce stack overflows, unresolved dependencies or crashes.
We need a way to see wether a component needs a certain resolver or not. And we need to detect wether a resolver is ready to use or not in order to follow the dependency graph.
My current idea to solve this problem: Extend the Resolver Interface by a new function
resolutionpossible(on consumer:Component) -> Bool
With that function the Container can check wether a Resolver is needed by a certain component.To know wether a certain Resolver is ready to use, the container can simply collect all resolvers in another collection once they're done resolving their own dependencies.