Generalization Relationship in Raptor
Overview
Let’s learn the concepts involved to diagram the Generalization relationship using the Raptor UML tool. The generalization relationship is used to identify the common things among the classes used in the program. This relationship is also called Inheritance. The common attributes and the common behavior are placed in the superclass. This is general for all the subclasses which inherit from the superclass.
Generalization
The superclass is the generalization of the subclass. The subclass is a specialization of the superclass. The connector used is shown in the diagram. The subclass can reuse the common attributes and behavior of the superclass. Any specializations that are specific to the subclass are implemented in the subclass.
The connector is an unfilled arrow with a triangle head. The relationship is read as “is-a” or “is-an” or “is a specialization of” etc.
For Example -> Dog is an Animal
Dog and Animal are classes in the relationship. The Animal can be an abstract superclass and the Dog is a concrete derived/child or subclass.
Raptor UML Diagram
Launch Raptor Tool.
Enable the UML mode in the tool.
Design the classes. To connect the classes use the “Inherits From” relationship.
Select the Base class and the subclass to connect the classes.
The triangle head of the connector in the relationship should be pointing to the superclass. *The common mistake people do is to place the head the other way around pointing to the subclass.*