jeudi 24 janvier 2019

Would you recommend to implement a client-server architecture with client generating script code for the server to interpret? Are there pros and cons?

I am currently trying to implement a Java client (which is a java ee application running on wildfly 10 and is a server for a javascript front end client) to communicate with an instance of Rserve running on Ubuntu server.

The client is using REngine an API for Rserve and is therefore tightly coupled to the Rserve via the specific classes of this API. The communication is handled via a specific protocol see https://www.rforge.net/Rserve/ for further information.

Complex objects need to be created on the java side and assigned via a call of API functions, since they cannot simply be passed as R code to evaluate.

Since I found no solution for debugging the server via attaching to a running R session a colleague gave me the idea to let the java client generate the whole code (Parameters, functions via templates...) and pass it to the server to interpret it, so we can log the whole code that is executed on the server side.

My question is: Is this actually common practise and an accepted design pattern? Are there any resources on this? Are there any pros and cons other than the transparency gained and the extra work of parsing java objects to R code to let the assignment happen by passing a command as string instead of calling the API function?

Aucun commentaire:

Enregistrer un commentaire