0

I'm using Guice 4.1 and wondering if there is an easy way to prevent installing the same module more than once if multiple modules depend on the same module and both reference install(new Module())?

Walter
  • 1,290
  • 2
  • 21
  • 46
  • Well, you could think of a way like creating a singleton module (as in Java singleton, not Guice singleton) and check in the `configure` method if it has already been called. It was, just do nothing, it not bind as usual. Otherwise, there might be tricks, but a real solution? None that I can think of. – Olivier Grégoire Jun 09 '17 at 14:44
  • Yes, I'm doing something like that now and was hoping there was a *proper* way to do it. – Walter Jun 09 '17 at 15:20
  • https://stackoverflow.com/a/20736841/502399 – Tavian Barnes Jun 09 '17 at 16:28

0 Answers0