92
Designing a Service's Interaction Layer
Delegating to existing business logic
Handling errors
It is generally advisable to do all common processing such as security
checks, logging, auditing, input validation, and so forth for requests at the inter
action layer as soon as a request is received and before passing it to the processing
layer.
3.4.3 Delegating Web Service Requests to Processing Layer
After designing the request preprocessing tasks, the next step is to design how to
delegate the request to the processing layer. At this point, consider the kind of pro
cessing the request requires, since this helps you decide how to delegate the request
to the processing layer. All requests can be categorized into two large categories
based on the time it takes to process the request, namely:
A request that is processed in a short enough time so that a client can afford to
block and wait to receive the response before proceeding further. In other
words, the client and the service interact in a synchronous manner such that the
invoking client blocks until the request is processed completely and the re
sponse is received.
A request that takes a long time to be processed, so much so that it is not a good
idea to make the client wait until the processing is completed. In other words,
the client and the service interact in an asynchronous manner such that the in
voking client need not block and wait until the request is processed completely.
Note:
When referring to request processing, we use the terms synchronous
and asynchronous from the point of view of when the client's request processing
completes fully. Keep in mind that, under the hood, an asynchronous interaction
between a client and a service might result in a synchronous invocation over the
network, since HTTP is by its nature synchronous. Similarly, SOAP messages
sent over HTTP are also synchronous.
<
New Page 1
Web Hosting Apache