Re: [BLACKBOX] foreign COM-objects part 2: inherit multiple interfaces

From: Dr. Markus Bautsch <"Dr.>
Date: Tue, 21 Dec 2010 05:13:51 -0500

----boundary-LibPST-iamunique-1079667717_-_-
Content-type: text/plain

Dear all !

You have to distinguish multiple implementation inheritance and
multiple interface inheritance.

The former is absolutely a mess (cf.
http://en.wikipedia.org/wiki/Diamond_problem) as C++ is.

However, Java allows simple implementation inheritance by the keyword
"extends" and multiple interface inheritance by the keyword
"interface", but C# only allows simple inheritance such as Componant
Pascal, too.

Multiple interface inheritance has some comfortable aspects because you
can inherit multiple abstact classes such as Serializable and
Comparable at the same time. But to be honest, the concept behind it is
very complex either for programmers or for compilers. And exactly this
leads to programming errors and run-time issues.

It is not necessary to have multiple inheritance at all and simple
inheritance is much, much clearer and easier to unserstand. Therefore,
I would recommend only to use simple inheritance (either for abstact or
for concrete classes).

Best regards from Berlin

Markus Bautsch



-----Ursprüngliche Mitteilung-----
Von: Wojtek Skulski <skulski{([at]})nowhere.xy
An: BLACKBOX{([at]})nowhere.xy
Verschickt: So., 19. Dez. 2010, 4:31
Thema: Re: [BLACKBOX] foreign COM-objects part 2: inherit multiple
interfaces


I heard that multiple inheritance is one of the main reasons that C++
has severe performance problems in numerical applications. Even if you
do not use multiple inheritance in your code, it is still there biting
the performance. 
 
The performance problems lead to new language constructs, which lead to
new problems, etc. The final outcome was that all problems were
eventually solved, as described in an article published in Computers in
Physics, Volume 11 Issue 3, May/June 1997. The article was titled
"Disambiguated glommable expression templates". After reading that
article I swore I would never touch C++, because I could not understand
a single paragraph. Unfortunately, the article does not seem available
online. 
 
I searched the web. As it turns out, the "Disambiguated glommable
expression templates" did not end in 1997. A more recent version is
available: 
http://adtmag.com/articles/2000/04/25/disambiguated-glommable-expression-templates-reintroduced.aspx 
 
The first page reads very well, because it cites Stroustrup himself
(for those who do it know what "Stroustrup" means, here is a
disambiguated definintion: Stroustrup = Wirth++). Here is the quote: 
 
"It would be nice if every kind of numeric software could be written in
C++ without loss of efficiency, but unless something can be found that
achieves this without compromising the C++ type system it may be
preferable to rely on Fortran, assembler, or architecture-specific
extensions." 
 
It is nice to hear from Stroustrup that assembler is preferred to C++.
I have never heard such a succicint judgement about C++ qualities. 
 
In any case, I think the article may be worth reading. 
 
I hope these remarks were helpful. 
 
Wojtek 
 
On Sun, 19 Dec 2010, Chris Burrows wrote: 
 
>> -----Original Message----- 
>> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>> gunnar bernhardt (VDI) 
>> Sent: Friday, 17 December 2010 7:06 PM 
>> To: BLACKBOX{([at]})nowhere.xy
>> Subject: [BLACKBOX] foreign COM-objects part 2: inherit 
>> multiple interfaces 
>> 
>> Am I correct that the reason is that Component Pascal as it is 
>> defined in the Language Report (by Oberon) does not allow to 
>> inherit from multiple interfaces so there is not easy way to 
>> circumvent this? 
>> 

> Way over my head - but I had a look in Clemens Szyperski's (one of
the 
> co-founders of Oberon microsystems) book "Component Software - Beyond 
> Object-Oriented Programming" 

> http://research.microsoft.com/~cszypers/Books/component-software.htm 

> In a section on multiple inheritance he states "Microsoft COM does
not 
> support multiple interface inheritance, but allows a component to
support 
> multiple interfaces simultaneously, to much the same effect". 

> His book is worth investigating if you are likely to have a number of 
> questions of this sort - many of the examples are in Component Pascal
as 
> well. 

> Regards, 
> Chris 

> Chris Burrows 
> CFB Software 
> http://www.cfbsoftware.com 


> ---- 
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
LISTSERV{([at]})nowhere.xy


 
---- 
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
LISTSERV{([at]})nowhere.xy


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1079667717_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1x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