Let's say we've got the following:
IFirst = Interface(IUnknown)
function GetStuff: Integer;
end;
ISecond = Interface(IUnknown)
function GetOtherStuff: Integer;
end;
TFirstSecond = class(TInterfacedObject, IFirst, ISecond)
private
function GetStuff: Integer; //implementation of IFirst
function GetOtherStuff: Integer; //implementation of ISecond;
end;
I have never liked the fact that in TInterfacedObject
there seems to be no way to distinguish between which methods implement which interfaces. Am I missing something? Does anyone know a way structure the code to do that? To designate that GetStuff
is the implementation of IFirst
and GetOtherStuff
is the implementation of ISecond
? ('Put a comment' is not the answer I'm looking for...)
I know I can use the 'implements' directive to define properties in TFirstSecond
for each interface and delegate the implementations to instances contained within TFirstSecond
, thereby segregating everything. But I'd like a shortcut...