Hello everybody
I have to find a way to wrap each and every RemObjects and DataAbstract service method call in order to apply some kind of generic business logic which will apply on every call. I have found Hooks like OnActivate and OnDeactivate on the TRORemoteDateModule, yet those are being called once per DataModule lifecycle and not once per service call.
I need to do something like this…
procedure MyClass.MyMostLikelyOverridenUnknownMethod;
var
State: TSomeState;
begin
State := TSomeState.Create;
// I somehow need to make that state accessible to the service method itself
// but by parameter is not going to work since this would change its signature…
OriginalServiceMethodDefinedWithinTheRODL;
if State.WhatEver then
raise Exception.Create(‘sdf’);
end;
P.S.
I suppose I can do all this by OnActivate and OnDeactivate and member variables of the Service, but this works only as long as the service instantiation strategy creates a new Service instance upon each and every call…
Best regards
Francois