Resources | Resources |



Publish and subscribe design pattern

Certain events, such as EVT_NOTIFY, require the applet to register to receive the event. When the event is generated, it is only sent to those clients that have registered to receive the event. This is the Publish and Subscribe design pattern.

The diagram below illustrates the following design pattern:

  • Subscriber 1, a client for a service, is an object or interface that requests data to be provided by another service. The data provided is an event code, a notification, or other data.
  • Publisher 1 is a service, such as the system, an object, or an interface that generates the event code, notification, or other data.
  • A registration database, or system registry, is maintained by the system. This registry records and maps each subscriber to the requested service publisher. Other parameters can be registered to determine how the service is posted.
  • The publisher generates a message and sends it to the system registry. The system then dispatches the message to all registered subscribers for that message.

For more information on event handling, see the Application Management Technology Guide for Developers in on the Brew MP website.