How to inject objects of the same class with different scopes?
问题 In terms of simplicity and correctness, what is the best way to inject objects of the same class with different scopes? In a servlet I want to have injected objects of the same class with different scopes. Still don't know if going to use jsf. Simplicity: Making a Qualifier and a producer method for each scope is too much; making an interface, two classes and adding and alternative in beans.xml is also too much; having an Address#isCurrent() method doesn't make sense. Correctness: JSR299, 3