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

User Manual    [Previous]   [Next]   

W089 Association Rolename Matching Classname

Umple semantic warning issued when assigning a role to an association that matches the class name

The role name of an association is used to explain how a class participates in a relationship. A role name that matches the class name may be unnecessary, since it provides little clarification as to the relationship between the classes.
This warning can be avoided by removing or changing the role name.

Note that in certain cases this could raise syntactic errors such as E019.

Example

//This example generates the warning message
class Person {
  name;
}

class Intern {
  isA Person;
  * -- 0..2 Employee employee;
}

class Employee {
  isA Person;
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

//This example shows how to avoid the warning
class Person {
  name;
}

class Intern {
  isA Person;
  * -- 0..2 Employee supervisor;
}

class Employee {
  isA Person;
}
      

Load the above code into UmpleOnline