OK I am sure all of you have come up against this beast at some time during your development process. In order to get results from a backend server you have to make a series of calls to fetch data. And to make it worse the subsequent calls are based on data collected at the previous steps of this calls sequence. So chaining these calls is what one has to do to achieve his goal.
>From my understanding the command pattern has been proposed to mitigate this problem. I have seen some libraries (gwt-dispatch namely) that implement this pattern, but, unless I am mistaken, they are only doing so for the GWT-RPC mechanism. For the case of using the RequestBuilter and HTTP however I couldn't find out a good chaining example that uses the command pattern. So far I have had some good results using the Chain of Responsibility pattern. However the solution - at least as I implemented it - is not as well formated as I would have hoped for. The problem is that I need to be aware of the paths my chain takes. For example lets assume that at a step of the chain I need to branch towards more leaves rather than having only one leaf. My solution has been to keep track, by a counter, the number of paths my chain follows and at the end collect them to a single point and when all have been collected to send the results for processing to the other elements of the UI. I feel though that I am doing too many stuff the "wrong way" and there is a better way to organise my code to achieve the above functionality. So my question is, do you know a better way to chain the numerous callbacks that are needed to process a series of asynch HTTP calls? Is there a library that implements the command pattern for HTTP calls as well - not only the GWT-RPC mechanism? Any good examples I could look into? Thx in advance for your replies! -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.