river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregg Wonderly <gr...@wonderly.org>
Subject Re: correctness, generics, and spaces
Date Thu, 02 Jun 2011 16:13:01 GMT
On 6/1/2011 11:38 PM, James Grahn wrote:
> On Wed, Jun 1, 2011 at 11:33 PM, Peter Firmstone<jini@zeus.net.au>  wrote:
>> Remember the compiler doesn't type check dynamic code conversion, only
>> static conversion.  Dynamic happens at runtime.  Services are dynamic,
>> discovered at runtime.
>
> As I said, I believe that with one additional proviso (which can be
> enforced at runtime), all dynamic casts will be correct.   To recap,
> that proviso is abolishing unassigned type variables from Entry
> classes.
>
> Could be mistaken.   Would be interested in a counter-example.
>
> The proposal is to use method-level generics, as follows:
> <T extends Entry>  T read (T template)

Have you tried crafting a wrapper, proxy class which advertises the generified 
interface, and does the casts in one place, instead of doing it everywhere?

I'm just wondering if we could just provide such a class, for now, and see how 
that works for people so that all of the "problems" would be in the client, in 
real code, where they could be "fixed" or "understood", before committing to a 
new API.

It would require new interface definitions that encompassed the current tree 
from Javaspace05 I believe.

Then, we could, for example, create a proxy preparer implementation that wrapped 
to the generic interface as one way to use the existing mechanical steps that 
should be in use, to result in a new interface that is generified.

Thoughts?

Gregg Wonderly

Mime
View raw message