list of dots

User Manual    [Previous]   [Next]   

E211 Two or More Modifications

Umple semantic error related to two or more modifications of provided methods of traits

When traits are used inside classes or traits, it is possible to add or remove provided methods. This feature is used to resolve conflicts and when we do not need some provided methods or just need one of them. Logically, it is not correct to add a method twice, or add and then remove a method. These problems are detected by the Umple compiler.

Example

// In this example, there are
// two modifications ("add") for
// the method "show()" when trait "T2"
// is used inside of trait "T1".
class A{
	isA T1;
}
trait T1{
	isA T2 <+show(),+show()>;
}
trait T2{
	void show(){
	//implementation
	}
}

      

Load the above code into UmpleOnline

 

Another Example

// In this example, there are
// two modifications ("add" and "remove")
// for the method "show()" when trait "T2"
// is used inside of trait "T1".
class A{
	isA T1;
}
trait T1{
	isA T2 <-show(),+show()>;
}
trait T2{
	void show(){
	//implementation
	}
}

      

Load the above code into UmpleOnline