Getting multiple guice singletons of the same type
问题 can you get 2 singleton instances of the same underlying type? this is obviously trivial in spring as it is based on named instances to which you attach a scope but I can't see the equivalent in guice which is about binding types to implementation classes. Note that I don't want to have to bind to the instance as the instances in question are injected with other dependencies by guice. 回答1: It's easy in Guice too! Create two biding annotations, say @One and @Two and then bind(MySingleton.class