anonymous wrote : My argument against the @Named annotation wasn't about the number of
extra key strokes (as you pointed out, there is only one!) I was merely saying that to me,
if you say that a component has a name, it would make more sense that it has a
"name" attribute, not a separate annotation. Are you saying that because many
annotations have to share common attributes that those common attributes should be turned
into individual annotations just so you don't have to repeat them on each one? Take
the @Stateless and @Stateful annotation. Are you saying that the EJB 3 spec is wrong in
having duplicated the set of attributes they have in them?
Yes, I think that was a mistake. If I'm writing code that needs to discover the name
of an EJB, it would be *much* better if there was just one annotation to look for. If
annotation inheritance was supported, it would not be a problem, we could have @Stateless
and @Stateful both extend @EJBComponent, and it might be OK.
It's even worse in Web Beans, where component types can be defined by the user.
When people see annotations, they start to forget all their OO modeling knowledge, for
some reason. Try to think in terms of modeling and typesafety.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102065#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...