Browse Prior Art Database

Hierarchical OO Event Firing

IP.com Disclosure Number: IPCOM000123784D
Original Publication Date: 1999-May-01
Included in the Prior Art Database: 2005-Apr-05
Document File: 6 page(s) / 205K

Publishing Venue

IBM

Related People

Lauzon, DM: AUTHOR [+3]

Abstract

A technique of organizing object events in an inheritance hierarchy is provided so that event observers who are listening for events can receive only those events that are of interest to them, while at the same time minimizing the difficulty that a subject (event firing object) has in knowing what events to fire and to what event observers. Fundamentally, the idea is to use OO techniques, specifically inheritance, to enhance the delivery of events.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 45% of the total text.

Hierarchical OO Event Firing

   A technique of organizing object events in an inheritance
hierarchy is provided so that event observers who are listening for
events can receive only those events that are of interest to them,
while at the same time minimizing the difficulty  that a subject
(event firing object) has in knowing what events to fire and to what
event observers.  Fundamentally, the idea is to use OO techniques,
specifically inheritance, to enhance the delivery of events.

   Events have been a part of programming for some time,
particularly graphical user interface (GUI) programming.  Because of
their origin in the world of GUIs, events have always been
considered simple in nature: a button was pushed, a key was entered,
a mouse button was clicked.  However, events can be used as a rich
programming model wherein events are used as one of the primary means
for a subject to communicate to its clients.  The complex
interactions that characterize some clients go far beyond button
pushing and mouse clicking.  Typically, there are a variety of view
screens (observers) that need to keep the data displayed in sync with
many other views and interaction points.  Using the conventional
event observer pattern, each observer would have to register event
listeners (small objects that connect the observer to the subject to
cover any possible interaction.  Sending events to such a large
number of listeners can be inefficient, and is greatly compounded by
the amount of on-screen GUI activity that can occur as a result of
all these events.  Although the standard technique allows observers
to register "areas of interest" this only means that they have to
register an event for every possible area of interest just in case an
event could be fired that would affect what they have displayed in
their screens.  Alternatively, they could register one "mother of all
listeners" to respond to any event which would then require them to
check back with the subject to determine if the specific event really
affects them.

   To overcome these and other disadvantages, there is
provided a technique of categorizing events in an inheritance
hierarchy, and delivering events according to a set of rules that
respects the hierarchy.  More specific events inherit from less
specific, with the hierarchy terminating in "event leaves" that are
very detailed and specific.  The event delivery rules are as
follows:
  o  Every regular (non vetoable) event is delivered to every
     registered regular listener
  o  Every vetoable event is delivered to every registered
     vetoable listener
  o  Each event is delivered in the most specific way possible
     for each given listener
  o  Listeners interested only in specific events can choose to
     override only specific methods
  o  Exactly one method will be invoked in each listener for
     each event delivered
  o  Non-vetoable events are delivered after a change has been
    ...