guice: runtime injection/binding at command line
问题 I have the following problem: @Inject MyClass(Service service) { this.service = service; } public void doSomething() { service.invokeSelf(); } I have one module bind(service).annotatedWith(Names.named("serviceA").to(ServiceAImpl.class); bind(service).annotatedWith(Names.named("serviceB").to(ServiceBImpl.class); Now my problem is I want to allow user to dynamically choose the injection on runtime base through command line parameter. public static void Main(String args[]) { String option = args