Hi Herfried,
Herfried K. Wagner said:
I don't know if it's called mixin.
It's just an extension of an existing type by methods and properties,
which can have state. A code sample similar to the sample shown by Amanda
Silver:
\\\
Public Class Foo
Extends Goo
Private m_Bla As Integer
Public Property Bla() As Integer
Get
Return m_Bla
End Get
Set(ByVal Value As Integer)
m_Bla = Value
End Set
End Property
End Class
///
This can even be used to extend 'NonInheritable' types.
My *guess* is that is as a mixin. An instance of Foo would not be an
instance of Goo, but Foo would implement any interfaces Goo does, and
probably implicitly expose any members that Goo would. The problem is when
there is a naming clash you need a more explicit syntax or a renaming
scheme. For example, let's say you want to extend a Goo and a Bar, but they
both have a Name property. For .NET the only way around that would be you'd
have to have an explicit way of calling the member of Foo versus the one on
Bar. One solution might be to expose readonly Goo and Bar properties, or
alternatively create interfaces for the type Goo and Bar and require access
via the interface. Neither of those approaches however really make the
methods of Goo and Bar *directly* accessible as part of Foo. Perhaps the
solution is for the IDE to warn when there is a naming clash, and you could
click on the warning and choose to implement the methods that clash.