Abstract generalization

In class diagrams, an abstract generalization is a dependency relationship in which a mapping exists between the parent and the child.

An abstract generalization is much like the generalization or inheritance relationship between classes. With abstract generalization, a parent class forces the child class to inherit certain functionality to create an interface.

Note: In C/C++, an abstract generalization is achieved through pure virtual operations. A parent class that contains a pure virtual operation is called an abstract base class. The abstract base class can never be instantiated. A child class must override the pure virtual operation in its declaration; otherwise, it cannot be instantiated. The abstract base class forces a design interface on a child class.

For example, when you visualize a C/C++ class and abstract generalization, a parent class can become an interface or design template. The Vehicle class is a parent class that uses an abstract generalization. The Vehicle class becomes a design template or interface for all its children by forcing them to use certain operations. The Child class Boat inherits several operations from the Vehicle class. The Boat class cannot be implemented without using those operations. Therefore, the Vehicle class acts as a design interface for all its children.

In UML visualization class diagrams, an abstract generalization is shown by differentiating the title of the class from other classes. A parent class that uses an abstract generalization has a class title in italic letters. As well, all operations that are inherited by its children (pure virtual operations) also appear in italics.

The following figure illustrates the differences between a normal generalization relationship and an abstract generalization relationship.

C/C++ normal generalization C/C++ abstract generalization
A regular C/C++ generalization is displayed. A C/C++ abstract generalization is displayed.

Related concepts
Association relationships
Dependency relationships
Generalization relationships
Manifestation relationships
Owned element association relationships
Permission relationships
Adornments for unresolved references
Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.