Loose type checking in E

Tyler Close tyler@lfw.org
Thu, 15 Oct 1998 03:58:27 -0400


At 12:17 AM 10/15/98 -0700, you wrote:
>On Tue, 13 Oct 1998, Tyler Close wrote:
>> 
>> Java interfaces are similar to virtual inheritance of pure abstract classes
>> in C++. The (very good) idea is to separate interface definition from
>> interface implementation. This is an important abstraction that is very
>> useful; however, it does not get you out of creating inheritance
>> hierarchies.
>
>That last bit is the part i'm not sure i understand.
>
>Is the rub the fact that Java's strong typing will not accept
>"implements interface X" as a type-match?

No, it is a type-match.

Arrg.

See, X is a type. It is declared in an interface or class file. If you want
to define subsets of behaviour, you would need to contrive some sort of
class hierarchy to represent all of these subsets. With templates, you
don't have to do this, you just use the subset that you want and expect the
client to be able to comply. This means that you don't have to rack your
brain to come up with just the right hierarchy to represent all possible
subsets.

If you are still having problems with this, then go to the Silicon Graphics
site and study the STL documents. I learned from them.

ciao,
Tyler