Confirmation sur la déclaration d'interfaces à implémenter
je pars de
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
IBaseInterface = interface
...
end;
ISpecificInterface = interface(IBaseInterface)
...
end;
TMyObject = class(TInterfacedObject, ISpecificInterface)
...
end; |
Naievement, je m'étais dit, TMyObject déclare qu'elle implémente IBaseInterface et ISpecificInterface
or quand je fais
Code:
1 2 3 4
|
function TestFn: IBaseInterface
result := TMyObject.Create as IBaseInterface;
end; |
Il me dit que cette interface n'est pas implémentée.
Il faut donc que je fasse
Code:
1 2 3 4
|
TMyObject = class(TInterfacedObject, IBaseInterface, ISpecificInterface)
...
end; |
Est-ce absolument nécessaire ?