COM Events

The COM+ event system introduces Visual Basic programmers to the concept of a loosely coupled event (LCE) system in which event consumers (called subscribers) do not have to declare a variable against the event provider (called a publisher). Instead, the subscriber and publisher both rely on an interface definition in the form of a COM+ event class.

Figure 15.1 illustrates a COM+ event system concept.

Publisher

COM+ Event System

Event Class

Subscriber

Subscriber

Figure 15.1

COM+ event system conceptual diagram

As event classes define the interface that the publisher calls and the subscriber implements they form the primary mechanism for decoupling the event. You must install the event component inside the Component Services dialog box by selecting the Install new event class(es) option.

After you install the event class, you must create a subscriber to receive the new event and implement the interface defined by the event class.

The publisher (the object that performs the event publication) can be a standard module, dynamic link library, or a regular COM+ application, which is a COM+ application that you create by selecting the Install new class(es) option inside the Component Service dialog box. The user application in the client tier is the subscriber that will capture the event later.

The following scenario illustrates the upgrade process of a Visual Basic 6.0 COM+ event.

0 0

Post a comment