IBM Support

How to implement a Publish/Subscribe design Pattern in IBM Rational Rhapsody

Question & Answer


Question

How do you implement a Publish/Subscribe design Pattern in IBM Rational Rhapsody?

Cause

Rhapsody does not provide a Publish/Subscribe "Design Pattern" example.

Answer

Rhapsody allows you to send events with arguments and using these arguments is one way to implement the pattern.

The subscriber object is passed as an argument to the Publisher object via the evSubscribe event.

The message to be published is sent as an argument via the evPublish event to each Subscriber object subscribed to the Publisher.



Project example is attached below.



Disclaimer:

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21973530