 <p>This is why we have the REST (and SOAP) protocols.</p> <p>The desktop makes RESTful requests to your web application. Your web application receives the REST requests and does the real work.</p> <p>Your code exists in exactly one place -- the web.</p>