Brian Mearns
1 min readApr 16, 2018

--

I’m not sure if I’m following your idea, but I think we might be talking about different things. Guice manages run time dependencies within the application itself. It sounds like maybe you’re thinking about compile-time dependencies, is that right? The latter might be managed by something like gradle.

Guice actually runs inside the application. It provides an object called an injector which you can use, for instance, when instantiating objects to get the dependencies needed for construction of that object. So, for example, when calling new BatchManager, I might call something like injector.getInstance(HeartbeatActor.class) and pass that in as a constructor argument.

--

--

Brian Mearns

Software Engineer since 2007 ・ Parent ・ Mediocre Runner ・ Flower and Tree Enthusiast ・ Crappy Wood Worker ・ he/him or they/them