My only criticism of this design is that it only captures a part of the use cases where the transport mechanism needs override. That is, it helps in cases where one is making HTTP requests, and needs to modify HTTP request parameters or the body, but it leaves out the cases where one can't make direct requests (using XHR). The RequestBuilder stuff is very tightly bound to XHR. The most famous and important example of this is writing gadgets using GWT and RPC. You can't use XHR (not all proxies will pass it because of the mime-type) and thus you must use the Javascript makeRequest() function, or inject <script> tags and tunnel the payload over JSONP. I have implemented both of these techniques, and it seems to me that the only way to do it is to override the RPC generator. I have a module which overrides the ServiceInterfaceGeneratorProxy to replace the ProxyCreator with one whose RemoteServiceProxy method has an override on doInvoke().
The other reason to use makeRequest() is because it can leverage the gadget container to sign the requests, so that the RemoteService can verify that RPC request authorization. -Ray On Wed, Mar 18, 2009 at 4:16 PM, <[email protected]> wrote: > > Silly Rietveld didn't send my inline comments. > > > http://gwt-code-reviews.appspot.com/13804/diff/1/3 > File user/src/com/google/gwt/user/client/rpc/RpcRequestBuilder.java > (right): > > http://gwt-code-reviews.appspot.com/13804/diff/1/3#newcode29 > Line 29: public class RpcRequestBuilder { > Looks good, but you should add a unit test that confirms each override > is actually called. > > http://gwt-code-reviews.appspot.com/13804/diff/1/5 > File user/src/com/google/gwt/user/client/rpc/ServiceDefTarget.java > (right): > > http://gwt-code-reviews.appspot.com/13804/diff/1/5#newcode19 > Line 19: * An interface implemented by client-side RPC proxy objects. > Cast the object > Can you fix this sentence while you're here? "Cast the object...should > be cast..." > > http://gwt-code-reviews.appspot.com/13804 > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
