java - Guice @Provides in dependent library -
i new googleguice. if understand correctly, create object, need use @provides annotaion on required method in implementation of abstract module. eg:
public class mymodule extends abstractmodule { @provides public abc abc () { } @override protected void configure() { } }
this has initialized following in main method :
injector injector = guice.createinjector(new mymodule());
however, need create object in library called service. therefore, mymodule goes library, whereas main method in service calling library. thus, main method in service have call guice.createinjector mymodule in library.
is there way avoid that?
Comments
Post a Comment