Hello Simo,
Ok,
- put the jar you want
- myapp defines
@Inject
@Named( "Visa" )
private CreditCardProcessor creditCardProcessor;
... but does myapp still needs to say in its module construction the
following?
bind(CreditCardProcessor.class).annotatedWith(Names.named("Visa")).to(VisaCreditCardProcessor.class);
If the answer is 'no', I understand you point and I will think about it
the next days.
If the answer is 'yes, myapp still needs to explictely do it', it's just
classical injection and we don't need extra layer.
Thx, yes or no? :)
Eric
On 13/01/2013 11:51, Simone Tripodi wrote:
Salut Eric!
On Sun, Jan 13, 2013 at 12:27 PM, Eric Charles <[email protected]> wrote:
However, I miss the problem you are trying to resolve...
Are you looking for a way to put in acme-visa.jar some 'stuff', and reuse it
in myapp.jar in the annotations, without having to redefine them in the
guide module creation.
For example, acme-visa would define the conditions for which
VisaCreditCardProcessor would be chosen, and you simply have to call (not
definining) those?
Once services are automatically discovered and bound - with qualifiers
- in my application I could require for injections such as, for
example:
class MyApp
{
@Inject
@Named( "Visa" )
private CreditCardProcessor creditCardProcessor;
}
without knowing the CreditCardProcessor implementation details - just
put your jars in the classpath and let's bind services without
explicitly specify them.
Does it help on clarifying it?
TIA, all the best!
-Simo
http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/