Author: Am

5th Symposium on Advances in Science & Technology
5thSASTech 12-17 may, 2011 , Mashhad- Iran

A Comprehensive Assessment and Comparison of Asynchronous Invocation Patterns and Frameworks
Amir Moazeni
Shahab Danesh Institute of Higher Education
a.moazeni@shahabdanesh.ac.ir

Abstract:
Asynchronous invocations are an important functionality in the context of distributed object frameworks, because in many situations clients should not be blocked during remote invocations. There should be a loose coupling between clients and remote services. Popular web service frameworks, such as Apache Axis, offer only synchronous invocations (over HTTP). An alternative are messaging protocols but these implement a different communication paradigm. When client asynchrony is not supported, client developers have to build asynchronous invocations on top of the synchronous invocation facility. But this is tedious, error-prone, and might result in different remote invocation styles used within the same application. In this paper the challenges of asynchronous invocation of web services is discussed. Besides, we have investigated and compared a set of client asynchrony patterns and frameworks.

Asynchronous Invocation Patterns
In this section, we present a set of client asynchrony patterns [13] that are part of a larger pattern language for distributed object communication.

FIRE AND FORGET
Your server application provides remote objects with operations that have neither return value nor report any errors [13].
Therefore, in FIRE AND FORGET invocation, the client proxy sends the invocation across the network, returning control to the caller immediately. The client does not get any acknowledgement from the remote object receiving the invocation.

Sync with Server
FIRE AND FORGET is a useful but extreme solution in the sense that it can only be used if the client can really afford to take the risk of not noticing when a remote invocation does not reach the targeted REMOTE OBJECT. The other extreme is a synchronous call where a client is blocked until the remote method has executed successfully and the result arrives back. Sometimes the middle of both extremes is needed [13].
in SYNC WITH SERVER invocation, the client sends the invocation, as in FIRE AND FORGET, but waits for a reply from the server application informing it about the successful reception, and only the reception, of the invocation. After the reply is received by the client proxy, it returns control to the client and execution continues. The server application independently executes the invocation.

Poll Objects
There are situations, when an application needs to invoke an operation asynchronously, but still requires knowing the results of the invocation. The client does not necessarily need the results immediately to continue its execution, and it can decide for itself when to use the returned results [13].
in POLL OBJECTS pattern, as part of the distributed object framework, provide POLL OBJECTS that receive the result of remote invocations on behalf of the client. The client subsequently uses the POLL OBJECT to query the result. It can either just query (“poll”), whether the result is available, or it can block on the POLL OBJECT until the result becomes available. As long as the result is not available on the POLL OBJECT, the client can continue asynchronously with other tasks.

Result Callback
The client needs to be actively informed about results of asynchronously invoked operations on a remote object. That is, if the result becomes available to the client proxy, the client wants to be informed immediately to react on it. In the meantime the client executes concurrently [13].
Therefore, provide a callback-based interface for remote invocations on the client. Upon an invocation, the client passes a callback object to the client proxy. The invocation returns immediately after sending the invocation to the server. Once the result is available, the client proxy calls a predefined operation on the callback object, passing it the result of the invocation.

Comparing asynchronous invocation patterns

	Result to client	Ack to client	Responsibility for result
Fire and Forget	No	No	No
Sync with Server	No	Yes	No
Poll Objects	Yes	Yes	Client is responsible
Result Callback	Yes	Yes	Client is informed via callback

Asynchronous Invocation Frameworks
In this section, we explain some frameworks designed to implement the client-side asynchrony patterns, explained in the previous section.

ARMI framework
This framework’s design is based on Java RMI. Two main drawbacks of ARMI are: ARMI only supports one of the asynchronous invocation patterns (Poll Objects) and it is not applicable in www for web service invocations.
ZDun frameworks
This framework supports four asynchronous invocation patterns. It is implemented based on Apache Axis and provides different structures for different invocation patterns. Indeed the programmer cannot use this framework uniformly.
EDAMI framework
dependency between program codes and return values is an important point which has not been considered in previous frameworks. In EDAMI framework the concurrency is improved by putting the dependent codes in a thread and executing the threads independently. Middleware-independency is another important point which is considered in this framework. This framework provides RESULT CALLBACK pattern and other patterns are not supported in this framework.

5. Conclusions and future work
In this paper we evaluated the four asynchronous invocation patterns namely Fire and Forget, Sync with Server, POLL OBJECTS and RESULT CALLBACK and usages of each pattern are mentioned. In the rest of paper we evaluated and compared the asynchronous invocation frameworks: ARMI, ZDun and EDAMI. ZDun framework supports the four asynchronous patterns. An important drawback of this framework is its complexity leading to difficulty in the framework’s usage. The programmer should decide that which pattern is suitable in the specific situation, then uses the appropriate class for creating the asynchronous call. For further work it is recommended to purpose a framework which recognizes the optimum pattern automatically from program code and create the call.

References
H.Adams, Asynchronous operations and Web services, IBM, Jun 2002
C. Alexander (1979) The Timeless Way of Building. Oxford Univ. Press.
Apache Software Foundation. Web services invocation framework (WSIF). http:// ws.apache.org/wsif/, 2002.
Apache Software Foundation. Apache axis. http://ws.apache.org/axis/, 2003.
D. Box, D. Ehnebuske, G. Kakivaya, A. Layman, N. Mendelsohn, H. F. Nielsen, S. Thatte, and D. Winer. Simple object access protocol (SOAP) 1.1. http://www.w3.org/TR/SOAP/, 2000.
T. Bray, J. Paoli, and C. Sperberg-McQueen. Extensible markup language (XML) 1.0. http://www.w3.org/TR/1998/REC-xml-19980210, 1998.
E. Christensen, F. Curbera, G. Meredith, and S. Weerawarana. Web services description language (WSDL) 1.1. http://www.w3.org/TR/wsdl, 2001.
R.Clarok, Exploring the Dark Side of SOAs, ftponline.com, WebLogicPro, Dec 2004
Soheil Toodeh Fallah, Ehsan Zaeri Moghaddam, and Saeed Parsa, “An Event-Driven Pattern for Asynchronous Invocations In Distributed Systems” , International Journal of Computer Science and Network Security, VOL.7 No.4, April 2007
Rajeev R.Raje, Joseph I.William, Michael Boyles , “An Asynchronous Method Invocation (ARMI) Mechanism For Java”, 2003
S.Srinath, A.Ranabahu, Axis2-Future of Web Services, Jax Magazine, Jun 2005
M. Voelter, M. Kircher, and U. Zdun. Object-oriented remoting: A pattern language. In Proceeding of The First Nordic Conference on Pattern Languages of Programs (VikingPLoP 2002), Denmark, Sep 2002.
Markus Voelter, Michael Kircher, Uwe Zdun, Michael Englbrecht , “Patterns For Asynchronous Invocations In Distributed Object Framework” , In proceedings of EuroPlop, Germany , 2003
ZDun. Uwe, et al, "Pattern-Based Design of an Asynchronous Invocation Framework from Web Services", International Journal of Web Service Research, Volume 1, No. 3, 2004

Newsletter Title

Page #

Inside Story Headline

This story can fit 150-200 words.
One benefit of using your newsletter as a promotional tool is that you can reuse content from other marketing materials, such as press releases, market studies, and reports.
While your main goal of distributing a newsletter might be to sell your product or service, the key to a successful newsletter is making it useful to your readers.
A great way to add useful content to your newsletter is to develop and write your own articles, or include a calendar of upcoming events or a special offer that promotes a new product.
You can also research articles or find “filler” articles by accessing the World Wide Web. You can write about a variety of topics but try to keep your articles short.
Much of the content you put in your newsletter can also be used for your Web site. Microsoft Publisher offers a simple way to convert your newsletter to a Web publication. So, when you’re finished writing your newsletter, convert it to a Web site and post it.

“To catch the reader's attention, place an interesting sentence or quote from the story here.”

Inside Story Headline

This story can fit 100-150 words.
The subject matter that appears in newsletters is virtually endless. You can include stories that focus on current technologies or innovations in your field.
You may also want to note business or economic trends, or make predictions for your customers or clients.
If the newsletter is distributed internally, you might comment upon new procedures or improvements to the business. Sales figures or earnings will show how your business is growing.
Some newsletters include a column that is updated every issue, for instance, an advice column, a book review, a letter from the president, or an editorial. You can also profile new employees or top customers or vendors.

Inside Story Headline

This story can fit 75-125 words.
Selecting pictures or graphics is an important part of adding content to your newsletter.
Think about your article and ask yourself if the picture supports or enhances the message you’re trying to convey. Avoid selecting images that appear to be out of context.
Microsoft Publisher includes thousands of clip art images from which you can choose and import into your newsletter. There are also several tools you can use to draw shapes and symbols.
Once you have chosen an image, place it close to the article. Be sure to place the caption of the image near the image.

Volume 1, Issue 1

Page #

Inside Story Headline

This story can fit 150-200 words.
One benefit of using your newsletter as a promotional tool is that you can reuse content from other marketing materials, such as press releases, market studies, and reports.
While your main goal of distributing a newsletter might be to sell your product or service, the key to a successful newsletter is making it useful to your readers.
A great way to add useful content to your newsletter is to develop and write your own articles, or include a calendar of upcoming events or a special offer that promotes a new product.
You can also research articles or find “filler” articles by accessing the World Wide Web. You can write about a variety of topics but try to keep your articles short.
Much of the content you put in your newsletter can also be used for your Web site. Microsoft Publisher offers a simple way to convert your newsletter to a Web publication. So, when you’re finished writing your newsletter, convert it to a Web site and post it.

Inside Story Headline

This story can fit 100-150 words.
The subject matter that appears in newsletters is virtually endless. You can include stories that focus on current technologies or innovations in your field.
You may also want to note business or economic trends, or make predictions for your customers or clients.
If the newsletter is distributed internally, you might comment upon new procedures or improvements to the business. Sales figures or earnings will show how your business is growing.
Some newsletters include a column that is updated every issue, for instance, an advice column, a book review, a letter from the president, or an editorial. You can also profile new employees or top customers or vendors.

“To catch the reader's attention, place an interesting sentence or quote from the story here.”

Inside Story Headline

This story can fit 75-125 words.
Selecting pictures or graphics is an important part of adding content to your newsletter.
Think about your article and ask yourself if the picture supports or enhances the message you’re trying to convey. Avoid selecting images that appear to be out of context.
Microsoft Publisher includes thousands of clip art images from which you can choose and import into your newsletter. There are also several tools you can use to draw shapes and symbols.
Once you have chosen an image, place it close to the article. Be sure to place the caption of the image near the image.

Organization

Business Name

Primary Business Address
Your Address Line 2
Your Address Line 3
Your Address Line 4

Phone: 555-555-5555
Fax: 555-555-5555
E-mail: someone@example.com

Your business tag line here.

This would be a good place to insert a short paragraph about your organization. It might include the purpose of the organization, its mission, founding date, and a brief history. You could also include a brief list of the types of products, services, or programs your organization offers, the geographic area covered (for example, western U.S. or European markets), and a profile of the types of customers or members served.
It would also be useful to include a contact name for readers who want more information about the organization.

We’re on the Web!
example.com

Back Page Story Headline

This story can fit 175-225 words.
If your newsletter is folded and mailed, this story will appear on the back. So, it’s a good idea to make it easy to read at a glance.
A question and answer session is a good way to quickly capture the attention of readers. You can either compile questions that you’ve received since the last edition or you can summarize some generic questions that are frequently asked about your organization.
A listing of names and titles of managers in your organization is a good way to give your newsletter a personal touch. If your organization is small, you may want to list the names of all employees.
If you have any prices of standard products or services, you can include a listing of those here. You may want to refer your readers to any other forms of communication that you’ve created for your organization.
You can also use this space to remind readers to mark their calendars for a regular event, such as a breakfast meeting for vendors every third Tuesday of the month, or a biannual charity auction.
If space is available, this is a good place to insert a clip art image or some other graphic.

Caption describing picture or graphic.

Caption describing picture or graphic.

Caption describing picture or graphic.

Caption describing picture or graphic.

Caption describing picture or graphic.