Bob Scheifler wrote:
Sean Landis wrote:
There appear to be some places where
direct generifying might not work w/o significant change, but I
haven't done a full analysis.

FWIW, 3 years ago (how sad is that) I went through the exercise for

I assumed you've got over it by now :-P

all of the public net.jini APIs, including getting a compilable
starter kit (but didn't bother to eliminate all compiler warnings
resulting from not generifying internal code).

I assume your generification was done in a compatible way, i.e. code
compiled against the pre-generified net.jini APIs will continue to work
assuming they were deployed on J2SE 5 or higher.

Did you also investigate the usage of typed collections for method
signatures that have arrays as argument and return value and the
var-args construct. Do you envision deprecation of the latter and adding
the equivalent using typed collections. If we are going to generify I
think we shouldn't do it only half, but I also release that once you
start deprecating why not roll other insight into the API as well at the
same time. Suddenly it might turn out that a lot of the current API is
subject to change. I have a nagging feeling [1] that starting with
generification of the API is like throwing away a snowflake on the top
of mountain with the net result the village in the valley is hit by an
avalanche.

FYI, it is already quite a while since the discussion of Java 5 popped
up and at this point I'm fine with moving to Java 5 but not for the
first 1 or 2 releases. This is something I would like to see done when
other major chunks of work are being accomplished.

[1] if one wonder why I have this nagging feeling, I do have version 1.0
of the JSC API for over 2 years in my workspace and that takes advantage
of generics as well and other J2SE 5.0 API. While it started out as
generification in a compatible way it resulted in a mixture of typed
collections and typed arrays. It didn't feel right and given the size of
the installed base I decided to make things consistent, but while no
longer backwards compatible I also decided to clean up some other parts.
End of the story ... it became something different, although similar. It
is not rocket science for people to migrate from 0.1 to 1.0 and I still
think what I'm doing is the right thing, but still it is a barrier.

In general my experience with generifying public APIs and internals are
mixed, so far I didn't catch any bugs, code density was not achieved
(contrary), not all casts went away and I can recall a few moments when
somebody threw a bucket of water over my head as smoke was coming out of
my ears. I'm proud of having survived the exercise, but creating type
safe APIs was sometimes nearing rocket science at least for me (I was
very glad with Bracha's tutorial).
--
Mark

Reply via email to