Check out the new USENIX Web site. next up previous
Next: Communication Up: Triveni: Design and Implementation Previous: Building Triveni processes

   
Events

In a Triveni program design, event labels are closely related to the class names in the event class hierarchy. This class-based view of labels induces an isomorphic hierarchy on the labels. This added structure makes renaming delicate; for example, the renaming of a label corresponding to a superclass has to propagate down the class hierarchy. However, it allows different parts of the system to view the same event object at different levels of granularity.

Example 4  

In Battle, Figure 3 depicts the part of the event class hierarchy related to the class hierarchy for Ship, Submarine, and Battleship. The Battleship class handles Move events. The Submarine class handles Dive events. The presence of the class hierarchy on events allows the generalizing class, the Ship class, in our design to be set up in terms of the generalized event class, the ShipUIEvents class. This makes it independent of whether each one is a battleship, a submarine, or any other type of ship added later.

Consider the following code fragment from Battle. There is a parallel composition (written ||) of several renamed instances of Ship along with the player's window (PlayerWindow).

  LOCAL ShipUIEvent_1, ..., ShipUIEvent_k IN
        PlayerWindow
     || RENAME [ShipUIEvent_1/ShipUIEvent] IN ship_1
        ...
     || RENAME [ShipUIEvent_k/ShipUIEvent] IN ship_k;

Thus, renaming on the event ShipUIEvent in class PlayerOcean induces a renaming on the events Move in the BattleShip class and Dive in the Submarine class.


next up previous
Next: Communication Up: Triveni: Design and Implementation Previous: Building Triveni processes
1998-03-16