To async or not to async

Topics: CAB & Smart Client Software Factory
Dec 20, 2006 at 2:33 PM
originally posted by: bil_simser

We're calling some internal web services and have reference to them setup via the smart web reference recipe. All is fine, but there are some that are just plain small and simple and I'm wondering what makes you decide between one or the other?

For example, we need a series of numbers which represent some business number (number of hours spent on a project) that we need to call via a web service. It's a single number and the user can't proceed without it, so calling a web service async doesn't seem to make sense.

So the question is, as we have the web service setup for calling async, what's a best practice around how to determine async or not (do you just always use async calls even for values you have to wait for) and how do you use the smart web reference in synchronous mode?
Dec 20, 2006 at 2:38 PM
originally posted by: PJackson

We base the decision on whether the user can (or should) proceed with a process or do something else in the application while the service is being called. In general, though, we lean more toward asynch with synch reserved for very specific purposes: Authentication and Authorization being two examples.

If the user can't do something with a portion of the UI without the service having returned, but they could work in another area, we disable the section waiting on the service and let the user continue working as much as possible.

For synch, we just call the proxy directly and bypass the asynch with timeout classes generated by the recipe.