list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

E034 Multiple Inheritance

Umple semantic error generated when multiple inheritance is encountered

Umple does not currently support multiple inheritance, in order to be consistent with code generated in Java, and also to make models simpler.

Example

// The following will generate this error

class P1 {}
class P2 {}

class Sub {
  isA P1, P2;
}
      

Load the above code into UmpleOnline

 

Another Example

// The following is another way of
// formulating the same declarations,
// also resulting in the error

class P1 {}
class P2 {}

class Sub {
  isA P1;
  isA P2;
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// If all but one of the parents is
// declared as an Interface, the problem is solved

interface P1 {}
class P2 {}

class Sub {
  isA P1;
  isA P2;
}
      

Load the above code into UmpleOnline