This is an old revision of the document!


OTM: Open Trace-based Mechanism

Trace-based Mechanisms (TMs) support the definition of entities that observe and react to a program execution trace. TMs define sequences that trigger the execution of pieces of code when these sequences match specified execution traces of a program. TMs have numerous applications in domains like error detection, security, and modular definition of crosscutting concerns.

OTM is an open implementation for existing TMs, like Tracematches , Halo, Alpha, etc. Currently, OTM is implemented for JavaScript as a seamless extension for AscpectScript. Like AspectScript, OTM supports Mozilla Firefox, Safari, Chrome, and Opera (no plug-ins or add-ons required!) and does not extend of the JavaScript syntax. OTM, which follows open implementation as its core design principles, is focused on opening the following three semantics of a TM (see animation):

  • The spawning semantics. This semantics defines when a sequence spawns another sequence using the same specification (e.g. advice) and sharing the history of what the sequence has matched until that moment.

Sequences. In addition, sequences are first-class values and are specified using plain JavaScript functions, bringing the full benefits of the base language, in particular, the combination of higher-order functions and objects. To the best of our knowledge, there is no proposal that allows developers to define sequences expressively and to customize crucial semantics of a TM.

Although OTM is an open implementation of am existing TM, OTM can be used to address distributed system issues that are present in Web applications that use Ajax technologies to send messages between the client(s) and servers. We have addressed two issues: ordering of messages and the matching of causal sequences.

(Under construcction) Do you want to try the Boutique Web application example? Please, visit the paper example page.

Do you want to try OTM? You can download OTM from the following svn: http://pleiad.dcc.uchile.cl/svn/incubator/otm/

Do you have any doubt? Please, do not hesitate to ask in our mailing list.

In this section, you can interactively try OTM. Just write some JavaScript code an press “Run it!”. The code will be automatically transformed and executed in the internal frame below. The HTML code on the second textarea is also appended to the resulting page, so the JavaScript code can access it.


//== helper code ==
var SEs = OTM.SequenceExpressions;
var jpsDiv = document.getElementById("jps");
var a = function(){
    jpsDiv.innerHTML += "[a] ";
};
var b = function(){
    jpsDiv.innerHTML += "[b] ";
};
//====

var seqDef = {
    kind: OTM.AFTER,
    seqExp: SEs.seq(SEs.call(a), SEs.call(b)),
    advice: function (jp){
            jpsDiv.innerHTML += "[MATCH:ab after:" + jp + "] ";
    }
};
OTM.deploy(seqDef);
//executing the a and b functions
a();
b();
This is the list of events seen and matched by the tm:

  • otm.1294809560.txt.gz
  • Last modified: 2011/01/12 01:19
  • by aspectscript