Dry-system: adding aliases for components

After reading the dry-container docs, especially the part about customization, I wanted to add something similar to the CustomResolver example.
The idea behind that was, that if you have multiple different implementations for a dependency that can be swapped out, it would be nice to have something like an alias, so that you can write include Import["strategy"] in your class, and have a configuration in the container that has a map from “strategy” to “strategies.depth_first” or “strategies.breadth_first”.
The naïve approach I tried was just using the CustomResolver, but it seems as though this only works for a finalized container. Diving a bit deeper into the code, it looks to me as if the Booter might be the best place to put this logic?
Or is there maybe already a way to this with the existing code, that I have just overlooked?

I’d hold off until @timriley is done with his recent refactorings because chances are, it’s gonna be easy to implement in the next version of dry-system. We’re getting very close to 1.0.0!

I just looked at that refactoring, and it looks amazing. Thanks for the pointer, this might make a lot of things I wanted to try with dry-system easier/possible!

1 Like

@rickenharp yes exactly, this is an unexpected turn of events because originally we thought dry-system 1.0.0 will be more-or-less the same but @timriley absolutely killed it and so 1.0.0 release will be epic :smiley: