[Uml-devel] ambiguity

Andrew Sutton ansutton at kent.edu
Wed Jan 15 10:13:03 UTC 2003


hey, does anybody know anything about disambiguating the "OO circle of death" 
inheritance problem? as i go thru the MOF implementation i'm finding a couple 
of instances of multiple inheritance that make the inheritance tree cyclic. 
for example (this isn't quite right, but its enough to illustrate the point):

class ModelElement;
class TypedElement : public ModelElement;
class DataType : public ModelElement;
class AliasType : public DataType, public TypedElement;

if you can imagine a UML diagram of this, you'd end up with a cyclic graph - 
the dreaded circle of death? unfortunately, i don't see any way around this 
in our implementation.

actually, this isn't really a problem until you instantiate AliasType and 
return a reference to ModelElement. because of the multiple inheritance, 
ModelElement appears twice in the supertype list of AliasType. so, returning 
a reference to ModelElement is ambiguous.

so, does anybody know any way to disambiguate the reference to ModelElement 
for an AliasType? BTW, this is a REALLY good OO question - if there's a good 
answer.

andy




More information about the umbrello-devel mailing list