This posting is all about modeling a Generalization relationship in UML
Generalization
A generalization relationship also called as “is-a-kind-of” relationship is a relationship between a more general entity (the parent) and a specialized entity (the child). For example a part-time employee is a kind of employee. In UML a generalization is represented as a solid directed line with a large unfilled triangular arrowhead pointing to the parent as shown below.
In generalization the child inherits the parents’ features and behavior i.e. the properties and methods. The child objects can substitute the parent objects but the reverse is not true.
Code Example:public abstract class Employee {
protected abstract Long computeSalary();
}
public class FulltimeEmployee extends Employee {
protected Long computeSalary(){
….
…..
}
}