Dave12345
JCHJava Community | Help. Code. Learn.
•Created by Dave12345 on 12/22/2024 in #java-help
Guice with empty Module
I'm learning Guice and I have working code, but my Module (extending AbstractModule) is empty (because I'm injecting a class not an interface). I can see that there's no overload of Guice.createInjector() which takes no params. Is there some way of not needing a module in my scenario? Not sure if:
1) it's not a big deal; you might add bindings to it later
2) using Guice with an empty module is an anti-pattern - always use interfaces (but I don't think that's correct)
3) I'm missing something.
25 replies