BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Udi Dahan on Service-Oriented Composition

by Jan Stenberg on Aug 03, 2014 |

In a Service-Oriented Architecture (SOA) where client-side components for one service runs in the same process as components for other services we need to collect several logical calls into one larger physical call, Udi Dahan explains answering a question of how to avoid the high cost, in terms of client to server communication, that otherwise could be substantial.

Demonstrating how to optimize client-server round trips when using loosely coupled components both on the client-side and the server-side, Udi, an authority on service-oriented architecture and creator of NServiceBus, gives an example where an event raised on the client side, e.g. a clicked button, result in two components requiring access to their respective server component in order to get data.

Instead of a regular Ajax call each component subscribing to the event uses a client-side wrapper library to register a call-back method to be called when data is returned from the server. This library is aware of the context of the event being processed and therefore holds all requests in memory until all call-backs have been registered at which time it makes one physical call to the server with all the requests.

On the server side a corresponding library unpacks all the independent requests and invokes the corresponding server component for each request. When the result from all components has been received they are returned as one result to the client.

The client library, when receiving the response, unpacks and dispatches the individual results to each client component at which point the event has been fully handled.

Udi emphasizes that most of the code written for both client and server is transparent to this wrapper library. What’s added is a generic packing and unpacking library enabling support for client and server side composition with lots of small components doing logical calls while minimizing the actual calls made between a physical client and a physical server.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT