You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking to enable similar mocking for Dagger based dependency injection systems. I know dagger doesn't support AOP but want to quickly check here for extending this framework for Dagger.
sounds quite interesting! DeepSampler has an abstraction layer for AOP, so it should be independent of concrete AOP frameworks. We designed DeepSampler this way to be able to do exactly what you are suggesting!
Concept
We have an abstract concept, that we like to call aop-provider. In fact, this is the starting point of DeepSampler, you could see it as the main()-method of DeepSampler.
An aop-provider lives inside of a particular aop-framework. It's job is to intercept method-calls and to send these method-calls to DeepSampler. The way, how this is done, is completely open to the authors of aop-providers.
So, the interesting part of that project would be to find a way to integrate something that is able to intercept method-calls in Dagger. One solution that I can think of might be AspectJ with compile-time-weaving. In fact, this might even be a generalized solution that could work nearly everywhere, independent of any dependecy-injection-framework. We were thinking of writing this, but haven´t found the time yet.
You could create a module (using maven or gradle) deepsampler-provider-dagger that lives in your own GitHub repo. It would have the same dependencies to DeepSampler as deepsampler-provider-guice. You could publish this module to maven-central, so that others can use it together with DeepSampler.
Testing
Since a test-framework is meant to ensure the quality of the test-objects, it's quite important to thoroughly test the test-framework itself. We have two abstract Junit-test-classes that can be used to test all aop-providers and to ensure that all providers support the same functionality. But it would be great if you could add some additional tests, that we maybe didn't think of.
Hello,
I am looking to enable similar mocking for Dagger based dependency injection systems. I know dagger doesn't support AOP but want to quickly check here for extending this framework for Dagger.
FYI, Dagger is a compile time dependency injection framework and is getting popular in the recent times. https://medium.com/bigeye/dependency-injection-103-guice-vs-dagger-6ab7afa68d3d
Thanks,
The text was updated successfully, but these errors were encountered: