otm:ordering_of_messages

Controlling Message Causality

A Web application can send several Ajax requests to different servers. However, the application can retrieve and process the server responses in an arbitrary order; meaning that this application may behave nondeterministically due to the lack of control of the causality between Ajax requests and server responses. For example, the figure shows that if a WebApp sends two Ajax requests to a server, two scenarios are possible:the server returns server response 1 followed by server response 2 or vice versa. Depending on the expected behavior of the Web application, different strategies to control the message causality can be used. We now present three Web applications that require three different strategies:

  • FIFO. The FIFO strategy processes the server responses in the same order as the Ajax requests are sent. This example illustrates how to define and use the fifo strategy to create and show correctly a Web page.
  • Discard Late. The Discard Late strategy discards the late (and obsolete) server responses. This example illustrates how to define and use the discard late strategy to show correctly the flow of a streaming media.
  • Discard Early. The Discard Early strategy discards early server responses. This example illustrates how to define and use the discard early strategy to show correctly the first posts of a thread in a forum.

Using WeCa, which combines aspects and message ordering strategies, we develop these strategies.

Go WeCa home.

  • otm/ordering_of_messages.txt
  • Last modified: 2011/06/27 06:19
  • by aspectscript