Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to separate the layer of the communication and processing?
    primarykey
    data
    text
    <p>I created an application that provides several services. Each service provides a specific processing capabilities, except one service (that is the main service) that returns true or false to the clients which request if the specified processing capabilities is available or not.</p> <p>Now I would modify the application, leaving the main service unchanged and adding the support for the installation of plugin with new processing capabilities: each plugin should add new processing capabilities without the need of implement a new service, but after installing the new plugin, a new service should be avaible. In this way, a plugin should not handle the communication layer. In other words, I would like to separate the layer of the communication and processing, in order to simplify the creation of new plugins.</p> <p>Is it possible?</p> <p>I could create two services: the main service and the service for processing. The first service may be used by clients to know if a certain feature is present on the server (for example, clients may ask the server if it has installed the plugin that provides the functionality for solving differential equations). The second service could be used to send a generic task and to receive a general result, for example:</p> <pre><code>Result executeTask(Task task); </code></pre> <p>where <em>Result</em> and <em>Task</em> are abstract classes...</p> <p>For example, if I develop a plugin to solve the differential equations, I first create the classes for transferring data:</p> <pre><code>public class DifferentialEquationTask : Task // This class contains the data of the differential equation to be solved. ... public class DifferentialEquationResult : Result // This class contains the the result. ... </code></pre> <p>Therefore, the client should instantiate a new object DifferentialEquationTask and pass it to the method of the second service:</p> <pre><code>DifferentialEquationTask myTask = new DifferentialEquationTask(...); ... Result result = executeTask(myTask); // called by basic application // The second service receives myTask as a Task object. // This Task object also contains the destination plugin, so myTask is send // to the correct plugin, which converts it to DifferentialEquationTask ... myResult = result as DifferentialEquationResult; // received by the client </code></pre> <p>Moreover, each plugin should have a version for the application server and a version for the client application.</p> <p>An alternative would be to include the service in the plugin itself: in this way, a new plugin should implement a new functionality and expose it via an additional service. In summary, I thought the following two alternatives:</p> <ol> <li>a main service to ask the server if it has a plugin or not, and a second service to deliver tasks at the correct plugin;</li> <li>a main service to ask if the server has a plugin or not, and various additional services (an additional service for each plugin installed).</li> </ol> <p>In order to choose the best approach, I could use the following requirements:</p> <ul> <li>Which of the two alternatives may provide better performance?</li> <li>What advantages would be obtained using a new service for each plugin than using a single service that delivers tasks at the correct plugin?</li> <li>Which of the two alternatives simplifies the development of a new plugin?</li> </ul> <p>Being a novice, I was wondering if there was a better approach...</p> <p>Thanks a lot!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload