0% found this document useful (0 votes)
71 views2 pages

Creating Generalization/Specialization Relationships Using Inheritance

Specialization is a relationship in object-oriented programming where a subclass inherits characteristics from a superclass, can add new components, and replace implementations of inherited methods. For example, a truck, car, and bus could all specialize from a vehicle superclass, inheriting common components like wheels while adding their own unique attributes. Specialization emphasizes similarities between classes while generalization refers to the broader superclass that specific subclasses specialize from.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views2 pages

Creating Generalization/Specialization Relationships Using Inheritance

Specialization is a relationship in object-oriented programming where a subclass inherits characteristics from a superclass, can add new components, and replace implementations of inherited methods. For example, a truck, car, and bus could all specialize from a vehicle superclass, inheriting common components like wheels while adding their own unique attributes. Specialization emphasizes similarities between classes while generalization refers to the broader superclass that specific subclasses specialize from.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

You want to implement generalization/specialization relationships from your

model in ABAP Objects.

Creating Generalization/Specialization Relationships

Using Inheritance

Specialization (UML) is a relationship in which one class (the subclass) inherits

all the main characteristics of another class (the superclass). The subclass can

also add new components (attributes, methods, and so on) and replace the

implementations with inherited methods. In the latter case, the method name in

the UML diagram is renamed within the subclass.

Figure 63: Example of Generalization/Specialization

Specialization is an implementation relationship that emphasizes similarities

of the classes. In the example above, the similarities of classes LCL_CAR,

LCL_TRUCK, and LCL_BUS are extracted to a superclass, LCL_VEHICLE.

Therefore, the components they have in common are only defined and

implemented in the superclass. They also exist in all subclasses.


Specialization is often described as an .is a. relationship. In this example, you

would say: .A truck is a (specific) vehicle..

Reversing the point of view is referred to as generalization.

You might also like