Xtrace: a highlevel extension of Tcl-trace


Florian Murr (Siemens AG, CT IC 7)
Manfred Burger (Siemens AG, CT IC 7)


Tcl has much of the famous "observer pattern" built into the language through the Tcl-"trace" command.
While the Tcl-trace command is best suited for building new commands or control contructs, the observer pattern is often used in a distributed context.
This paper describes the "Xtrace" package which provides functionality that builds upon "trace add variable" and extends it, to be more high-level and support the needs of a distributed observer pattern.
In a basic distributed setting, there is a "model" composed of XOTcl objects that resides at the server. Multiple clients are observers-of / actors-on this model, residing in different processes or even on different machines. The clients are able to change the model, through setting of variables, or through method calls and these changes get propagated back to the clients, assuring that all clients mirror the current state of the model.

Xtrace does interprocess communication over sockets using a companion XOTcl package "xcom" that will also be introduced.