Generalization - modelint/shlaer-mellor-metamodel GitHub Wiki
A generalization is a type of Relationship that abstracts the concept of mutually exclusive sets.
Generalization may be used when a proposed Class features Attributes, behavior, Relationships and policies common to all instances, but also establishes Attributes, behavior, Relationship and policies specific to certain subgroups of instances.
If we consider the set of all aircraft, for example, we might see Attributes such as altitude, airspeed, heading and so forth which apply to any aircraft. But certain aircraft, such as helicopters may land on a helipad while non-helicopters may only land on a runway. A Generalization Relationship, as shown below, may establish a Superclass to represent aircraft in general and two subclasses, Fixed Wing Aircraft
and Rotary Wing Aircraft
to establish a partition on the set of all aircraft.
images/relationship-subsystem/generalization-10.png
A real world entity in a Generalization is represented by a single Superclass instance and a single Subclass instance. There is no such thing as an Aircraft
, according to the model shown above, which is not either a Fixed Wing Aircraft
or a Rotary Wing Aircraft
. Also, there is no such thing as an Aircraft
which is both, again, according to the model. Different requirements, accommodating VTOL aircraft, for example, may necessitate a different model and possibly a combination of multiple Generalizations and additional Associations.
Certain tags should be added to class diagrams when translated from miUML to OMG UML. Each Superclass should be tagged { abstract } and each Generalization should be tagged { disjoint, complete }. Since all Generalizations in Shlaer-Mellor conform to these tags, they can be safely assumed.
images/relationship-subsystem/generalization-20.png
Identifiers
- Rnum + Domain
Attributes
No non-referential attributes