Hi, Brandon.
It seems to me that you are using the term 'diamond problem' differently than other people.
Wikipedia describes the diamond problem like this:
In object-oriented<http://en.wikipedia.org/wiki/Object-oriented> programming languages<http://en.wikipedia.org/wiki/Programming_language> with multiple inheritance<http://en.wikipedia.org/wiki/Multiple_inheritance> and knowledge organization, the diamond problem is an ambiguity that arises when two classes<http://en.wikipedia.org/wiki/Class_(computer_science)> B and C inherit<http://en.wikipedia.org/wiki/Inheritance_(computer_science)> from A, and class D inherits from both B and C. If a method<http://en.wikipedia.org/wiki/Method_(computer_science)> in D calls a method defined in A (and does not override<http://en.wikipedia.org/wiki/Method_overriding_(programming)> the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C?
The emphasis on "differently" is mine.
You seem to be using the term in an opposite, and confusing, way.
If the same interface class is inherited or implemented more than once, there is no conflict, but you are calling it a 'problem'.
If the same interface class is specialized in two different ways, then a conflict is created, but you say that this is not a diamond problem. I think this case is much closer to the Wikipedia definition of diamond problem.
Do you have to use the term 'diamond problem' at all?
Shalom
_____________________________________________
From: Tipp, Brandon P
Sent: Wednesday, November 16, 2011 6:47 PM
To: Bresticker, Shalom; Alsop, Thomas R
Cc: Neil Korpusik; Tipp, Brandon P
Subject: RE: Mantis 1356 v16 - "inherit"
How about this:
The diamond problem occurs if an interface class is implemented by the same class or inherited by the same interface class in multiple ways. The diamond problem shall be solved by merging only one copy of any conflicting symbols so as to never result in a name conflict. For example:
interface class IntfBase;
parameter SIZE = 64;
endclass
interface class IntfExt1 extends IntfBase;
pure virtual function bit funcExt1();
endclass
interface class IntfExt2 extends IntfBase;
pure virtual function bit funcExt2();
endclass
interface class IntfExt3 extends IntfExt1, IntfExt2;
endclass
In the above example, the class IntfExt3 inherits the parameter SIZE from IntfExt1 and IntfExt2. Since these parameters originate from the same interface class, IntfBase, only one copy of SIZE shall be inherited into IntfExt3 so it shall not be considered a conflict.
-Brandon
_____________________________________________
From: Bresticker, Shalom
Sent: Wednesday, November 16, 2011 9:31 AM
To: Tipp, Brandon P; Alsop, Thomas R
Cc: Neil Korpusik
Subject: RE: Mantis 1356 v16 - "inherit"
Well, it's not solved by the tool. Rather, the LRM defines a resolution.
Shalom
_____________________________________________
From: Tipp, Brandon P
Sent: Wednesday, November 16, 2011 6:29 PM
To: Bresticker, Shalom; Alsop, Thomas R
Cc: Neil Korpusik; Tipp, Brandon P
Subject: RE: Mantis 1356 v16 - "inherit"
I was searching for a known computer science term synonym for "diamond inheritance" and came up with the "diamond problem". It is still a problem, it's just solved by the tool rather than solved with name conflict resolution in the code.
The diamond problem occurs if an interface class is implemented by the same class or inherited by the same interface class in multiple ways. The diamond problem shall be solved by tools so as to never result in a name conflict. For example:
_____________________________________________
From: Bresticker, Shalom
Sent: Wednesday, November 16, 2011 2:23 AM
To: Tipp, Brandon P; Alsop, Thomas R
Cc: Neil Korpusik
Subject: RE: Mantis 1356 v16 - "inherit"
I don't like this wording. It seems contradictory. On the one hand, it calls it a "problem". On the other hand, it says there is no conflict, i.e., no problem.
Regards,
Shalom
_____________________________________________
8.25.6.3 says,
Diamond inheritance occurs if the same interface class is inherited by the same class or interface class in multiple ways.
Yet we say that a class does not "inherit" an interface class.
[Tipp, Brandon P] I've seen some reference to this as "the diamond problem". I'm rewording it as follows:
8.25.6.3 Diamond problem
The diamond problem occurs if an interface class is implemented by the same class or inherited by the same interface class in multiple ways. The diamond problem never causes a name conflict. For example:
...
(I also changed the later mention of "diamond inheritance" to "diamond problem").
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Nov 21 04:27:22 2011
This archive was generated by hypermail 2.1.8 : Mon Nov 21 2011 - 04:27:37 PST