[Mono-list] Re: Is Objective-C support possible?

Martin Coxall coxall@cream.org
18 Feb 2002 14:55:58 +0000

> Tell me... bar carrying implementation detail what the difference is in inhereitence model between an interface and a mix-in?

Simply, it is this. The diamond-inheritance problem goes away when one
of the inheritance paths is abstract, since the classloader *has* to
follow the other path to obtain implementation. Which is why in good OO
you should only from one concrete class, and the rest as classes with
only abstract methods/pure virtual functions.

And this is also the reason why Java and the CLR will only allow you to
inherit multiply from a single concrete class and interfaces, and by
virtue of this, why mixins are not allowed.

In any case, this discussion is rather pointless since (a) The CLR does
not allow mixins, (b) probably never will, (c) ObjC and IL are both
Turing-complete, and (d) mixin functionality can be achieved using
either the decorator pattern, aggregation of utility objects or code
generation via reflection.