Re: Parameterized service injection

"Thiago H. de Paula Figueiredo" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88GbV6qkJJcBq=+EYkzAoxomKQqzdwH+2LiUQ-ykPnMVirA@mail.gmail.com>
Hi!

On Tue, Dec 13, 2016 at 5:31 AM, Andrus Adamchik <[email protected]>
wrote:

> From what I gather Tapestry 5.4 still does not support parameterized
> service injection?


It does not. I haven't found yet a situation in which I wanted something
like that. I've see people creating a MyServiceSource service, for example,
which then provides the type-specific services, though. I'm more of a fan
of having specific subclasses or implementations for each type in most
cases. :)

On the other hand, you could use marker annotations to avoid the
MyServiceSouce service above, so maybe that's a path you can use as the
source of inspiration in case you want to add parameterized service
injection to Tapestry-IoC. We're open for contributions. :)


> E.g. in the following example both s1 and s2 will map to the same DI key
> of the bare class:
>
>   @Inject
>   private MyService<MyType1> s1;
>
>   @Inject
>   private MyService<MyType2> s2;
>
> I am running Tapestry on a Bootique.io stack with underlying injection
> bridged to Google Guice, that supports the above style. So I am a bit
> crippled by this limitation. I may (or may not :)) have time to develop and
> contribute this functionality to Tapestry, but before I start digging any
> deeper, wanted to check whether this is already in the works (or perhaps I
> overlooked something obvious, and I simply need to revise my Guice to
> tapestry bridge)?
>
> Thanks for any insight.
>
> Andrus
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Thiago
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.