In my company someone implemented a remote object (2 different channels one HTTP and TCP) for interprocess comunication, this remote object have just an Execute method with 2 parameters: ActionName and Parameters.
ActionName is an enum type defining the Action to be executed at the server.
Parameters is an String (that usually contains objects serialized using xml to string)
The return type of the Execute method is an String (and again, usually contains objects serialized using xml)
The serialization method used is a custom one described in an interface the object has to implement it and it's usually a creation of an XmlDocument, and adding a node for the current object, if the object has a relationship with other objects it is appended as a new node to the existing XmlDocument, it can be an array of objects, and then it is converted to an string.
The objects serialized are usually POJOS, just models from the database, with accesors to set and get the model attributes.
So with this we can pass objects to the server as parameters and the server can return objects serialized.
My question is if there isn't a better way to pass objects from both sides?
There is an overhead of serializing and deserializing the parameters and the return responses.
The server usually sends objects instantiated from the database and then they are serialized and sent to the client.
I think that serializing and deserializing is hitting hard our performance, sometimes the response is big (an array of N-objects serialized) and takes time, the client doesn't have a way to track how much time the response would take.
Even if the server and client are on the same machine they use the same method, there has to be a better way to exchange information locally.
I think that I described very well our situations, any help or insights would be really appreciated.