otm:ordering_of_messages:fifo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
otm:ordering_of_messages:fifo [2011/01/07 11:46]
aspectscript
otm:ordering_of_messages:fifo [2012/02/06 17:16] (current)
aspectscript
Line 1: Line 1:
-Every day, [[http://en.wikipedia.org/wiki/Mashup_%28web_application_hybrid%29|mashup]] applications are more present. These applications are created with requests to several servers. Developers have to overcome the issue of creating wrong page due to unexpected order of executions of responses. For instance, consider a website that creates a web page from two requests. If the second response is executed before the first response, the web page is created incorrectly. Instead, the if the first response is executed before the second response, the web page is created correctly. The use of **Fifo** strategy can ensure the web page is always created correctly. +====== The FIFO strategy ======
  
-When the **activate order** is clicked, the web page always is created correctly. When the **deactivate order** is clicked, the web page can be created incorrectly.  +A mashup application is created from the combination of information retrieved from different servers, //e.g.// Housing Maps. Programmers have to overcome the issue of creating an incorrect Web page due to an arbitrary (and unexpected) order of server responses. For instance, consider a Web page that is created with two Ajax requests. If the second server response is processed before the first server response, the Web page is created incorrectly. A **FIFO** strategy, which processes the server responses in the same order as the Ajax requests are sent, ensures that the Web page is always created correctly. 
 + 
 +When the "activate order" button is clicked, the web page is created correctly. When the "deactivate order" button is clicked, the web page could create incorrectly. **NOTE:** Please first watch the application without clicking the "activate order" button to appreciate clearly the aforementioned issue. 
  
 <html> <html>
-   <link href="/aspectscript/external/otm/paperExample-SPE/order/style.css" rel="stylesheet" type="text/css"/> +   <link href="/aspectscript/external/otm/paperExample-SPE/style.css" rel="stylesheet" type="text/css"/> 
-  <script type="text/javascript" language="javascript" src="/aspectscript/external/otm/paperExample-SPE/order/lib.js"> </script>+     <script type="text/javascript" language="javascript" src="/aspectscript/external/otm/paperExample-SPE/lib.js"> </script>
    <iframe id="example" src="/aspectscript/external/otm/paperExample-SPE/order/fifo" width="810" height="470"></iframe>        <iframe id="example" src="/aspectscript/external/otm/paperExample-SPE/order/fifo" width="810" height="470"></iframe>    
     <iframe id="code" style="display:none" src="/aspectscript/external/otm/paperExample-SPE/order/fifo/script.js" width="810" height="470"></iframe>     <iframe id="code" style="display:none" src="/aspectscript/external/otm/paperExample-SPE/order/fifo/script.js" width="810" height="470"></iframe>
Line 11: Line 13:
 </html> </html>
  
-The Fifo strategy is implemented how TM advice, which a JavaScript function, that is executed every time the response is retrieved+The FIFO strategy is implemented as piece of advice, which is a JavaScript function, that is executed every time a server response is received
  
 <code javascript> <code javascript>
-var fifo = function(jp){  //jp represents the execution of a response  +var FIFO = function(jp){ 
-    if(this.isEarly(jp)){   +  var request = jp.target; 
-        this.queue.push(jp); +  if (this.idServerRespExpected != request.idServerResp){ 
-    +    this.jpsQueue.push(jp); 
-    else{ +  
-        jp.proceed(); +  else{ 
-        this.updateCr(jp)+    jp.proceed(); 
-        this.queue.executeEarlyJPs(); +    this.idServerRespExpected = request.idServerResp + 1
-    +   // executing jp proceeds that can be executed now 
-};+   this.idServerRespExpected =this.jpsQueue.execRecEarlyJPs(this.idServerRespExpected); 
 +  
 +}
 </code> </code>
  
-Go back the [[http://pleiad.cl/aspectscript/otm/ordering_of_messages|the parent page]] web page.+Go back the [[otm/ordering_of_messages|the parent Web page]].
  • otm/ordering_of_messages/fifo.1294415167.txt.gz
  • Last modified: 2011/01/07 11:46
  • by aspectscript