If I have an existing IInterface
descendant implemented by a third party, and I want to add helper routines, does Delphi provide any easy way to do so without redirecting every interface method manually? That is, given an interface like so:
IFoo = interface
procedure Foo1;
procedure Foo2;
...
procedure FooN;
end;
Is anything similar to the following supported?
IFooHelper = interface helper for IFoo
procedure Bar;
end;
or
IFooBar = interface(IFoo)
procedure Bar;
end;
TFooBar = class(TInterfacedObject, IFoo, IFooBar)
private
FFoo: IFoo;
public
procedure Bar;
property Foo: IFoo read FFoo implements IFoo;
end;
I'm specifically wondering about ways to that allow me to always call Foo1, Foo2, and Bar with a single variable reference (IFoo, IFooBar, or TFooBar), without switching between them, and without adding all of IFoo's methods to TFooBar.