Welcome to SAP Central
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Fundamentals of inheritance in ABAP Objects

Go down

Fundamentals of inheritance in ABAP Objects Empty Fundamentals of inheritance in ABAP Objects

Post  Uma_ABAP Sun Apr 01, 2012 12:57 pm


The concept of inheritance is used to incorporate the properties of an existing class into a new class .The beauty of this feature is that the methods and the attribute of the existing class need not to be coded into the new class ,as well as new features can be added into the the new class .

In OOP inheritance can be multiple as well as multi-level ,but in ABAP only multi-level
inheritance is possible .In Multiple Inheritance a new class can inherite properties of
several class .Where as multi-level inheritance is an inheritance of hiercial fashion . In OOP terminology the parent class is called the super class and the derieved class is called the subclass.

“If you do not add any new declarations to the subclass, it contains the same components as the superclass. However, only the public and protected components of the superclass are visible in the subclass. Although the private components of the superclass exist in the subclass, they are not visible. “

“You can declare private components in a subclass that have the same names as private components of the superclass. Each class works with its own private components. Methods that a subclass inherits from a superclass use the private attributes of the superclass, and not any private components of the subclass with the same names. “

If the superclass does not have a private visibility section, the subclass is an exact replica of the superclass. However, you can add new components to the subclass. This allows you to turn the subclass into a specialized version of the superclass.

Uma_ABAP

Posts : 56
Join date : 2012-03-31

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum