[cdi-dev] Dynamic 'TypeLiteral' with ParameterizedType, such as Guice
Jozef Hartinger
jharting at redhat.com
Tue Aug 12 06:42:40 EDT 2014
This would be useful not only for bean lookup but also for dispatching
parameterized events. The only concern is type safety which
unfortunately cannot be guaranteed (same as in the Guice case). Still, I
find this useful. Please file a new CDI feature request at
http://issues.jboss.org/browse/CDI
Jozef
On 08/01/2014 05:51 PM, Luc wrote:
> Hi,
>
> Today I realized about the method
> 'javax.enterprise.inject.Instance#select(javax.enterprise.util.TypeLiteral,
> java.lang.annotation.Annotation...)' [1], which whas there from 1.0
> version.
> After watching CDI 'TypeLiteral' implementation, came a question to
> mind to me:
>
> Could be done the same, but *with dynamic class type building*?
>
> And my first google search bring me to a post where a user told some
> of the benefits of Guice [2] injection and dynamic types [3], which
> was written at 2010, and it covers exactly my actual needs.
> After watching more the 'TypeLiteral' from CDI and how it is done with
> Guice, I thought that could be cool to have this feature in CDI too. I
> know I can do it for my own project (and I will) but I have a few
> questions:
>
> * Should I open an issue at CDI Jira? Or is more a Weld issue?
> * If the issue is open, I'd like to contribute to its development. A
> part of the "easy rules" from http://www.cdi-spec.org/contribute/,
> what more should I do?
>
> Thanks!!
>
> [1]:
> http://docs.jboss.org/cdi/api/1.0-SP4/javax/enterprise/inject/Instance.html#select(javax.enterprise.util.TypeLiteral
> <http://docs.jboss.org/cdi/api/1.0-SP4/javax/enterprise/inject/Instance.html#select%28javax.enterprise.util.TypeLiteral>,
> java.lang.annotation.Annotation...)
> [2]: https://github.com/google/guice
> [3]:
> http://luisfsgoncalves.wordpress.com/2010/09/08/generic-bindings-with-guice/
>
> --
> Lucas
>
>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20140812/7d42fab9/attachment.html
More information about the cdi-dev
mailing list