uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

E213 Removing While Renaming

Umple semantic error related to removing a method from a trait while changing its name

When traits are used inside of classes or traits, it is possible to add or remove provided methods and also to change their visibility and names. This feature is used to resolve conflicts. In fact, it is used when we do not need some provided methods, we just need one of them, we need different visibilty, or we need a different name. Logically, it is not correct to remove a method while renaming it because the second operation is not going to happen.

Example

// In this example, there is an error because class "A" tries to remove method "show(String)" while it tries to change its name. This is a contradiction.
class A{
	isA T1<+show(Integer), -show(String) as t >;
}
trait T1{
	void show(String str){
	//Implementation
	}
	void show(Integer inData){
	//Implementation
	}
	void show(String str,Integer inData){
	//Implementation
	}
}

      

Load the above code into UmpleOnline