2 ms·
I wonder if there is a more meta-programming oriented way to achieve the same kind of dependency injection. When working on the code you only see the concrete i
by ufo 12y ago
I wonder if there is a more meta-programming oriented way to achieve the same kind of dependency injection. When working on the code you only see the concrete instantiations but you have some kind of automated tool that replaces those with mock objects if you want to.
- skwirl 12y agoIf the ecosystem you are in provides good tools and you know how to use them, this is actually not really a problem. I work with C#/Visual Studio/Resharper/Moq. I generally don't have static mock object implementations because I can use Moq to dynamically create them. Resharper gives me the ability to press ALT+END to go to the concrete implementation of a method. If there is only one implementation of that method that it knows of it will go straight to it - which is the case much of the time since I don't have static mock implementations. If there are multiple implementations it will let me choose which to go to.