In this note, we motivate announcing and listening
for events, as a useful high-level programming communication and
coordination mechanism.
Events represent an intuitive way of modelling when something happens, as in physics:
In physics, the fundamental concept is EVENT. The collision between one particle and another is an event, with its own location in spacetime. Another event is the emission of a flash of light from an atom. A third is the impact of the pebble that chips the windshield of a speeding car. A fourth event, likewise fixing in and by itself a location in spacetime, is the strike of a lightning bolt on the rudder of an airplane. An event marks a location in spacetime; it is like a steel stake driven into spacetime.-- Taylor and Wheeler, Spacetime Physics: Introduction to Special Relativity, second edition, New York: W.H. Freeman and Company, 1992, page 10
Distributed control using computers has traditionally employed procedural programming using fetch-execute feedback cycles:
while (true) do beginprobe-environment;end
react-accordingly
By contrast, event-oriented programming offers the benefits of direct notification instead of busy-probing; the program tells the environment to inform it when something happens, and when something happens it reacts accordingly.
Note that events also afford a natural way of implementing concurrency. A program can set up multiple event handlers to deal with different things happening independently, and these event handlers can operate in different threads concurrently. Also, since the program does not waste cycles busy-probing, the program itself is free to do other useful things.
Event-oriented programming provides a simple model for component interaction that is useful for distributed control problems such as resource reservation and allocation.
Aspects of the model include:
Adapters are often employed as intermediary event listeners that can reside between event sources and the event listeners that actually want to act on the events generated. Adapters themselves can be chained compositionally, setting up customizable event-triggering networks.
As middlemen, adapters can be delegated one or more useful applications including:
Adam Rifkin, http://www.ifindkarma.com/attic/
PhD-Related Documents, Caltech Infospheres Project
Last modified: Wed Mar 11 19:07:15 PST 1998