Base class member implement interface member

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Armin Zingler

    #1

    Base class member implement interface member

    Hi group,

    how can I have a base class member implement an interface member?

    Example:
    class a
    sub Member1
    end sub
    end class

    interface I
    sub member1
    sub member2
    end interface

    class b
    inherits a
    implements I

    sub member2 implements I.member2
    end sub

    mybase.member1 implements I.member1 <===
    end class

    The last (not compilable) line shows what's my intention: The base class
    contains the implementation of Member1. As B is derived from A, it should be
    possible to have (the inherited) Sub Member1 implement I.Member1 because
    Member1 is also a part of class B. Isn't it possible?

    Currently I have to write the implementation in B and delegate the call to
    MyBase:

    sub I_member1 implements I.Member1
    mybase.member1
    end sub

    The more members, the more work... And it gets (a little) slower due to
    delegation.


    Armin

Working...