You will find out in SQLite3Commons.pas
all classes
implementing this interface communication.
There are two levels of implementation:
- A services catalog, available in TSQLRest.Services
property, declared as TServiceContainer
(with two
inherited
versions, for each side);
- A service factory for each interface, declared as
TServiceFactory
(also with two inherited
versions,
for each side).
In fact, TServiceFactory.Create constructor
will retrieve all
needed RTTI information of the given interface, i.e. GUID, name and all methods
(with their arguments). It will compute the low-level stack memory layout
needed at execution. And the corresponding "contract" will be computed, to
validate that both client and server expect the exact same
interface
.
On the server side, TServiceFactoryServer.ExecuteMethod
method
(and then a nested TServiceMethod.InternalExecute
call) is used to
prepare a valid call to the implementation class code from a remote JSON
request.
On the client side, a TInterfacedObjectFake
class will be
created, and will emulate a regular Delphi interface call using some on-the-fly
asm code generated in the TServiceFactoryClient.Create
constructor.