hi,
First of all, thanks John for creating this very promising framework.
Let me share some comments first. I'm evaluating Transfuse and want to see if it can replace Dagger in an existing project. Transfuse does much more than Dagger on the Android framework components injection side, but Dagger is evolved from Guice and they do non-Android specific dependency injection very well. One thing I like about Transfuse is, the generated .java code with error just show up in my IDE that I know how it works and can try to troubleshoot any problem. Is Transfuse suppose to be able to replace Dagger (... ultimately)?
The first issue I encountered is, in Dagger, any @Provides method supports injection, and arguments will just be wired from the ObjectGraph. e.g.
@Provides Dog getDog( PetStore store){
return store.getPet("dog", 0); //whatever, just make it more realistic :-)
}
PetStore will be "injected" just like putting it in a @Inject attribute in other class.
Transfuse actually translate every @Provides method to a provider. Should every argument in a @Provides essentially the same as creating a Provider with @Inject attributes? Assume @Inject attribute in Provider will be injected, that shouldn't be the case, right?
Last but not least, for a real case, I want to inject an android.app.Application instance to the @Provides method, like the following:
@Provides Something getSomething(android.app.Application ctx)
The generated code shows an error and the "app" becomes this.getApplication(). If I replace "android.app.Application ctx" with "android.app.Activity ctx", Transfuse is intelligent enough to change the generated code from "this.getApplication()" to "this", indicate the generated Provider class is somehow viewed as an activity.
May I have some hints about the current status of the module usage before I have to dig into the Transfuse source code? thank you very much
Regards,
mingfai