Simulated Multiple Inheritance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Comments appreciated. I coded an approach to simulating multiple inheritance
of implementation in C# using PIMPL and a type based static class factory
that seems to combine the extensibility of inheritance with the encapsulation
of containment. Hopefully, the C++/cli coders here can read this C# code.

http://www.geocities.com/jeff_louie/oop27.htm
 
JAL said:
Comments appreciated. I coded an approach to simulating multiple
inheritance of implementation in C# using PIMPL and a type based
static class factory that seems to combine the extensibility of
inheritance with the encapsulation of containment. Hopefully, the
C++/cli coders here can read this C# code.

http://www.geocities.com/jeff_louie/oop27.htm

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/pdc_eiffel.asp
for a discussion of how Eiffel .NET implements MI on .NET.

-cd
 
Interesting... I did not know that there was a net language that directly
supported multiple inheritance of implementation. I think that I am doing the
same thing at the code level (as opposed to doing it in the compiler),
providing an interface for each base class and passing a "pointer" to the
implementation to the subclass. What is different is that using PIMPL and a
type based class factory preserves the encapsultation seen with containment
by ownership or composition. Even if new methods are added to a base class,
they will _not_ be visible in the wrapper class. So this code solution
provides the extensibility of inheritance and the encapsulation of
composition.
 
Back
Top