Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

8. Advanced Model Topics > Handling Asynchronous Behavior

Handling Asynchronous Behavior

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial