A generalization is a directed relationship between a more general classifier (superclass) and a more specific classifier (subclass).
A typical example of generalization involves the personal and corporate customers of a business. They have differences but also many similarities.
The similarities can be placed in a general Customer class (the supertype), with Personal Customer and Corporate Customer as subtypes.
This phenomenon is also subject to various interpretations at the various perspectives of modeling. Conceptually, we can say that Corporate Customer is a subtype of Customer if all instances of Corporate Customer are also, by definition, instances of Customer.
A Corporate Customer is then a special kind of Customer. The key idea is that everything we say about a Customer:
- associations,
- attributes,
- operations
is true also for a Corporate Customer.
From a software perspective, the obvious interpretation is inheritance:
The Corporate Customer is a subclass of Customer.
In mainstream OO languages, the subclass inherits all the features of the superclass and may override any superclass methods.