ollie314 / atinject

Automatically exported from code.google.com/p/atinject
0 stars 0 forks source link

Ditch @Named #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Folks, let's just get rid of the qualifier @Named. We've gone to so much
effort to come up with a model that is typesafe and does not depend on
strings, why are we going and opening up that door again. Use of @Named as
a qualifier is lame and a bad practice.

If a user *really* wants to use named qualifiers, they can sooo easily
write their own @Named annotation. But it's not something we should
encourage by putting it in the spec. We should be doing everything we can
to encourage people to use @UserDatabase EntityManager instead of
@Named("userDatabase") EntityManager.

Original issue reported on code.google.com by gavin.k...@gmail.com on 19 Jun 2009 at 12:03

GoogleCodeExporter commented 8 years ago
As Rod Johnson said in an e-mail (and I paraphrase), removing alternatives is 
not the 
same as encouragement. You know people will want to do this no matter how lame 
and bad 
it is, and I don't think we want people rolling their own @Named 
implementations.

I say keep it in, but with a big obvious pointer to Qualifier.

Original comment by tpeie...@gmail.com on 22 Jun 2009 at 6:56

GoogleCodeExporter commented 8 years ago
Agreed. If you only use a dependency once, creating a custom annotation doesn't
really make sense. @Named is useful when injecting property values, command 
line flag
values, etc.

Original comment by crazybob...@gmail.com on 22 Jun 2009 at 7:11

GoogleCodeExporter commented 8 years ago

Original comment by crazybob...@gmail.com on 23 Jun 2009 at 11:26

GoogleCodeExporter commented 8 years ago
I can live with this, but in that case, we at least need to deal with:

http://code.google.com/p/atinject/issues/detail?id=9&can=1

Original comment by gavin.k...@gmail.com on 24 Jun 2009 at 1:37