Due to type erasure, Tapestry doesn't see the generics when using
ServiceBinder.bind(), and that's the preferred way to define services
now (there's almost no need at this point to   use service builder
methods, except for rare cases where the the service implementation is
generated on the fly).

I could probably write a new IoC container that would work differently
and be more Generics aware ... but that is not something I'm going to
do!

On Thu, May 10, 2012 at 7:44 AM, Lance Java <lance.j...@googlemail.com> wrote:
> You would probably want to do it like this:
>
> AppModule.java
> ---------------
> public DoSomethingClass<User> buildUserDoSomethingClass() {
>   return new DoSomethingClassImpl<User>();
> }
>
> public DoSomethingClass<Date> buildDateDoSomethingClass() {
>   return new DoSomethingClassImpl<Date>();
> }
>
> Page.java
> ---------
> @Inject @Named("dateDoSomethingClass")
> private DoSomethingClass<Date> dateDoSomethingClass;
>
> @Inject @Named("userDoSomethingClass")
> private DoSomethingClass<User> userDoSomethingClass;
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Using-generics-in-tapestry-service-tp5700399p5700455.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to