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

Guy Murphy guy.murphy@calaba.com
Mon, 18 Feb 2002 10:26:08 -0000

>> Which from a modern OO perspective is a Very Bad Thing.

Please explain further how I the naive coder am going to use a mixin implimented in one of your classes to reak havoc with your object model, above and beyond using an interface.

I'm sorry, but I think you're confusing religion with development of code.

Because mix-ins have no constructor, and therefore can't be used to instantiate a type, they're safe, even in single inheritence.

You are obviously having some misunderstandings as to the usage of mixins (or indeed what they are), I think you should perhaps go check them out a little before trying to convince us they're the work of the devil.

Also please keep in mind that there is no One True Way with regard to OO, which means subtly different things in different languages, which is why what Java makes of OO might be different than what Ruby or Objective-C do.


-----Original Message-----
From: Martin Coxall [mailto:coxall@cream.org]
Sent: 15 February 2002 20:34
To: mono-list@ximian.com
Subject: RE: [Mono-list] Re: Is Objective-C support possible?

>  > In any case the CLR is designed to avoid that by making its requirement of
>  > multiply inherited classes be abstract, so if you want broken OO via impure
>  > Mixins, I wouldn't expect the CLR to ever support that. ILX would still
>  > support the CLR notion of single inheritance, multiple interfaces.
> You're talking about interfaces, not mixins.  The term came from the
> Flavors object system for Lisp, and mixins *do* come with
> implementations.  They're little classes that aretn't terribly useful
> by themselves, but when mixed in with a substantial class, add
> functionality.

Which from a modern OO perspective is a Very Bad Thing. Which is why
neither Java nor C# support them.

To achieve what you want without breaking encapsulation, use the
decorator pattern. Again if refer to Gang of Four.


Mono-list maillist  -  Mono-list@ximian.com