-
Notifications
You must be signed in to change notification settings - Fork 17
Generalization
Knut Jetlund edited this page May 12, 2016
·
7 revisions
Generalizing into superclasses and dividing into subclasses is an important and valuable part of domain modelling. The use of inheritance between classes reduces duplication in the model and makes sure common concepts are treated in the same manner.
An example of subclasses and superclasses is shown in the figure. Vehicle is a superclass over the subclasses Car and Train.
Two good rules for testing if it is correct to divide into subclasses: 100% rule: subclass conform to all of the superclass's required attributes and associations Is a-rule: In natural language test the sentence subclass is a superclass
.... often, a superclass will be abstract, while the subclasses are the ones that are implemented.