This is not necessarily an optimization but rather a removal of
unnecessary genericity. Let me explain: in java when you use a collection,
you simply say all objects in it are of type Object or subtypes
thereof. This may be well but usually you only mean to put objects of type
SomeBaseType or subtypes of it, into the collection. So why not using the
ability of a compiler to check that you don't put objects of other types
in it by accident (this is called generic types and will be available in
Java 1.5 btw).


Oh yes the certainly can be a good idea. I'm not against this, but with no current java mechanism for automatically enforcing this sort of thing, effort/time must be expended to enforce it manually, and thus I would only do it where it appears to be critical (such as an obvious way that wrong types could hit the collection and an exception should be thrown), or provide some form of optimization if that optimization is needed. In this case, I will do it to make OJB's jdori plug-in happy. It will be interesting to see if/how how JDO is effected by the 1.5 generics you describe. It sounds like the metadata would have to become non-optional in some cases.

In JDO it is similar to Java (well actually it is the same): it is
usually better though less convenient to have associations as un-generic
as possible. Though here it may be more of performance reasons than static
type-checking.

Tom






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



Reply via email to