Skip to Content
0
Feb 17, 2009 at 06:40 AM

Accessing deep components of interface

21 Views

Hi,

I found this one in the SAP slides on OO ABAP. Do you find below two things contradictory:

At one place they say:

{

CLASS c1 DEFINITION.

PUBLIC SECTION.

INTERFACES i4.

ENDCLASS.

CLASS c1 IMPLEMENTATION.

METHOD i1~meth. ... ENDMETHOD.

METHOD i2~meth. ... ENDMETHOD.

METHOD i3~meth. ... ENDMETHOD.

ENDCLASS.

*Each interface is implemented once.

All interfaces are implemented at the same level

*Each interface component is unique.

}

And in another slide they say:

{

*Inside: Access to deep components of compound interfaces via aliases only.

*Outside: Narrowing cast.

INTERFACE i1.

METHODS m1.

ENDINTERFACE.

INTERFACE i2.

INTERFACES i1.

ALIASES m2 FOR i1~m1.

ENDINTERFACE.

INTERFACE i3.

INTERFACES i2.

ALIASES m3 FOR i2~m2.

ENDINTERFACE.

}

Why can't we do directly i1~m1 in interface i3?

Regards,

Bhaskar Tripathi