Jun 28, 2023
Just want to give a drawback with the DI approach you provided.
It does in fact solve the problem with initialization, extensibility, and so on. The problem with the suggested approach is that you are going to resolve all possible strategies, doesn't matter which one you are going to use. Considering this pattern really makes sense, as you stated, when you have a lot of possible strategies, you may be initializing a complex dependency graph for no reason.