Jetzt mal etwas out-of-the-box gedacht (weiß nicht, ob das hier taugt):
Delphi-Quellcode:
type
IBase = interface
end;
ISub1 = interface (IBase)
end;
ISub2 = interface (IBase)
end;
IBoth = interface
function GetSub1: ISub1;
function GetSub2: ISub2;
property Sub1: ISub1 read GetSub1;
property Sub2: ISub2 read GetSub2;
end;
type
TFluxKompensator = class(TInterfacedObject, ISub1, ISub2, IBoth)
function GetSub1: ISub1;
function GetSub2: ISub2;
end;
function TFluxKompensator.GetSub1: ISub1;
begin
result := Self;
end;
function TFluxKompensator.GetSub2: ISub2;
begin
result := Self;
end;