I'm trying to understand TVirtualInterface class.
{$APPTYPE CONSOLE}
uses
SysUtils, Rtti;
type
ISpecificInterface = interface(IInvokable)
['{281D8B97-397E-430A-895A-9CA4E1F5FB5F}']
procedure SpecificProcedure;
end;
procedure AProcedure(Method: TRttiMethod; const Args: TArray<TValue>;
out Result: TValue);
begin
Writeln(Method.ToString);
end;
var
ISpecificInterfaceInstance: ISpecificInterface;
begin
ISpecificInterfaceInstance := TVirtualInterface.Create
(TypeInfo(ISpecificInterface), AProcedure) as ISpecificInterface;
ISpecificInterfaceInstance.SpecificProcedure;
end. // TVirtualInterface ref. counter is decremented
What's the benefit of implement an interface at runtime ?
What is the use of space ?