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

User Manual    [Previous]   [Next]   

E208 Required Methods Not Available

Umple semantic error related to not having required methods of traits in classes

Traits need to have required methods in order to provide the functionality they have designed to provide. These required methods can provide special functionality or be a way of accessing states (attributes) in host classes. This error is raised when a required method is not available.

Example

// In this example, the required method
// "FinalResult()" in Trait "T" is
// not satisfied by class "A".
class A{
	isA T;
}

trait T{
	Integer FinalResult();	
	void calculate(){
		//method FinalResult() will be used here;	
	}	
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// In this example, the require method
// "FinalResult()" in Trait "T" is
// satisfied by class "A".
class A{
	isA T;	
	internal Integer x;	
	Integer FinalResult(){
		return x/100;
	}
}

trait T{
	Integer FinalResult();	
	void calculate(){
		//method FinalResult() will be used here;	
	}	
}
      

Load the above code into UmpleOnline