Ideally, we'd be able to recover the generics information, but the
Java implementation of generics makes that very hard to accomplish.
Type erasure and all that.

I think the approach of creating sub-interfaces to "nail down" the
generic types is the best approach.

On Fri, Jun 27, 2008 at 7:08 AM, José Paumard <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I declared an ASO like that
>
> @ApplicationState
> private SomeIntf<A> a ;
>
> It works very well, and I can find this object across all my pages. But then
> I declared another one  :
>
> @ApplicationState
> private SomeIntf<B> b ;
>
> Following the way Java deals with templates, T5 considers that those two ASO
> are the same. It's not a big deal, I can extends SomeIntf<T> with SomeIntfA
> and SomeIntfB, and work things out like that, but I dont find that very
> elegant, plus it wont scale nicely as T takes more values.
>
> So, would it be possible, or would it make sense, to have some kind of name
> attribute to the @ApplicationState, allowing one to discriminates ASO,
> something like that :
>
> @ApplicationState(name="SomeIntfA")
> private SomeIntf<A> a ;
>
> and
>
> @ApplicationState(name="SomeIntfB")
> private SomeIntf<B> b ;
>
> Bytheway, that would allow one to have different ASOs with the same type.
>
> Thank you for your answers / thoughts / advice,
>
> José
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to