Closed Robertscorp closed 9 months ago
Alternatively, the DI container can support multiple mechanisms at the same time. That means that it's not invalid. Also, that means that the default behaviour is not flexible enough - it should support either only a single implementation, or as many implementations as you want. That also means that there should be multiple Implementation Instances and Implementation Factories
This ticket relates to multiple implementations being added to a single dependency, which is a valid scenario. If a dependency should only have a single implementation, either use the standard dependency and lock it, or write a custom IDependency. Otherwise, the dependency class handles this scenario as of #34
The Behaviour is able to do whatever it wants to the Dependency. That's great for flexibility, but not great for consistency. Probably just throw exceptions in the setter if the operation would put the Dependency in an invalid state (i.e. multiple implementation mechanisms all being set at the same time)