list of dots University of Ottawa logo / Université d'Ottawa

User Manual    [Previous]   [Next]   

E213 Bidirectional Association in Traits

Umple semantic error related to having bidirectional association with interfaces

Traits can make associations with interfaces, classes, and template parameters. If one end of the association is a template parameter, the binding type must be checked to make sure it is compatible with the type of the association. For example, if a trait has a bidirectional association with a template parameter, the binding value cannot be an interface and it must be a class. Breaking this constraint is reported to modelers using this error code.


// In this example, there is an error
// because a bidirectional association
// is created with interface I,
// which is not valid.
interface I {
trait T <RelatedClass> {
  0..1 -- * RelatedClass;
class C{
 isA T<RelatedClass=I>;

Load the above code into UmpleOnline