#1 2020-02-12 09:52:34

sakura
Member
From: Germany
Registered: 2018-02-21
Posts: 228
Website

TServiceFactoryClient kind of virtual

Hello Arnaud,

further diving into mORMot for a new project, I have hit a small roadblock.

On the server, it is fairly easy to create custom URI patterns, which allows us to nicely create multiple modules with their unique roots in the server.

From the client, that is harder to manage, as far as I have seen. So, my solution would be following:

Overriding TSQLRestClient.ServiceContainer to return my own implementation. Works out of the box.

Problem. both instances of TServiceContainer.AddInterface should be either virtual, so I can implement my own class of TServiceFactoryClient,
or
TServiceContainer should have a property returning the TServiceFactoryClientClass to b used, to implement custom solutions. Which would your preferred way?

TServiceFactoryClient contains virtual methods, so it seems to be designed to be overriden. :-)

Further, in TServiceFactory.Create, you directly define fInterfaceURI to be ToUTF8(aInterface^.Name) (excluding a possibly leading "I" from the name. How about moving that into a virtual method too, so it can easily be adapted?


Thanks for the input, I would feel free to change as advised and create a pull request.

Kind regards,
Daniel Wischnewski

Offline

#2 2020-02-17 07:49:23

sakura
Member
From: Germany
Registered: 2018-02-21
Posts: 228
Website

Re: TServiceFactoryClient kind of virtual

Not having received any directions, I tried to implement it the most direct way and created a simple patch and pull request: https://github.com/synopse/mORMot/pull/271

Offline

#3 2020-02-17 09:19:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: TServiceFactoryClient kind of virtual

Merged.

Offline

Board footer

Powered by FluxBB