uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

E212 Methods Not Available

Umple semantic error related to modification of unavailable methods in traits

When traits are used inside classes or traits, it is possible to add or remove provided methods and also to change visibility and their names. This feature is used to resolve conflicts when we do not need some provided methods, just need one of them, need different visibilty, or need a different name. Logically, it is not correct to do these operations on methods which are not available. These problems are detected by the Umple compiler.

Example

// In this example, there is an error because trait "T1" tries to remove method "show()" from trait "T2" while it is not available in trait "T2".
class A{
	isA T1;
}
trait T1{
	isA T2 <-show()>;
}
trait T2{
}

      

Load the above code into UmpleOnline

 

Another Example

// In this example, there is an error because trait "T1" tries to add just method "show()" from trait "T2" to itself while it is not available in trait "T2".
class A{
	isA T1;
}
trait T1{
	isA T2 <+show()>;
}
trait T2{

}

      

Load the above code into UmpleOnline

 

Another Example

// In this example, there is an error in class "A" because it tries to change visibility of method "test()" which is not available in trait T. Consider that the method "test()" defined in trait "T" is a required method.
class A{
	isA T;
}
trait T{
	void test();
}

      

Load the above code into UmpleOnline