In the Blog post about the new V9.0 of Elements is something mentioned about " interface extensions and default interface implementations"
Where can I find more info about this? I use Interface delegation all the time to create mix-ins so I am very interested.
You can do something like this:
type
IMyInterface = public interface
method Test;
end;
MyInterfaceExtension = public extension class(IMyInterface)
public
method Test;
begin
raise new NotSupportedException('Not supported yet!');
end;
end;
Then if a class does NOT implement Test, it will call the default one, from the extension.
2 Likes