Carapace

COM Events

A COM server works on behalf of a COM client as follows:

  1. the client makes a requests on the server;
  2. the server performs the requested task;
  3. the server sends back the results to the client.
However, it is sometimes very useful for the server to notify the client without the client initiating the data transfer -- this is called a COM event.

For example, consider a burglar alarm. A burglar alarm has two distinct interfaces:

  1. administration -- this contains the methods turnOn, turnOff methods
  2. alarm -- this contains the ringTheBell method
The user (client) of the BurglarAlarm object initiates the methods on the 'administration' interface. However, the BurglarAlarm object itself initiates the methods on the 'alarm' interface.

Definition: An event interface is an interface where the methods on the interface are initiated by the object itself.

The 'alarm' interface of the BurglarAlarm object is therefore an event interface.

The other term used for an event interface is an outbound interface since the data flows out of the object without any first coming in from the client.

Definition: An interface is either:

Click here for an example of COM events within Carapace.


Contents Index Current topic: COM Related topics: objects, functions