[
https://issues.apache.org/jira/browse/TAPESTRY-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512667
]
Ben Sommerville commented on TAPESTRY-1646:
-------------------------------------------
I'm pretty sure you can already do that now by using the withId("..") method.
e..g
public static void bind(ServiceBinder binder) {
binder.bind(Dao.class, new DaoImpl(Widget.class)).withId("widgetService");
binder.bind(Dao.class, new DaoImpl(Foo.class)).withId("fooService");
//etc
}
> Binding services by interface and name
> --------------------------------------
>
> Key: TAPESTRY-1646
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1646
> Project: Tapestry
> Issue Type: Improvement
> Components: tapestry-ioc
> Affects Versions: 5.0.5
> Reporter: Dan Adams
> Fix For: 5.0.6
>
>
> I have a utility I want to implement for our CMS which will create and bind
> default DAO service implements for various entity types. These services
> typically don't have their own interface and are referenced by the base
> interface and the service name. For instance, for a Widget entity it would
> look like this:
> @Inject
> private Dao<Widget> widgetService;
> so when create the services you have to do something like this for all
> entities:
> public static Dao<Widget> buildWidgetService() { ... }
> but I'd like to do something like this:
> public static void bind(ServiceBinder binder) {
> binder.bind(Dao.class, "widgetService", new DaoImpl(Widget.class));
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]