dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]C@


From: BioChem333
Subject: Re: [DotGNU]C@
Date: 10 Aug 2002 13:03:56 -0400

On Sat, 2002-08-10 at 12:03, Peter Minten wrote:
> C@, pronounced cat

I still prefer C_ (C flat).

> * Methods from other classes can be built into a class without inheriting the
> complete other class by using an 'include ClassIdentifier.MethodName;'
> statement. Such inherited methods are called mixins. Note that this will work
> for every 'public' declared part of a class (thus also for delegates, events,
> properties). This is actually a workaround for the C# rule against multiple
> inheritance of classes and is based on Ruby mixins.

What about private inheritance? Inheriting implementation without
inheriting interface can be quite useful, and avoids most of the
problems of ambiguity with multiple inheritance. The order in which the
classes/interfaces are listed could be used to determine which classes
have priority. The first class listed is public, and any classes listed
after it are privately inherited. In the case where a class isn't
supposed to publicly inherit from any other classes, it must still be an
Object, so Object could be explicitly listed as the first class (eg.
SomeClass : Object, PrivateClass). Additionally, base could still refer
to the first class, but base[SomePrivateClass] could be used to access
privately inherited base classes.

Another feature to add to the list: friend methods and classes. The
internal access modifier is too broad for most situations. Limiting the
access to a particular class or method also limits the potential for
problems with changing implementations.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]