My project is based on client and server communication in which at different locations, different version of server may be present. Client, based on nearest server's version number uses specific stub file to communicate with it.
Now, while writing the code, at every place where i'm using the stub, i've to check which version of server is present. This seems very inefficient because there are many places in the code, where i've to check stub version.
The constraint is that exactly one server is present around the client. And once client has started, the server to which it is going to communicate will not change. For communication we are using Jax RPC.
Any suggestions for better design?