Peter said:
As Patricia and Arne, I don't see the problem. If anything, by
overloading existing classes, they created problems for legacy code
unnecessarily.
For new code, I don't see how it would matter that the new generic
classes were an entirely new class, rather than taking advantage of
an
existing class. To the coder, it's all-new one way or the other.
What follows is largely hypothtiecal, as the only code I've written
that uses generics is really toy code intended mostly to help me use
to learn generics:
The large body of code I maintain at work has to run in 1.4
environments, so generics are not an option there. When it becomes
possible to start using 1.5 features, I'm going to do so, both in new
classes and when maintaining old classes. And the fact that I can say
List<MyClass> newList = (List<MyClass>)exisitngList; // Safe,
since I know what this list really contains
for (MyClass mc : newList)
{
...
}
will come in very handy. Modifying all the framework methods that
return currently List to return NewFangledGenericList would not have
been feasible. That is, the actual situation allows me to introduce
generics incrementally; this seems to me to be very worthwhile.