Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As discussed previously in the book, a future version of the
StoryArchitect application may mirror
its data to a server, so that you can do your work on multiple devices.
That will require remote server communication.
When we communicate with remote servers, we always do so asynchronously. We send off a request, and some time later we are interrupted by an incoming response from the server. If you are retrieving an object, you cannot work with it immediately after making the call; you must instead wait for the result. Moreover, you must remember what you were doing when you sent the request, as that may have a bearing on what you do with the result.
Inside the Proxy, that just means
you split the calling code and the subsequent result handling code into at
least two methods: one for invoking the call, one for handling the result,
and perhaps another for handling a fault response.