[weld-issues] [JBoss JIRA] Commented: (WELDX-179) Introduce @Qualified to have package name prepended to @Named value

Dan Allen (JIRA) jira-events at lists.jboss.org
Tue Oct 19 03:13:54 EDT 2010


    [ https://jira.jboss.org/browse/WELDX-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557766#action_12557766 ] 

Dan Allen commented on WELDX-179:
---------------------------------

If accepted, need to add docs.

> Introduce @Qualified to have package name prepended to @Named value
> -------------------------------------------------------------------
>
>                 Key: WELDX-179
>                 URL: https://jira.jboss.org/browse/WELDX-179
>             Project: Weld Extensions
>          Issue Type: Feature Request
>    Affects Versions: 1.0.0.Beta1
>            Reporter: Dan Allen
>            Assignee: Dan Allen
>            Priority: Minor
>             Fix For: TBC
>
>
> @Named gives the bean a name equal to the annotation value property or, if one is not specified, the decapitalized simple name of the type. This behavior is precisely what the majority of developers will appreciate. However, framework writers should avoid stomping on the root bean namespace, instead assigning qualified names to their built-in components. The motivation is the same as qualifying Java types.
> One way to accomplish this would be to include the package name in the name specified in the @Named annotation:
> @Named("org.jboss.seam.security.Identity")
> public class Identity ... { ... }
> However, this is not in the spirit of type-safety. As an alternative, Weld X can introduce an annotation which indicates that the bean name be qualified to the package in which the type resides.
> @Qualified @Named
> public class Identity ... { ... }
> This allows the bean name to be defaulted and keeps the package out of a string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list