0

I couldn't find a satisfying answer to this anywhere, links are appreciated.

In Guice, suppose I create a Frobnifier that takes an integer parameter velocity that tells it how fast to frobnify things:

public class Frobnifier {
  @Inject
  public Frobnifier(@FrobnificationSpeed Integer velocity) {
    // ...
  }
}

Now suppose I'd like this value to be 5 by default, but I'd also like to enable clients to override this value at injection time if they feel like it should be something else.

What is the Guice best practice here? Should I create a module for this class and install it in other modules?

vinntec
  • 455
  • 1
  • 4
  • 11

0 Answers0