[arquillian-issues] [JBoss JIRA] (ARQGRA-302) Page Fragments injectable by interface
Brian Leathem (JIRA)
jira-events at lists.jboss.org
Wed Oct 23 16:46:02 EDT 2013
[ https://issues.jboss.org/browse/ARQGRA-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12824437#comment-12824437 ]
Brian Leathem commented on ARQGRA-302:
--------------------------------------
+1 Registering the class with the Builder#service is a good solution for not having classpath scanning.
> Page Fragments injectable by interface
> --------------------------------------
>
> Key: ARQGRA-302
> URL: https://issues.jboss.org/browse/ARQGRA-302
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Reporter: Lukáš Fryč
> Fix For: 2.Future
>
>
> In order to be able hide implementation details of particular page fragments shipped with a framework,
> we should favor injection of Page Fragments by interfaces.
> {code}
> interface Calendar;
> class CalendarImpl;
> @FindBy("calendar") Calendar calendar;
> {code}
> The implementation of the calendar can be registered using services mechanism.
> {code}
> Builder#service(Calendar.class, CalendarImpl.class);
> {code}
> ----
> When there are more {{Calendar}} implementations on the classpath registered, the user have either choice of using particular implementation or, preferably, use self-detection built-in into page fragment implementations -> with the knowledge of a root element, they can detect if they are appropriate implementation for given interface.
> E.g. RichFaces calendar will look a the root element and check whether it has class {{rf-cal}}.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the arquillian-issues
mailing list