SAP INHERITANCE INTERFACES SAP Info












ARTICLE ( Version: 0002)

Inheritance and Interfaces
Interfaces are standalone constructions
within ABAP Objects that allow polymorphism of classes. This is because each class that implements an interface can implement its methods differently. Externally, all interface components look the same. Consequently, interface references can point to objects in any class that implements the corresponding interface.

Within ABAP Objects, interfaces and inheritance are fully compatible. Within an inheritance tree, you can implement any number of interfaces, but a given interface may only be implemented once in an inheritance tree. This ensures that the interface components have unique names throughout the inheritance tree (intf~icomp), and these components are contained in the class that implements the interface and in all of its subclasses. Interface references that can point to a class in an inheritance tree, can also point to all of its subclasses. Interface methods, once they have been implemented, are full members of a class, and can be redefined in its subclasses. However, you cannot define interface methods as abstract or final within the interface definition.

ARTICLE ( Version: 0003)

Inheritance and Interfaces
Interfaces are independent constructs in
ABAP Objects that support polymorphism of classes. The polymorphism of interfaces is based on the fact that each class implementing an interface can implement the methods of that interface differently. To the outside world, all interface components look similar which is why interface references can point to objects of all classes that implement the associated interface.

The interface concept exists independently of and in addition to the inheritance concept. inheritance. The classes of an inheritance tree can implement any number of interfaces but each interface can be implemented only once in each inheritance tree. This ensures that each interface component has a unique name in the entire inheritance tree intf~icomp and that, starting with the class that implements it, it is contained in all subclasses. Interface references that can point to a class of the inheritance tree can also point to all subclasses.
Having been implemented, interface methods are fully functioning
components of a class and can be redefined in subclasses.

ARTICLE ( Version: 0007)

Inheritance and Interfaces
Interfaces are independent constructs in
ABAP Objects that support polymorphism of classses. The polymorphism of interfaces is based on the fact that each class implementing an interface can implement the methods of that interface differently. To the outside world, all interface components look similar which is why interface reference variables can point to objects of all classes that implement the associated interface. The interface concept exists independently of and in addition to the inheritance concept.The classes of an inheritance tree can implement any number of interfaces but each interface can be implemented only once in each inheritance tree. This ensures that each interface component comp has a unique name in the entire inheritance tree intf~icomp and that, starting with the class that implements it, it is contained in all subclasses.
Interface reference variables
that can point to a class of the inheritance tree can also point to all subclasses. Having been implemented, interface methods are fully functioning components of a class and can be redefined in subclasses.

ARTICLE ( Version: 0008)

Inheritance and Interfaces
Interfaces are independent constructs in ABAP
Objects that support polymorphism of classses. The polymorphism of interfaces is based on the fact that each class implementing an interface can implement the methods of that interface differently. To the outside world, all interface components look similar which is why interface reference variables can point to objects of all classes that implement the associated interface. The interface concept exists independently of and in addition to the inheritance concept.The classes of an inheritance tree can implement any number of interfaces but each interface can be implemented only once in each inheritance tree. This ensures that each interface component comp has a unique name in the entire inheritance tree intf~icomp and that, starting with the class that implements it, it is contained in all subclasses.
Interface reference variables
that can point to a class of the inheritance tree can also point to all subclasses. Having been implemented, interface methods are fully functioning components of a class and can be redefined in subclasses.
Message text extract from SAP system. Copyright SAP SE.


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!