Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

interfaces

Former Member
0 Likes
850

Hi i have some doubts about interfaces . can we declares interfaces inside interface ie am talking about classes and interfaces . If possible how to access insider interface and how to implement it. Any information is credited.

thank you .

lavanya

Edited by: lavanya reddy on Jan 11, 2008 11:43 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
827

yes we can declare the interface with in the interface.

please check the fallowing program which will describes

the way how to declare the interface with in the another interface and how to implement it.

interface if1.

methods:m1,

m2.

endinterface.

interface if2.

methods:m3.

interfaces:if1.

endinterface.

class a definition.

public section.

interfaces:if2.

endclass.

class a implementation.

method if2~m3.

write:/ 'This is second interface method'.

endmethod.

method if1~m1.

write:/ 'This is first interface method1'.

endmethod.

method if1~m2.

write:/ 'This is first interface method2'.

endmethod.

endclass.

start-of-selection.

data:obj type ref to a.

create object obj.

call method:obj->if2~m3.

call method:obj->if1~m1.

call method:obj->if1~m2.

4 REPLIES 4
Read only

Former Member
0 Likes
828

yes we can declare the interface with in the interface.

please check the fallowing program which will describes

the way how to declare the interface with in the another interface and how to implement it.

interface if1.

methods:m1,

m2.

endinterface.

interface if2.

methods:m3.

interfaces:if1.

endinterface.

class a definition.

public section.

interfaces:if2.

endclass.

class a implementation.

method if2~m3.

write:/ 'This is second interface method'.

endmethod.

method if1~m1.

write:/ 'This is first interface method1'.

endmethod.

method if1~m2.

write:/ 'This is first interface method2'.

endmethod.

endclass.

start-of-selection.

data:obj type ref to a.

create object obj.

call method:obj->if2~m3.

call method:obj->if1~m1.

call method:obj->if1~m2.

Read only

Former Member
0 Likes
827

hi lavanya,

An interface can be composed of nay number of different component interfaces.All the interfaces are equllay valid on one level.

If a component interface itself is a composite ie,it contains its own component interfaces-then the nesting hierarchy is irrevelant for the composition of the interface.it is relevant ,however for accessing the interface components.

To access sa component comp of a component interface ifac within a composite interface,you can use the expression ifaccomp with the interface component selector().Multiple use of interface component selector in an identifier (such as ifac1ifac2comp ) is generally not supported.

regards,

sravanthi

Read only

Former Member
0 Likes
827

I got my answer.