You are not logged in.
Pages: 1
The current ServiceRegister uses a TInterfacedClass for aImplementationClass
It would clean up my code soooo much if the aImplementationClass would be of type... TMormotInterfacedClass
interface
type
TMormotInterfacedObject=class(TInterfacedObject)
public
constructor Create; virtual;
end;
implementation
constructor TMormotInterfacedObject.Create;
begin
inherited;
end;
As it would allow overriding the constructor to initialize my interfaced objects rather than overriding the AfterConstruction method...
Yes, unfortunately it will very likely break some code. (Well, unless a overloaded ServiceRegister method is created. I would not recommend the overloaded method for KISS 's sake - at least mark it as deprecated!)
Whaddyathink?
Hans
Offline
Good idea.
I've added TInterfacedObjectWithCustomCreate kind of class, making easy to use virtual constructors for TSQLRestServer.ServiceRegister().
So you do not change the ServiceRegister() method, just inherits from TInterfacedObjectWithCustomCreate your custom class, and your overriden constructor will be executed.
Offline
Ah that's cool too... - Thx
Offline
Pages: 1